diff options
-rwxr-xr-x | bin/lock | 97 | ||||
-rwxr-xr-x | bin/lockscr1 | 29 | ||||
-rwxr-xr-x | bin/lockscr2 | 29 | ||||
-rwxr-xr-x | bin/permafocus | 50 | ||||
-rwxr-xr-x | bspwmrc | 2 | ||||
-rwxr-xr-x | install.sh | 1 | ||||
-rw-r--r-- | sxhkdrc | 2 |
7 files changed, 3 insertions, 207 deletions
diff --git a/bin/lock b/bin/lock deleted file mode 100755 index c643ee4..0000000 --- a/bin/lock +++ /dev/null @@ -1,97 +0,0 @@ -#! /bin/bash - -# Copyright (C) 2022 HimbeerserverDE -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <https://www.gnu.org/licenses/>. - -refocus_fullscreen_nodes() { - while [ -z "$(pgrep -x permafocus)" ]; do sleep 1; done - - for NODE in ${FULLSCREEN_NODES}; do - bspc node ${NODE} -t fullscreen - done -} - -mark_as_ready() { - while [ -z "$(pgrep -x permafocus)" ]; do sleep 1; done - - sleep 2 - exec ${XSS_SLEEP_LOCK_FD}>&- -} - -if [ $(pgrep -x lock | wc -l) -gt 2 ]; then - # Starting multiple screen lock instances may cause unintended side effects - exit 0 -fi - -# -# Security -# - -touch /tmp/lock-xkbfile-${UID} -chmod 0600 /tmp/lock-xkbfile-${UID} -xkbcomp $DISPLAY /tmp/lock-xkbfile-${UID} 2>/dev/null - -xkbcomp ~/.local/bspwm-setup/lockscreen.xkb $DISPLAY 2>/dev/null - -killall -qw sxhkd polybar -dunstctl set-paused true - -# -# UI -# - -FOCUSED_MONITOR=$(bspc query -M -m) -FULLSCREEN_NODES=$(bspc query -N -n any.fullscreen) - -bspc monitor -f 1 -WINIT_X11_SCALE_FACTOR=1.0 ~/.cargo/bin/alacritty -e ~/bin/lockscr1 & - -while [ -z "$(ps -C lockscr1 -o pid=)" ]; do sleep 1; done -while [ -z "$(ps -s $(ps -C lockscr1 -o pid=) -o pid=)" ]; do sleep 1; done -PRIMARY_WINDOW=$(bspc query -N -n) - -if [ -n "$(xrandr --listmonitors | grep 'DP-2')" ]; then - bspc monitor -f 2 - WINIT_X11_SCALE_FACTOR=1.0 ~/.cargo/bin/alacritty -e ~/bin/lockscr2 & - - while [ -z "$(ps -C lockscr2 -o pid=)" ]; do sleep 1; done - while [ -z "$(ps -s $(ps -C lockscr2 -o pid=) -o pid=)" ]; do sleep 1; done - SECONDARY_WINDOW=$(bspc query -N -n) -fi - -refocus_fullscreen_nodes & - -mark_as_ready & - -~/bin/permafocus ${PRIMARY_WINDOW} ${SECONDARY_WINDOW} - -# -# Unlock -# - -xkbcomp /tmp/lock-xkbfile-${UID} $DISPLAY 2>/dev/null -dunstctl set-paused false - -bspc node ${PRIMARY_WINDOW} -k - -if [ -n "${SECONDARY_WINDOW}" ]; then - bspc node ${SECONDARY_WINDOW} -k -fi - -# Kill second tty-clock -kill -9 $(ps -s $(ps -C lockscr2 -o pid=) -o pid=) - -bspc monitor -f ${FOCUSED_MONITOR} -bspc wm -r diff --git a/bin/lockscr1 b/bin/lockscr1 deleted file mode 100755 index 4620b5a..0000000 --- a/bin/lockscr1 +++ /dev/null @@ -1,29 +0,0 @@ -#! /bin/bash - -# Copyright (C) 2022 HimbeerserverDE -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <https://www.gnu.org/licenses/>. - -main() { - clear - - tty-clock -r -D -B -s -S - su $USER sh -c '' || main -} - -trap "" 1 2 3 15 20 SIGTSTP - -sleep 1 - -main diff --git a/bin/lockscr2 b/bin/lockscr2 deleted file mode 100755 index 09dcc8e..0000000 --- a/bin/lockscr2 +++ /dev/null @@ -1,29 +0,0 @@ -#! /bin/bash - -# Copyright (C) 2022 HimbeerserverDE -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <https://www.gnu.org/licenses/>. - -main() { - clear - - tty-clock -r -D -B -s -S - pgrep -x lockscr1 && main -} - -trap "" 1 2 3 15 20 SIGTSTP - -sleep 1 - -main diff --git a/bin/permafocus b/bin/permafocus deleted file mode 100755 index cad7a9a..0000000 --- a/bin/permafocus +++ /dev/null @@ -1,50 +0,0 @@ -#! /bin/bash - -# Copyright (C) 2022 HimbeerserverDE -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <https://www.gnu.org/licenses/>. - -# THIS SCRIPT MUST ONLY BE CALLED BY THE SCREENSAVER! -# OTHER CALLERS WILL INTERFERE WITH SCREENSAVER OPERATION! - -bspc node -f $2 -bspc node $2 -t fullscreen -bspc node $2 -l above - -bspc node -f $1 -bspc node $1 -t fullscreen -bspc node $1 -l above - -sleep 1 - -killall -q -9 su - -while [ -n "$(bspc query -N -n $1)" ]; do - while [[ "$(bspc query -N -n focused)" == "$1" ]]; do sleep 1; done - sleep 2 - - if [ -n "$(bspc query -N -n $1)" ]; then - bspc node -f $2 - bspc node $2 -t fullscreen - bspc node $2 -l above - - bspc node -f $1 - bspc node $1 -t fullscreen - bspc node $1 -l above - - sleep 1 - - killall -q -9 su - fi -done @@ -19,7 +19,7 @@ setxkbmap -layout de pgrep -x sxhkd > /dev/null || sxhkd & -xss-lock --transfer-sleep-lock -- ~/bin/lock & +xss-lock --transfer-sleep-lock -- i3lock-fancy-rapid 1 10 & ~/.fehbg killall -qw picom; picom -b @@ -63,6 +63,7 @@ if command_exists pacman; then pulseaudio bin/aurinstall --noconfirm cava + bin/aurinstall --noconfirm i3lock-fancy-rapid-git elif command_exists apt; then wget -O- https://updates.signal.org/desktop/apt/keys.asc | ${SUDO} apt-key add - echo "deb [arch=$(dpkg --print-architecture)] https://updates.signal.org/desktop/apt xenial main" | sudo tee -a /etc/apt/sources.list.d/signal-xenial.list @@ -48,7 +48,7 @@ XF86MonBrightnessUp # lock screen super + l - ~/bin/lock + i3lock-fancy-rapid 1 10 # power off/reboot/hibernate/suspend super + alt + {s,a,y,m} |