From 28e8bdf7f8286bd431b7f3b709e79f3827b31469 Mon Sep 17 00:00:00 2001 From: TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> Date: Wed, 24 Dec 2025 13:54:03 +0900 Subject: updates --- debian/.local/bin/setlock | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 debian/.local/bin/setlock (limited to 'debian/.local/bin/setlock') diff --git a/debian/.local/bin/setlock b/debian/.local/bin/setlock new file mode 100755 index 0000000..611ae5e --- /dev/null +++ b/debian/.local/bin/setlock @@ -0,0 +1,23 @@ +#!/bin/sh + +lockloc="${XDG_DATA_HOME:-${HOME}/.local/share}/wallpapers/lock" + +# Give -s as parameter to make notifications silent. +while getopts "s" o; do + case "${o}" in + s) silent='1' ;; + *) ;; + esac +done + +shift $((OPTIND - 1)) + +trueloc="$(readlink -f "$1")" && + case "$(file --mime-type -b "$trueloc")" in + image/*) ln -sf "$trueloc" "$lockloc" && [ -z "$silent" ] && notify-send -i "$lockloc" "Changing lock screen..." ;; + inode/directory) ln -sf "$(find -L "$trueloc" -iregex '.*.\(jpg\|jpeg\|png\|gif\)' -type f | shuf -n 1)" "$lockloc" && [ -z "$silent" ] && notify-send -i "$lockloc" "Random Lock Screen chosen." ;; + *) + [ -z "$silent" ] && notify-send "🖼️ Error" "Not a valid image or directory." + exit 1 + ;; + esac -- cgit v1.2.3