aboutsummaryrefslogtreecommitdiff
path: root/dotfiles
diff options
context:
space:
mode:
authorYaroslav <contact@yaroslavps.com>2020-09-10 09:50:02 +0300
committerYaroslav <contact@yaroslavps.com>2020-09-10 09:50:02 +0300
commitd48fc92bcb7c0dbf49883aab54ff495d95386785 (patch)
tree97c23029e3283f69c0ba20a79c7e563d4c5a0609 /dotfiles
parentdb6706d3211ba2841140ec0a7101d9b740b86363 (diff)
downloadswayrice-d48fc92bcb7c0dbf49883aab54ff495d95386785.tar.gz
swayrice-d48fc92bcb7c0dbf49883aab54ff495d95386785.zip
shortcut to lock screen without screen timeout
Diffstat (limited to 'dotfiles')
-rw-r--r--dotfiles/.config/sway/config1
-rwxr-xr-xdotfiles/.local/bin/lock-color5
2 files changed, 5 insertions, 1 deletions
diff --git a/dotfiles/.config/sway/config b/dotfiles/.config/sway/config
index 7939442..1019d0a 100644
--- a/dotfiles/.config/sway/config
+++ b/dotfiles/.config/sway/config
@@ -339,6 +339,7 @@ bindsym --to-code {
# Lock screen
$mod+x exec --no-startup-id lock-color
+ $mod+Shift+x exec --no-startup-id lock-color screenon
# Gaps
$mod+semicolon gaps inner current set 15; gaps outer current set 0
diff --git a/dotfiles/.local/bin/lock-color b/dotfiles/.local/bin/lock-color
index 0026842..2d30e0b 100755
--- a/dotfiles/.local/bin/lock-color
+++ b/dotfiles/.local/bin/lock-color
@@ -4,7 +4,10 @@ swaymsg input type:keyboard xkb_switch_layout 0
gpg-connect-agent --no-autostart reloadagent /bye
-swayidle timeout 30 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' &
+if [ "$1" != "screenon" ]; then
+ swayidle timeout 30 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' &
+fi
+
swaylock
pkill -n swayidle