aboutsummaryrefslogtreecommitdiff
path: root/env/.config/wlogout/wlogout.sh
blob: c13945c41c3333acdc1a51b44298dfd20ed3bc17 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/env bash
# https://github.com/zDyanTB/HyprNova/blob/master/.config/hypr/scripts/wlogout.sh
A_1080=1000
B_1080=1000

# Check if wlogout is already running
if pgrep -x "wlogout" > /dev/null; then
    pkill -x "wlogout"
    exit 0
fi

# Detect monitor resolution and scaling factor
resolution=$(hyprctl -j monitors | jq -r '.[] | select(.focused==true) | .height / .scale' | awk -F'.' '{print $1}')
hypr_scale=$(hyprctl -j monitors | jq -r '.[] | select(.focused==true) | .scale')
wlogout --protocol layer-shell -b 4 -T $(awk "BEGIN {printf \"%.0f\", $A_1080 * 1080 * $hypr_scale / $resolution}") -B $(awk "BEGIN {printf \"%.0f\", $B_1080 * 1080 * $hypr_scale / $resolution}") &