From 98ce5ad0815d7a2e8d703b4c3999c8514569ec6c Mon Sep 17 00:00:00 2001 From: Don Armstrong Date: Sun, 22 Nov 2020 16:22:25 -0800 Subject: [PATCH] use xss lock or ~/bin/scrensaver if it exists; fix lock --- .config/i3/config_base | 2 +- .xsession | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.config/i3/config_base b/.config/i3/config_base index b807886..97fa923 100644 --- a/.config/i3/config_base +++ b/.config/i3/config_base @@ -192,7 +192,7 @@ bindsym XF86MonBrightnessDown exec sudo /home/don/bin/intel_brightness dec # seach/tools/wlan/display bindsym XF86WLAN exec --no-startup-id toggle_rfkill #bindsym XF86Display exec presentation_mode -bindsym $mod+minus exec "sh -c 'xscreensaver-command -lock; xautolock -locknow'" +bindsym $mod+minus exec "sh -c 'loginctl lock-session || xscreensaver-command -lock || xautolock -locknow'" # Start i3bar to display a workspace bar (plus the system information i3status # finds out, if available) diff --git a/.xsession b/.xsession index d622c43..a60ea84 100755 --- a/.xsession +++ b/.xsession @@ -56,12 +56,22 @@ if [ -e ~/.Xauthority ]; then cp -f .Xauthority .Xauthority.bak fi -if cmd_exists slock && cmd_exists xautolock; then +if [ -e ~/bin/screensaver ]; then + ~/bin/screensaver on; +elif cmd_exists i3lock && cmd_exists xss-lock; then + fork xss-lock -l -- ~/bin/locker +elif cmd_exists slock && cmd_exists xautolock; then fork xautolock -notifier true -bell 0 -locker slock; + if cmd_exists xss-lock; then + fork xss-lock -- xautolock -locknow; + fi; elif cmd_exists xscreensaver && [ -e ~/.xscreensaver ]; then fork XENVIRONMENT=~/.xscreensaver /usr/bin/xscreensaver; elif cmd_exists xautolock; then fork xautolock -notifier true -bell 0; + if cmd_exists xss-lock; then + fork xss-lock -- xautolock -locknow; + fi; fi; if cmd_exists redshift; then -- 2.39.2