Fix swaylock config

This commit is contained in:
2021-04-26 12:01:23 +02:00
parent d601f800c1
commit 0840364f07
3 changed files with 84 additions and 14 deletions

View File

@ -26,7 +26,6 @@ xwayland enable
### Output configuration ### Output configuration
# #
# Default wallpaper (more resolutions are available in /usr/share/backgrounds/sway/) # Default wallpaper (more resolutions are available in /usr/share/backgrounds/sway/)
#output * bg /usr/share/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png fill
output * bg ~/.config/sway/background.png fill output * bg ~/.config/sway/background.png fill
# Window decoration # Window decoration
@ -53,9 +52,9 @@ exec mako
# Example configuration: # Example configuration:
# #
exec swayidle -w \ exec swayidle -w \
timeout 300 'swaylock -f -c 000000' \ timeout 300 'swaylock-cool -f' \
timeout 600 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \ timeout 600 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \
before-sleep 'swaylock -f -c 000000' before-sleep 'swaylock-cool -f'
# This will lock your screen after 300 seconds of inactivity, then turn off # This will lock your screen after 300 seconds of inactivity, then turn off
# your displays after another 300 seconds, and turn your screens back on when # your displays after another 300 seconds, and turn your screens back on when
@ -92,6 +91,9 @@ input * {
# Start your launcher # Start your launcher
bindsym $mod+d exec $menu bindsym $mod+d exec $menu
# Lock the screen
bindsym $mod+Shift+Plus exec "swaylock-cool -f"
# Drag floating windows by holding down $mod and left mouse button. # Drag floating windows by holding down $mod and left mouse button.
# Resize them with right mouse button + $mod. # Resize them with right mouse button + $mod.
# Despite the name, also works for non-floating windows. # Despite the name, also works for non-floating windows.
@ -107,17 +109,17 @@ input * {
# #
# Volume & Brightness # Volume & Brightness
# #
#bindsym XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +5% #bindsym XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +5%
#bindsym XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -5% #bindsym XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -5%
bindsym XF86AudioRaiseVolume exec volup bindsym XF86AudioRaiseVolume exec volup
bindsym XF86AudioLowerVolume exec voldown bindsym XF86AudioLowerVolume exec voldown
bindsym XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle bindsym XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle
bindsym XF86AudioMicMute exec pactl set-source-mute @DEFAULT_SOURCE@ toggle bindsym XF86AudioMicMute exec pactl set-source-mute @DEFAULT_SOURCE@ toggle
bindsym XF86MonBrightnessDown exec brightnessctl set 10%- bindsym XF86MonBrightnessDown exec brightnessctl set 10%-
bindsym XF86MonBrightnessUp exec brightnessctl set +10% bindsym XF86MonBrightnessUp exec brightnessctl set +10%
bindsym XF86AudioPlay exec playerctl play-pause bindsym XF86AudioPlay exec playerctl play-pause
bindsym XF86AudioNext exec playerctl next bindsym XF86AudioNext exec playerctl next
bindsym XF86AudioPrev exec playerctl previous bindsym XF86AudioPrev exec playerctl previous
# #
# Moving around: # Moving around:
# #

View File

@ -0,0 +1,39 @@
ignore-empty-password
font=Ubuntu
indicator-idle-visible
indicator-radius=240
indicator-thickness=20
indicator-caps-lock
key-hl-color=880033
separator-color=00000000
inside-color=00000099
inside-clear-color=ffd20400
inside-caps-lock-color=009ddc00
inside-ver-color=d9d8d800
inside-wrong-color=ee2e2400
ring-color=231f20D9
ring-clear-color=231f20D9
ring-caps-lock-color=231f20D9
ring-ver-color=231f20D9
ring-wrong-color=231f20D9
line-color=00000000
line-clear-color=ffd204FF
line-caps-lock-color=009ddcFF
line-ver-color=d9d8d8FF
line-wrong-color=ee2e24FF
text-clear-color=ffd20400
text-ver-color=d9d8d800
text-wrong-color=ee2e2400
bs-hl-color=ee2e24FF
caps-lock-key-hl-color=ffd204FF
caps-lock-bs-hl-color=ee2e24FF
disable-caps-lock-text
text-caps-lock-color=009ddc

29
tree/.local/bin/swaylock-cool Executable file
View File

@ -0,0 +1,29 @@
#!/bin/sh
BLUR_FACTOR=64;
OPTIONAL_CMDS=("convert" "python3" "grim")
for CMD in $OPTIONAL_CMDS; do
if ! command -v "$CMD" &> /dev/null
then
echo "$CMD could not be found, falling back to basic mode."
swaylock --config ~/.config/sway/swaylock.config --color 302f3b $@
exit 0
fi
done
FILE="$(mktemp)"
FILE_RAW="$FILE.raw.jpg"
FILE="$FILE.jpg"
UPSCALE="$(python3 -c "print(100*$BLUR_FACTOR, end='')")%"
DOWNSCALE="$(python3 -c "print(100/$BLUR_FACTOR, end='')")%"
grim "$FILE_RAW"
convert -scale $DOWNSCALE -scale $UPSCALE "$FILE_RAW" "$FILE"
swaylock --config ~/.config/sway/swaylock.config --image "$FILE" $@