From cf2c54a481a587af7639ec936e66895aa1153b4c Mon Sep 17 00:00:00 2001 From: Yaroslav Date: Mon, 21 Oct 2019 22:23:00 +0300 Subject: got rid of xorg and i3 dependencies on some scripts --- dotfiles/.config/sway/config | 1 - dotfiles/.scripts/i3session | 35 ----------------------------------- dotfiles/.scripts/menusession | 2 +- dotfiles/.scripts/setbglblur | 4 ++-- dotfiles/.scripts/setbglsimple | 4 ++-- dotfiles/.scripts/swaysession | 35 +++++++++++++++++++++++++++++++++++ 6 files changed, 40 insertions(+), 41 deletions(-) delete mode 100755 dotfiles/.scripts/i3session create mode 100755 dotfiles/.scripts/swaysession diff --git a/dotfiles/.config/sway/config b/dotfiles/.config/sway/config index c1a6c1d..f1f80d0 100644 --- a/dotfiles/.config/sway/config +++ b/dotfiles/.config/sway/config @@ -6,7 +6,6 @@ set $mod Mod4 set $term termite set $browser "qutebrowser" -set $stoprec --no-startup-id dmenurecord kill # set default desktop layout (default is tiling) # workspace_layout tabbed diff --git a/dotfiles/.scripts/i3session b/dotfiles/.scripts/i3session deleted file mode 100755 index 17f99ca..0000000 --- a/dotfiles/.scripts/i3session +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh -# /usr/bin/i3exit - -# on void just sudo -[[ $(cat /proc/1/comm) == "systemd" ]] && logind=systemctl || logind=loginctl - -case "$1" in - lock) - lock-color - ;; - logout) - swaymsg exit - ;; - switch_user) - dm-tool switch-to-greeter - ;; - suspend) - lock-color & sleep 1 && $logind suspend - ;; - hibernate) - lock-color & sleep 1 && $logind hibernate - ;; - reboot) - $logind reboot - ;; - shutdown) - $logind poweroff - ;; - *) - echo "== ! i3exit: missing or invalid argument ! ==" - echo "Try again with: lock | logout | switch_user | suspend | hibernate | reboot | shutdown" - exit 2 -esac - -exit 0 diff --git a/dotfiles/.scripts/menusession b/dotfiles/.scripts/menusession index fc5260b..9a4ae8c 100755 --- a/dotfiles/.scripts/menusession +++ b/dotfiles/.scripts/menusession @@ -5,4 +5,4 @@ action=$(printf "logout\nsuspend\nreboot\nshutdown\n" | bemenu -p "What to do?" $BEMENU_OPTIONS) -i3session $action +swaysession $action diff --git a/dotfiles/.scripts/setbglblur b/dotfiles/.scripts/setbglblur index 8de5e6f..8a3d51b 100755 --- a/dotfiles/.scripts/setbglblur +++ b/dotfiles/.scripts/setbglblur @@ -1,7 +1,7 @@ #!/bin/sh -vertical=$(($(xdotool getdisplaygeometry | awk '{print $2}') - newsize)) -horizontal=$(($(xdotool getdisplaygeometry | awk '{print $1}') - newwidth)) +vertical=$(swaymsg -t get_outputs | jq ".[0].current_mode.height") +horizontal=$(swaymsg -t get_outputs | jq ".[0].current_mode.width") convert $1 -resize ${horizontal}x${vertical}\> ~/.config/lockwall.png convert ~/.config/lockwall.png -brightness-contrast -20,-20 -paint 1 -noise 0x8 -blur 9,9 ~/.config/lockwall.png diff --git a/dotfiles/.scripts/setbglsimple b/dotfiles/.scripts/setbglsimple index ea2c5f2..51ac5ba 100755 --- a/dotfiles/.scripts/setbglsimple +++ b/dotfiles/.scripts/setbglsimple @@ -1,7 +1,7 @@ #!/bin/sh -vertical=$(($(xdotool getdisplaygeometry | awk '{print $2}') - newsize)) -horizontal=$(($(xdotool getdisplaygeometry | awk '{print $1}') - newwidth)) +vertical=$(swaymsg -t get_outputs | jq ".[0].current_mode.height") +horizontal=$(swaymsg -t get_outputs | jq ".[0].current_mode.width") convert $1 -resize ${horizontal}x${vertical}\> ~/.config/lockwall.png convert ~/.config/lockwall.png ~/.config/lock.png -gravity center -composite ~/.config/lockwall.png diff --git a/dotfiles/.scripts/swaysession b/dotfiles/.scripts/swaysession new file mode 100755 index 0000000..17f99ca --- /dev/null +++ b/dotfiles/.scripts/swaysession @@ -0,0 +1,35 @@ +#!/bin/sh +# /usr/bin/i3exit + +# on void just sudo +[[ $(cat /proc/1/comm) == "systemd" ]] && logind=systemctl || logind=loginctl + +case "$1" in + lock) + lock-color + ;; + logout) + swaymsg exit + ;; + switch_user) + dm-tool switch-to-greeter + ;; + suspend) + lock-color & sleep 1 && $logind suspend + ;; + hibernate) + lock-color & sleep 1 && $logind hibernate + ;; + reboot) + $logind reboot + ;; + shutdown) + $logind poweroff + ;; + *) + echo "== ! i3exit: missing or invalid argument ! ==" + echo "Try again with: lock | logout | switch_user | suspend | hibernate | reboot | shutdown" + exit 2 +esac + +exit 0 -- cgit v1.2.3