sway: setup swayidle
This commit is contained in:
@@ -1,9 +1,14 @@
|
|||||||
#! /bin/bash
|
#! /bin/bash
|
||||||
|
|
||||||
__lock() {
|
__lock() {
|
||||||
gtklock
|
gtklock -d
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if [[ "$1" == "just-lock" ]]; then
|
||||||
|
__lock
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
amount_of_outputs=$(swaymsg -t get_outputs | grep -i name | wc -l)
|
amount_of_outputs=$(swaymsg -t get_outputs | grep -i name | wc -l)
|
||||||
|
|
||||||
if [[ "$amount_of_outputs" == "1" ]]; then
|
if [[ "$amount_of_outputs" == "1" ]]; then
|
||||||
|
|||||||
@@ -2,8 +2,10 @@
|
|||||||
|
|
||||||
killall swayidle
|
killall swayidle
|
||||||
|
|
||||||
cmd="$DOTFILES/bin/lock.sh"
|
lockCmd="$HOME/dotfiles/bin/lock.sh just-lock"
|
||||||
|
|
||||||
afterResumeCmd="swaymsg seat seat0 cursor set 300 300"
|
swayidle -w \
|
||||||
|
timeout 900 "$lockCmd" \
|
||||||
swayidle before-sleep "$cmd" after-resume "$afterResumeCmd"
|
timeout 900 'swaymsg "output * dpms off"' \
|
||||||
|
resume 'swaymsg "output * dpms on"' \
|
||||||
|
before-sleep "$lockCmd"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"label": "lock",
|
"label": "lock",
|
||||||
"action": "$HOME/dotfiles/bin/lock.sh",
|
"action": "$HOME/dotfiles/bin/lock.sh just-lock",
|
||||||
"text": "",
|
"text": "",
|
||||||
"keybind": "l"
|
"keybind": "l"
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user