From 25b29657ffc21b5db57ed85f4899894cfe4b9798 Mon Sep 17 00:00:00 2001 From: Ingolf Wagner Date: Sun, 23 Feb 2020 11:02:24 +0800 Subject: [PATCH] add music-making.sh --- assets/music-making.sh | 50 +++++++++++++++++++++++++++++++++++++ system/desktop/packages.nix | 2 ++ 2 files changed, 52 insertions(+) create mode 100644 assets/music-making.sh diff --git a/assets/music-making.sh b/assets/music-making.sh new file mode 100644 index 0000000..1175001 --- /dev/null +++ b/assets/music-making.sh @@ -0,0 +1,50 @@ + +function stop_program(){ + echo "stop $1" + sudo systemctl stop $1 +} + +function start_program(){ + echo "start $1" + sudo systemctl stop $1 +} + + +function start(){ + echo "starting programs again" + echo "-----------------------" + echo + start_program backup.on-porani.insecure.timer + start_program backup.on-workhorse.insecure.timer + start_program backup.on-workout.insecure.timer + start_program syncthing.service + start_program tlp.service + start_program tor.service +} + +function stop(){ + echo "stopping programs" + echo "-----------------" + echo + stop_program backup.on-porani.insecure.timer + stop_program backup.on-workhorse.insecure.timer + stop_program backup.on-workout.insecure.timer + stop_program syncthing.service + stop_program tlp.service + stop_program tor.service +} + + +# ---- +# main +# ---- + + +stop + +echo +echo -n "wait to start again -> " +read +echo + +start diff --git a/system/desktop/packages.nix b/system/desktop/packages.nix index 6c07d2b..d0b111f 100644 --- a/system/desktop/packages.nix +++ b/system/desktop/packages.nix @@ -282,6 +282,8 @@ in { ffmpeg (writeShellScriptBin "shrink-exports" (fileContents )) + (writeShellScriptBin "music-making" + (fileContents )) screenKey replaceLinks