addet scripts
This commit is contained in:
parent
55101b6ba2
commit
9b3171425d
16 changed files with 25 additions and 9 deletions
35
scripts/wlogout.sh
Executable file
35
scripts/wlogout.sh
Executable file
|
@ -0,0 +1,35 @@
|
|||
#!/usr/bin/env bash
|
||||
# ─< Check if the given command exists silently >─────────────────────────────────────────
|
||||
command_exists() {
|
||||
command -v "$@" >/dev/null 2>&1
|
||||
}
|
||||
|
||||
if ! command_exists wlogout; then
|
||||
notify-send "logout" "Cannot logout, wlogout not present!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Take a screenshot and blur it using ffmpeg
|
||||
take_and_blur_screenshot() {
|
||||
local blurred_path="$HOME/.config/wlogout/tmp.png"
|
||||
|
||||
# Take a screenshot and blur it
|
||||
# grim -o DP-1 - | ffmpeg -i - -vf "scale=iw/10:ih/10:flags=neighbor,scale=iw*10:ih*10:flags=neighbor" -y "$blurred_path"
|
||||
grim -o DP-1 - | ffmpeg -i - -vf "boxblur=24" -y "$blurred_path"
|
||||
}
|
||||
|
||||
# Main logic
|
||||
if ! command_exists wlogout; then
|
||||
# log_notify "critical" "Error" "wlogout not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if command_exists grim && command_exists ffmpeg; then
|
||||
take_and_blur_screenshot
|
||||
wlogout --css "$HOME/.config/wlogout/style_blur.css"
|
||||
else
|
||||
# log_notify "critical" "Error" "Required tools (grim, ffmpeg) not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# wlogout
|
Loading…
Add table
Add a link
Reference in a new issue