diff options
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/lock-screen.nix | 12 | ||||
| -rw-r--r-- | scripts/scrolling-title.nix | 24 |
2 files changed, 36 insertions, 0 deletions
diff --git a/scripts/lock-screen.nix b/scripts/lock-screen.nix new file mode 100644 index 0000000..ca45903 --- /dev/null +++ b/scripts/lock-screen.nix @@ -0,0 +1,12 @@ +{ pkgs }: +pkgs.writeShellApplication { + name = "lock-screen"; + runtimeInputs = [ pkgs.betterlockscreen ]; + text = '' + if [ ! -f "$HOME/.cache/betterlockscreen/current/lock_dimblur.png" ]; then + betterlockscreen -u "$HOME/Wallpapers/Daniel_in_the_Lions_Den_by_Briton_Riviere.jpg" --fx dimblur + fi + + betterlockscreen -l dimblur + ''; +} diff --git a/scripts/scrolling-title.nix b/scripts/scrolling-title.nix new file mode 100644 index 0000000..0bafa1b --- /dev/null +++ b/scripts/scrolling-title.nix @@ -0,0 +1,24 @@ +{ pkgs }: +pkgs.writeShellApplication { + name = "scrolling-title"; + runtimeInputs = with pkgs; [ mpc coreutils ]; + text = '' + WIDTH=16 + PADDING=" " + + RAW_STR=$(mpc current) + + if [ -z "$RAW_STR" ]; then + echo "Stopped" + exit 0 + fi + + STR="$RAW_STR$PADDING" + LEN=''${#STR} + + T=$(date +%s) + INDEX=$(( T % LEN )) + + # Output the scrolled window + echo "$STR$STR" | cut -c "$((INDEX + 1))-$((INDEX + WIDTH))"''; +} |
