add more scripts

This commit is contained in:
2026-08-16 17:11:26 +02:00
parent 4b0e320c8b
commit 1fb50e80ea
4 changed files with 64 additions and 56 deletions
+54
View File
@@ -11,6 +11,7 @@
fi
' _ {} | sort
'')
(pkgs.writeShellScriptBin "2scan" ''
find . -type f \( -iname "*.mp3" -o -iname "*.flac" -o -iname "*.m4a" -o -iname "*.ogg" -o -iname "*.wav" -o -iname "*.aiff" \) -print0 |
xargs -0 -P"$(nproc)" -I{} sh -c '
@@ -21,5 +22,58 @@
fi
' _ {}
'')
(pkgs.writeShellScriptBin "enable-hypervisor" ''
sudo modprobe -r kvm_amd kvm
sudo modprobe cpuid_fault_emulation
'')
(pkgs.writeShellScriptBin "disable-hypervisor" ''
sudo modprobe -r cpuid_fault_emulation
sudo modprobe kvm_amd kvm
'')
(pkgs.writeShellScriptBin "check-playlist" ''
PLAYLIST_DIR="/home/user/Music/Playlists/"
BASENAME="/home/user/Music/$SELECTED_SONGS"
# echo $BASENAME | kitty +kitten clipboard
shopt -s extglob
if grep -q "$BASENAME" "$PLAYLIST_DIR"/!(new|lostfrog).m3u
then
notify-send "Song is in a playlist";
else
notify-send "Song isnt in a playlist";
fi
'')
(pkgs.writeShellScriptBin "mpd-volume" ''
if [ $# != 1 ]; then
echo "Usage: ''${0} up|down"
exit 1
fi
STEP=5
get_vol() {
mpc --host=/tmp/mpd_socket volume
}
set_vol() {
mpc --host=/tmp/mpd_socket volume "$1"
}
case "$1" in
up)
set_vol +$((STEP))
;;
down)
set_vol -$((STEP))
;;
*)
echo "Usage: ''${0} up|down"
exit 1
;;
esac
'')
];
}