Gen 423: Converted shell scripts into nix files
This commit is contained in:
21
glasshouse-laptop/home/scripts/shutdown-script.nix
Normal file
21
glasshouse-laptop/home/scripts/shutdown-script.nix
Normal file
@@ -0,0 +1,21 @@
|
||||
{ pkgs }:
|
||||
|
||||
{
|
||||
shutdown-script = pkgs.writeShellScriptBin "shutdown-script" (''
|
||||
#!/usr/bin/env zsh
|
||||
|
||||
respond="$(echo " Shutdown\n Restart\n Cancel" | rofi -dmenu)"
|
||||
|
||||
if [ $respond = ' Shutdown' ]
|
||||
then
|
||||
echo "shutdown"
|
||||
shutdown now
|
||||
elif [ $respond = ' Restart' ]
|
||||
then
|
||||
echo "restart"
|
||||
reboot
|
||||
else
|
||||
notify-send "cancel shutdown"
|
||||
fi
|
||||
'');
|
||||
}
|
||||
Reference in New Issue
Block a user