@ -1,19 +1,41 @@ |
|||||||
#!/bin/bash |
#!/bin/bash |
||||||
|
|
||||||
# If you have 1440p, better to use this |
# Check if wlogout is already running |
||||||
#wlogout --protocol layer-shell -b 5 -T 600 -B 600 & |
if pgrep -x "wlogout" > /dev/null; then |
||||||
|
pkill -x "wlogout" |
||||||
# for 1080p |
exit 0 |
||||||
wlogout --protocol layer-shell -b 5 -T 450 -B 450 & |
fi |
||||||
|
|
||||||
|
# detect monitor res |
||||||
|
x_mon=$(hyprctl -j monitors | jq '.[] | select(.focused==true) | .width') |
||||||
|
y_mon=$(hyprctl -j monitors | jq '.[] | select(.focused==true) | .height') |
||||||
|
hypr_scale=$(hyprctl -j monitors | jq '.[] | select (.focused == true) | .scale' | sed 's/\.//') |
||||||
|
|
||||||
# Capture the PID of the wlogout process |
# Set parameters based on screen resolution |
||||||
wlogout_pid=$! |
if [[ $x_mon =~ ^[0-9]+$ && $y_mon =~ ^[0-9]+$ && $hypr_scale =~ ^[0-9]+$ ]]; then |
||||||
|
resolution=$((y_mon * hypr_scale / 100)) |
||||||
|
|
||||||
# Wait for up to 30 seconds for wlogout to exit gracefully |
echo "Detected Resolution: $resolution" |
||||||
timeout 30s tail --pid $wlogout_pid -f /dev/null |
|
||||||
|
|
||||||
# If wlogout is still running after the timeout, forcefully kill it |
if ((resolution >= 2160)); then |
||||||
if ps -p $wlogout_pid > /dev/null; then |
wlogout --protocol layer-shell -b 6 -T 600 -B 700 & |
||||||
kill -KILL $wlogout_pid |
echo "Setting parameters for resolution >= 2160p" |
||||||
|
elif ((resolution >= 1440)); then |
||||||
|
wlogout --protocol layer-shell -b 6 -T 500 -B 550 & |
||||||
|
echo "Setting parameters for resolution >= 1440p" |
||||||
|
elif ((resolution >= 1080)); then |
||||||
|
wlogout --protocol layer-shell -b 6 -T 400 -B 400 & |
||||||
|
echo "Setting parameters for resolution >= 1080p" |
||||||
|
elif ((resolution >= 720)); then |
||||||
|
wlogout --protocol layer-shell -b 3 -T 50 -B 50 & |
||||||
|
echo "Setting parameters for resolution >= 720p" |
||||||
|
fi |
||||||
fi |
fi |
||||||
|
|
||||||
|
# Give some time for wlogout to start and exit |
||||||
|
#sleep 30 |
||||||
|
|
||||||
|
# Check if wlogout is still running after starting |
||||||
|
#if pgrep -x "wlogout" > /dev/null; then |
||||||
|
# pkill -x "wlogout" |
||||||
|
#fi |
||||||
|
|||||||
|
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 5.6 KiB |
|
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 5.6 KiB |
|
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 5.6 KiB |
|
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 5.6 KiB |
|
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 3.7 KiB |
|
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 3.7 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 7.6 KiB After Width: | Height: | Size: 7.6 KiB |
|
Before Width: | Height: | Size: 7.6 KiB After Width: | Height: | Size: 7.6 KiB |
|
After Width: | Height: | Size: 7.8 KiB |
|
After Width: | Height: | Size: 6.4 KiB |
@ -1,113 +1,87 @@ |
|||||||
|
/* ----------- 💫 https://github.com/JaKooLit 💫 -------- */ |
||||||
|
/* pywal-wlogout */ |
||||||
|
|
||||||
|
/* Importing pywal colors */ |
||||||
|
|
||||||
|
@import '../../.cache/wal/colors-waybar.css'; |
||||||
|
|
||||||
window { |
window { |
||||||
font-family: monospace; |
font-family: Fira Code Medium; |
||||||
font-size: 14pt; |
font-size: 16pt; |
||||||
color: #cdd6f4; /* text */ |
color: #cdd6f4; /* text */ |
||||||
background-color: rgba(30, 30, 46, 0.5); |
background-color: rgba(30, 30, 46, 0.6); |
||||||
} |
} |
||||||
|
|
||||||
button { |
button { |
||||||
background-repeat: no-repeat; |
background-repeat: no-repeat; |
||||||
background-position: center; |
background-position: center; |
||||||
background-size: 25%; |
background-size: 20%; |
||||||
border: none; |
background-color: rgba(200, 220, 255, 0); |
||||||
background-color: rgba(30, 30, 46, 0); |
|
||||||
margin: 5px; |
|
||||||
animation: gradient_f 20s ease-in infinite; |
animation: gradient_f 20s ease-in infinite; |
||||||
transition: box-shadow 0.2s ease-in-out, background-color 0.2s ease-in-out; |
border-radius: 80px; /* Increased border radius for a more rounded look */ |
||||||
} |
} |
||||||
|
|
||||||
button:hover#lock { |
button:focus { |
||||||
/*background-color: rgba(49, 50, 68, 0.2);*/ |
|
||||||
background-size: 25%; |
background-size: 25%; |
||||||
margin-right : 30px; |
border: 0px; |
||||||
margin-bottom : 30px; |
|
||||||
border-radius: 20px; |
|
||||||
animation: gradient_f 20s ease-in infinite; |
|
||||||
transition: all 0.3s cubic-bezier(.55,0.0,.28,1.682); |
|
||||||
} |
|
||||||
|
|
||||||
button:hover#logout { |
|
||||||
/*background-color: rgba(49, 50, 68, 0.2);*/ |
|
||||||
background-size: 25%; |
|
||||||
margin-right : 30px; |
|
||||||
margin-top : 30px; |
|
||||||
border-radius: 20px; |
|
||||||
animation: gradient_f 20s ease-in infinite; |
|
||||||
transition: all 0.3s cubic-bezier(.55,0.0,.28,1.682); |
|
||||||
} |
} |
||||||
|
|
||||||
button:hover#shutdown { |
button:hover { |
||||||
/*background-color: rgba(49, 50, 68, 0.2);*/ |
background-color: @color2; |
||||||
background-size: 25%; |
color: #1e1e2e; |
||||||
margin-left : 20px; |
background-size: 50%; |
||||||
margin-bottom : 30px; |
margin: 30px; |
||||||
border-radius: 20px; |
border-radius: 80px; |
||||||
animation: gradient_f 20s ease-in infinite; |
transition: all 0.3s cubic-bezier(.55, 0.0, .28, 1.682), box-shadow 0.2s ease-in-out, background-color 0.2s ease-in-out; |
||||||
transition: all 0.3s cubic-bezier(.55,0.0,.28,1.682); |
box-shadow: 0 0 20px @color7; |
||||||
} |
|
||||||
|
|
||||||
button:hover#reboot { |
|
||||||
/*background-color: rgba(49, 50, 68, 0.2);*/ |
|
||||||
background-size: 25%; |
|
||||||
margin-left : 30px; |
|
||||||
margin-top : 30px; |
|
||||||
border-radius: 20px; |
|
||||||
animation: gradient_f 20s ease-in infinite; |
|
||||||
transition: all 0.3s cubic-bezier(.55,0.0,.28,1.682); |
|
||||||
} |
} |
||||||
|
|
||||||
button:hover#suspend { |
/* Adjust the size of the icon or content inside the button */ |
||||||
/*background-color: rgba(49, 50, 68, 0.2);*/ |
button span { |
||||||
background-size: 25%; |
font-size: 1.2em; /* Increase the font size */ |
||||||
margin-left : 30px; |
|
||||||
margin-top : 30px; |
|
||||||
border-radius: 20px; |
|
||||||
animation: gradient_f 20s ease-in infinite; |
|
||||||
transition: all 0.3s cubic-bezier(.55,0.0,.28,1.682); |
|
||||||
} |
} |
||||||
|
|
||||||
button:focus { |
|
||||||
background-color: rgba(180, 190, 254, 0.3); |
|
||||||
color: #1e1e2e; |
|
||||||
background-size: 25%; |
|
||||||
margin-left : 30px; |
|
||||||
margin-top : 30px; |
|
||||||
border-radius: 20px; |
|
||||||
animation: gradient_f 20s ease-in infinite; |
|
||||||
transition: all 0.3s cubic-bezier(.55,0.0,.28,1.682); |
|
||||||
} |
|
||||||
|
|
||||||
#lock { |
#lock { |
||||||
background-image: image(url("./lock.png")); |
background-image: image(url("./icons/lock.png")); |
||||||
} |
} |
||||||
#lock:focus { |
#lock:hover { |
||||||
background-image: image(url("./lock-hover.png")); |
background-image: image(url("./icons/lock-hover.png")); |
||||||
} |
} |
||||||
|
|
||||||
#logout { |
#logout { |
||||||
background-image: image(url("./logout.png")); |
background-image: image(url("./icons/logout.png")); |
||||||
} |
} |
||||||
#logout:focus { |
#logout:hover { |
||||||
background-image: image(url("./logout-hover.png")); |
background-image: image(url("./icons/logout-hover.png")); |
||||||
} |
} |
||||||
|
|
||||||
#suspend { |
#suspend { |
||||||
background-image: image(url("./sleep.png")); |
background-image: image(url("./icons/sleep.png")); |
||||||
} |
} |
||||||
#suspend:focus { |
#suspend:hover { |
||||||
background-image: image(url("./sleep-hover.png")); |
background-image: image(url("./icons/sleep-hover.png")); |
||||||
} |
} |
||||||
|
|
||||||
#shutdown { |
#shutdown { |
||||||
background-image: image(url("./power.png")); |
background-image: image(url("./icons/power.png")); |
||||||
} |
} |
||||||
#shutdown:focus { |
#shutdown:hover { |
||||||
background-image: image(url("./power-hover.png")); |
background-image: image(url("./icons/power-hover.png")); |
||||||
} |
} |
||||||
|
|
||||||
#reboot { |
#reboot { |
||||||
background-image: image(url("./restart.png")); |
background-image: image(url("./icons/restart.png")); |
||||||
|
} |
||||||
|
#reboot:hover { |
||||||
|
background-image: image(url("./icons/restart-hover.png")); |
||||||
|
} |
||||||
|
|
||||||
|
#hibernate { |
||||||
|
background-image: image(url("./icons/hibernate.png")); |
||||||
} |
} |
||||||
#reboot:focus { |
#hibernate:hover { |
||||||
background-image: image(url("./restart-hover.png")); |
background-image: image(url("./icons/hibernate-hover.png")); |
||||||
} |
} |
||||||
|
|||||||