From 4e5cdbbac5f579ef5b61e296e2754445f76aac7b Mon Sep 17 00:00:00 2001 From: Hadi <112569860+anotherhadi@users.noreply.github.com> Date: Tue, 25 Jun 2024 09:49:11 +0200 Subject: [PATCH] up --- docs/TODO.md | 2 -- docs/scripts/get_keybindings.sh | 1 + docs/scripts/install.sh | 20 +++++++++++--------- home/scripts/night-shift/default.nix | 18 +++++++++++++++++- 4 files changed, 29 insertions(+), 12 deletions(-) create mode 100644 docs/scripts/get_keybindings.sh diff --git a/docs/TODO.md b/docs/TODO.md index 0756cea..70bbf01 100644 --- a/docs/TODO.md +++ b/docs/TODO.md @@ -9,9 +9,7 @@ feel free to contribute <3 ([CONTRIBUTING.md](CONTRIBUTING.md)) - [ ] Upload new wallpapers - [ ] MacOS theme - [ ] GithubFetch: Neofetch like, github calendar in the terminal - - [ ] Night shift Toggle - [ ] Write a hyprland shortcuts markdown file (Parse the hyprland settings conf) - - [ ] Lock script - [ ] Tofi (Wofi but terminal based) - [ ] Waybar diff --git a/docs/scripts/get_keybindings.sh b/docs/scripts/get_keybindings.sh new file mode 100644 index 0000000..f1f641a --- /dev/null +++ b/docs/scripts/get_keybindings.sh @@ -0,0 +1 @@ +#!/usr/bin/env bash diff --git a/docs/scripts/install.sh b/docs/scripts/install.sh index 27451dd..63e674f 100644 --- a/docs/scripts/install.sh +++ b/docs/scripts/install.sh @@ -1,10 +1,12 @@ -# installation script... +#!/usr/bin/env bash -# check if on nixos -# check if ./hosts exist -# check if gum is installed (dependencie) -# save path -# remove .git -# git init and initial commit -# create custom configuration -# save it to ./hosts +# https://github.com/anotherhadi/nixy +# Installation script: Should be run on fresh nixos install. + +printf "\n\e[0;92m- \e[0m\e[1;77mNixy's Installation Script\e[0;96m [anotherhadi/nixy]\e[0m" + +# Check if we're on the good directory +[[ -f "./docs/scripts/install.sh" ]] || (printf "\n\e[0;91mx \e[0m\e[1;77mNot in the project root directory\e[0m"; exit 1) +DIR=$(pwd) + +# Create a new configuration diff --git a/home/scripts/night-shift/default.nix b/home/scripts/night-shift/default.nix index 072ade2..34db3c6 100644 --- a/home/scripts/night-shift/default.nix +++ b/home/scripts/night-shift/default.nix @@ -15,4 +15,20 @@ let notif "night-shift" "$message" ''; -in { home.packages = [ night-shift-on night-shift-off ]; } + night-shift-toggle = pkgs.writeShellScriptBin "night-shift-toggle" '' + if pgrep wlsunset; then + night-shift-off + else + night-shift-on + fi + ''; + + night-shift-status = pkgs.writeShellScriptBin "night-shift-status" '' + if pgrep wlsunset; then + echo "1" + else + echo "0" + fi + ''; + +in { home.packages = [ night-shift-on night-shift-off night-shift-toggle night-shift-status ]; }