sway: add swaylock-effects

This commit is contained in:
Marco Thomas
2022-09-23 16:57:41 +02:00
parent 7098a0efe1
commit 615b7e9b8f
5 changed files with 39 additions and 10 deletions

View File

@@ -20,6 +20,7 @@ and start it appropriately.
+ `wob` (progress bar)
+ `wofi` (launcher)
+ `slurp`, `grim`, `swappy` (screenshot)
+ `swaylock-effects`
+ [`wmrctl`](https://git.sr.ht/~brocellous/wlrctl) (window switcher)
### other (used in scripts)

View File

@@ -59,15 +59,12 @@ bindswitch --reload --locked lid:on output $laptop disable
bindswitch --reload --locked lid:off output $laptop enable
# Idle configuration
# set lock and save to script, so other programs can also use it
set $lock 'loginctl lock-session && swaylock -f --image /tmp/lock.png --indicator-idle-visible -F'
exec_always echo $lock > ~/.local/bin/lock.sh
exec_always chmod +x ~/.local/bin/lock.sh
set $lock 'loginctl lock-session && bash ~/.dots/lock.sh'
# Lock after 20 minutes, lock before suspend
exec swayidle -w \
timeout 1200 ~/.local/bin/lock.sh \
before-sleep ~/.local/bin/lock.sh
timeout 1200 ~/.dots/lock.sh \
before-sleep ~/.dots/lock.sh
#timeout 1320 'systemctl suspend' \
# Input configuration
@@ -112,7 +109,7 @@ bindswitch --reload --locked lid:off output $laptop enable
# show shutdown menu
bindsym $mod+Ctrl+Backspace exec \
printf "/home/marc/.local/bin/lock.sh\nsystemctl suspend\nswaymsg reload\nshutdown now\nloginctl terminate-user marc" \
printf "/home/marc/.dots/lock.sh\nsystemctl suspend\nswaymsg reload\nshutdown now\nloginctl terminate-user marc" \
| wofi -d -p "Power" -L 6 \
| xargs -d '\n' -r /bin/bash -c
@@ -234,7 +231,7 @@ bindswitch --reload --locked lid:off output $laptop enable
for_window [class="discord"] move container to workspace number $ws3
for_window [app_id="org.telegram.desktop"] move container to workspace number $ws3
for_window [class="Spotify"] move container to workspace number $ws4
for_window [class="Joplin"] move container to workspace number $ws5
for_window [app_id="pavucontrol"] move container to workspace number $ws4
for_window [app_id="evolution"] move container to workspace number $ws8
for_window [app_id="org.keepassxc.KeePassXC"] move container to workspace number $ws9
@@ -243,7 +240,7 @@ bindswitch --reload --locked lid:off output $laptop enable
bindsym $mod+Ctrl+1 exec alacritty --command bash tmux_detect.sh
bindsym $mod+Ctrl+2 exec firefox
bindsym $mod+Ctrl+3 exec discord
bindsym $mod+Ctrl+4 exec spotify
bindsym $mod+Ctrl+4 exec "spotify; pavucontrol"
bindsym $mod+Ctrl+8 exec evolution
bindsym $mod+Ctrl+9 exec keepassxc

View File

@@ -45,6 +45,8 @@ bind-key -n 'M-Right' resize-pane -R
bind-key -n 'M-Up' resize-pane -U
bind-key -n 'M-Down' resize-pane -D
# alias
set -s command-alias[1] respawn='respawn-pane -k'
# make escape bindings of programs work in tmux
set -s escape-time 5

View File

@@ -15,7 +15,7 @@ GIT="%{$fg[red]%}\$vcs_info_msg_0_"
HOSTN="%{$fg[yellow]%}%m "
BREAK=''
[ $(tput cols) -lt 150 ] && BREAK=$'\n'
[ $(tput cols) -lt 60 ] && BREAK=$'\n'
export PROMPT="${HOSTN}${DIR}${GIT} ${BREAK}${ICON}%{$reset_color%} "
zstyle ':vcs_info:git:*' formats ' (%b )'

29
lock.sh Executable file
View File

@@ -0,0 +1,29 @@
# requires swaylock-effects
FG="5c6a72"
RED="f85552"
BLUE="3a94c5"
YELLOW="dfa000"
GREEN="8da101"
swaylock \
-F \
--image /tmp/lock.png \
--indicator-idle-visible \
--clock --timestr "%I:%M" --datestr "" \
--font "SFMono Nerd Font" \
--indicator-radius 80 \
--fade-in 0.2 \
--line-uses-inside \
--line-uses-ring \
--key-hl-color "606e01" \
--bs-hl-color $RED \
--ring-color $GREEN \
--separator-color $GREEN \
--ring-clear-color $YELLOW \
--text-clear-color "00000000" \
--ring-ver-color $BLUE \
--text-ver-color "00000000" \
--ring-wrong-color $RED \
--text-wrong-color "00000000" \
--text-color $GREEN