From b7e84fa6048007cda7e6c8226e28bc2db90f792a Mon Sep 17 00:00:00 2001 From: Jacob Janzen Date: Sat, 28 Sep 2024 00:01:09 -0500 Subject: add file extensions to files --- nixos/.flake/home/scripts.nix.org | 43 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 nixos/.flake/home/scripts.nix.org (limited to 'nixos/.flake/home/scripts.nix.org') diff --git a/nixos/.flake/home/scripts.nix.org b/nixos/.flake/home/scripts.nix.org new file mode 100644 index 0000000..b98b389 --- /dev/null +++ b/nixos/.flake/home/scripts.nix.org @@ -0,0 +1,43 @@ +#+title: Custom Scripts + +Open script container. +#+begin_src nix :tangle ~/.flake/home/scripts.nix :mkdirp yes + { config, pkgs, ... }: + + { + home.file = { +#+end_src + +Use =fuzzel= to open a menu to power off, reboot, or log out. +#+begin_src nix :tangle ~/.flake/home/scripts.nix :mkdirp yes + ".local/bin/poweroptions.sh" = { + text = '' + #!/bin/sh + + getoption () { + fuzzel --dmenu -l 3 -x 1 -r 10 << EOF + 󰐥 power off + 󰜉 restart + 󰍃 logout + EOF + } + + option=$(getoption | xargs) + case $option in + '󰐥 power off') + systemctl poweroff;; + '󰜉 restart') + systemctl reboot;; + '󰍃 logout') + hyprctl dispatch exit;; + esac + ''; + executable = true; + }; +#+end_src + +Close script container. +#+begin_src nix :tangle ~/.flake/home/scripts.nix :mkdirp yes + }; + } +#+end_src -- cgit v1.2.3