diff --git a/modules/home/environment/zsh/extraconfig.nix b/modules/home/environment/zsh/extraconfig.nix index 0a1dafa..ef534d5 100644 --- a/modules/home/environment/zsh/extraconfig.nix +++ b/modules/home/environment/zsh/extraconfig.nix @@ -37,7 +37,7 @@ in fi } grimblast() { - if grimblast "$@"; then + if command grimblast "$@"; then ${shellsound} ${sndpath}/screenshot.wav fi } diff --git a/overlay/overlay.nix b/overlay/overlay.nix index e763da1..c1d7dcf 100644 --- a/overlay/overlay.nix +++ b/overlay/overlay.nix @@ -27,7 +27,7 @@ in # Scripts written using pkgs.writeShellApplication icanhazip = super.callPackage ./scripts/commands/icanhazip.nix {}; invoke = super.callPackage ./scripts/commands/invoke.nix { self = root; }; - git-compose = super.callPackage ./scripts/commands/git-compose.nix {}; + git-compose = super.callPackage ./scripts/commands/git-compose.nix { self = root; }; runbg = super.callPackage ./scripts/commands/runbg.nix {}; splash = super.callPackage ./scripts/commands/splash.nix {}; toolbelt = super.callPackage ./scripts/commands/toolbelt.nix {}; diff --git a/overlay/scripts/commands/git-compose.nix b/overlay/scripts/commands/git-compose.nix index ae8d70e..4f61852 100644 --- a/overlay/scripts/commands/git-compose.nix +++ b/overlay/scripts/commands/git-compose.nix @@ -1,10 +1,13 @@ -{ pkgs }: +{ pkgs, self }: pkgs.writeShellApplication { name = "git-compose"; runtimeInputs = with pkgs; [ git + alsa-utils gawk myScripts.color-commit + myScripts.s_check + myScripts.playshellsound ]; text = '' set -e @@ -83,6 +86,7 @@ pkgs.writeShellApplication { git add "''${lines[@]}" git commit -m "$msg" | color-commit fi + playshellsound ${self}/assets/sound/gitcommit.wav ) ''; } diff --git a/overlay/scripts/misc/mntstack.nix b/overlay/scripts/misc/mntstack.nix index 8cdfa01..2c0d5fb 100644 --- a/overlay/scripts/misc/mntstack.nix +++ b/overlay/scripts/misc/mntstack.nix @@ -10,8 +10,9 @@ pkgs.writeShellApplication { STACK_FILE="/tmp/mntstack.txt" validate_entry() { - local entry_dev entry_mntpoint test_mntpoint + local entry_dev entry_mntpoint IFS=' ' read -r entry_dev entry_mntpoint <<< "$1" + echo "$entry_dev" > /dev/null # Don't ask [ -n "$(findmnt -no SOURCE,TARGET "$entry_mntpoint" | cut -d' ' -f1-)" ] } @@ -67,9 +68,9 @@ pkgs.writeShellApplication { mapfile -t stack < "$STACK_FILE" # Get the last entry - last_path="${stack[-1]}" + last_path="''${stack[-1]}" if ! validate_entry "$last_path"; then - echo "Warning: Invalid stack entry '${stack[-1]}'" + echo -e "Warning: Invalid stack entry \"''${stack[-1]}\"" sed -i '$d' "$STACK_FILE" return 0 fi diff --git a/overlay/scripts/nix/garbage-collect.nix b/overlay/scripts/nix/garbage-collect.nix index 526d482..ffd6b4e 100755 --- a/overlay/scripts/nix/garbage-collect.nix +++ b/overlay/scripts/nix/garbage-collect.nix @@ -28,7 +28,7 @@ pkgs.writeShellApplication { # Get the size of the trash folder before deleting if [ "$(ls -A ~/.local/share/Trash/files/ 2>/dev/null)" ]; then rm_freed=$(du -sm ~/.local/share/Trash/files | awk '{print $1}') - /run/current-system/sw/bin/rm -rfv ~/.local/share/Trash/files/* # Verbose output + /run/current-system/sw/bin/rm -rf ~/.local/share/Trash/files/* mkdir -p ~/.local/share/Trash/files else rm_freed="0" diff --git a/overlay/scripts/wm-controls/s_check.nix b/overlay/scripts/wm-controls/s_check.nix index 3c76c84..3fcc514 100755 --- a/overlay/scripts/wm-controls/s_check.nix +++ b/overlay/scripts/wm-controls/s_check.nix @@ -2,8 +2,6 @@ pkgs.writeShellApplication { name = "scheck"; text = '' - #!/run/current-system/sw/bin/bash - [ "$SOUNDS_ENABLED" = "true" ] ''; }