playshellsound is now a standalone script
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
chpaper = super.callPackage ./scripts/wm-controls/chpaper.nix {};
|
||||
chscheme = super.callPackage ./scripts/wm-controls/chscheme.nix {};
|
||||
keyring = super.callPackage ./scripts/wm-controls/keyring.nix {};
|
||||
playshellsound = super.callPackage ./scripts/wm-controls/playshellsound.nix {};
|
||||
mkscreenshots = super.callPackage ./scripts/wm-controls/mkscreenshots.nix {};
|
||||
moveonscreen = super.callPackage ./scripts/wm-controls/moveonscreen.nix {};
|
||||
s_check = super.callPackage ./scripts/wm-controls/s_check.nix {};
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
{ host, self, pkgs, }:
|
||||
pkgs.writeShellApplication {
|
||||
name = "rebuild";
|
||||
runtimeInputs = [
|
||||
pkgs.myScripts.playshellsound
|
||||
];
|
||||
text = ''
|
||||
checkbools() { [ "$all" = false ] && [ "$system" = false ] && [ "$home" = false ]; }
|
||||
checkflags() {
|
||||
@@ -24,8 +27,8 @@ pkgs.writeShellApplication {
|
||||
all=false
|
||||
dry=false
|
||||
|
||||
hooray() { scheck && runbg aplay "${self}/assets/sound/update.wav"; }
|
||||
damn() { scheck && runbg aplay "${self}/assets/sound/error.wav"; }
|
||||
hooray() { playshellsound "${self}/assets/sound/update.wav"; }
|
||||
damn() { playshellsound "${self}/assets/sound/error.wav"; }
|
||||
|
||||
usage="\033[1;4;38;2;243;139;168mUsage\033[0m: rebuild -h for home config, rebuild -s for sys config, rebuild -a for both. Including 'n' with the flag does a dry run, i.e. rebuild -nh"
|
||||
|
||||
|
||||
20
overlay/scripts/wm-controls/playshellsound.nix
Normal file
20
overlay/scripts/wm-controls/playshellsound.nix
Normal file
@@ -0,0 +1,20 @@
|
||||
{ pkgs }:
|
||||
|
||||
pkgs.writeShellApplication {
|
||||
name = "playshellsound";
|
||||
runtimeInputs = with pkgs; [
|
||||
alsa-utils
|
||||
pkgs.myScripts.runbg
|
||||
];
|
||||
text = ''
|
||||
if [ $# -ne 1 ]; then
|
||||
echo "Usage: playshellsound <path/to/sound>"
|
||||
exit 1
|
||||
fi
|
||||
if scheck; then
|
||||
runbg aplay "$1"
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
'';
|
||||
}
|
||||
Reference in New Issue
Block a user