config: sway QoL
This commit is contained in:
parent
7818a89560
commit
214b74dbde
4 changed files with 107 additions and 23 deletions
54
.dotfiles/bin/lock.sh
Executable file
54
.dotfiles/bin/lock.sh
Executable file
|
@ -0,0 +1,54 @@
|
|||
#!/bin/bash
|
||||
# vi: ts=4
|
||||
|
||||
# Lockscreen script that will capture a screenshot, pixelate and add an overlay (all optional).
|
||||
# If no toggle is enabled, the overlay image for the final image is used instead. $overlayPath with
|
||||
# a black backgrond color.
|
||||
# Optional features require the `imagemagick` package.
|
||||
|
||||
# Constants
|
||||
lockscreenDir=$(mktemp -d)
|
||||
lockscreenPath=$lockscreenDir/lock.png
|
||||
|
||||
# Config
|
||||
screenshotBin=grim
|
||||
lockscreenBin=swaylock
|
||||
overlayPath=~/.dotfiles/lock_overlay.png
|
||||
font=Terminus
|
||||
extraArguments=
|
||||
|
||||
# Toggles
|
||||
screenshot=false
|
||||
pixelate=false
|
||||
overlay=false
|
||||
|
||||
cd $lockscreenDir
|
||||
|
||||
# Take screenshot
|
||||
if $screenshot; then
|
||||
$screenshotBin $lockscreenPath
|
||||
else
|
||||
cp $HOME/.wallpaper $lockscreenPath
|
||||
fi
|
||||
|
||||
# Pixelate
|
||||
if $pixelate; then
|
||||
convert $lockscreenPath -scale 10% -scale 1000% $lockscreenPath
|
||||
fi
|
||||
|
||||
# Overlay
|
||||
if $overlay; then
|
||||
convert "$lockscreenPath" "$overlayPath" -gravity center -composite "$lockscreenPath"
|
||||
fi
|
||||
|
||||
if ! $screenshot && ! $pixelate && ! $overlay; then
|
||||
lockscreenPath=$overlayPath
|
||||
extraArguments="$extraArguments --scaling=center --color=#000001ff"
|
||||
fi
|
||||
|
||||
# Lock screen
|
||||
$lockscreenBin \
|
||||
-n \
|
||||
--image $lockscreenPath \
|
||||
--font=$font \
|
||||
$extraArguments
|
Loading…
Add table
Add a link
Reference in a new issue