diff --git a/modules/home/scripts/scripts.nix b/modules/home/scripts/scripts.nix index a325cce..48332df 100644 --- a/modules/home/scripts/scripts.nix +++ b/modules/home/scripts/scripts.nix @@ -1,49 +1,27 @@ {pkgs, ...}: let wall-change = pkgs.writeShellScriptBin "wall-change" (builtins.readFile ./scripts/wall-change.sh); wallpaper-picker = pkgs.writeShellScriptBin "wallpaper-picker" (builtins.readFile ./scripts/wallpaper-picker.sh); - runbg = pkgs.writeShellScriptBin "runbg" (builtins.readFile ./scripts/runbg.sh); - music = pkgs.writeShellScriptBin "music" (builtins.readFile ./scripts/music.sh); - lofi = pkgs.writeScriptBin "lofi" (builtins.readFile ./scripts/lofi.sh); + + notes = pkgs.writeShellScriptBin "runbg" (builtins.readFile ./scripts/runbg.sh); toggle_blur = pkgs.writeScriptBin "toggle_blur" (builtins.readFile ./scripts/toggle_blur.sh); toggle_oppacity = pkgs.writeScriptBin "toggle_oppacity" (builtins.readFile ./scripts/toggle_oppacity.sh); - maxfetch = pkgs.writeScriptBin "maxfetch" (builtins.readFile ./scripts/maxfetch.sh); - - compress = pkgs.writeScriptBin "compress" (builtins.readFile ./scripts/compress.sh); - extract = pkgs.writeScriptBin "extract" (builtins.readFile ./scripts/extract.sh); - - shutdown-script = pkgs.writeScriptBin "shutdown-script" (builtins.readFile ./scripts/shutdown-script.sh); - - show-keybinds = pkgs.writeScriptBin "show-keybinds" (builtins.readFile ./scripts/keybinds.sh); - - vm-start = pkgs.writeScriptBin "vm-start" (builtins.readFile ./scripts/vm-start.sh); - ascii = pkgs.writeScriptBin "ascii" (builtins.readFile ./scripts/ascii.sh); in { home.packages = with pkgs; [ wall-change wallpaper-picker - - runbg - music - lofi - + toggle_blur toggle_oppacity - - maxfetch - - compress - extract - - shutdown-script - show-keybinds + runbg - vm-start + notes ascii + ]; } diff --git a/modules/home/scripts/scripts/notes.sh b/modules/home/scripts/scripts/notes.sh new file mode 100644 index 0000000..c21e788 --- /dev/null +++ b/modules/home/scripts/scripts/notes.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +# MIT license +# Ahwx https://ahwx.org - 2024 +# +# Dependencies: find/grep/tofi/ping/git/ + +NOTEDIR="$HOME/Notes" + +CHOSEN=$(find "$HOME/Notes" -follow | grep -E '.md$' | tofi) + +cd "$NOTEDIR" || mkdir -p "$NOTEDIR" && cd "$NOTEDIR" || echo 'Error with moving into directory, is "$NOTEDIR" set?' # Change dir to notes dir, if it doesn't exist, create it and try again. Otherwise it should just die, I guess? +notify-send "Trying to connect to internet and pull changes from Git" +ping -c1 github.com >/dev/null && notify-send "$(git pull)" # Pull most recent changes, be sure to not create conficts... + +foot -e nix run "$HOME/Development/nixvim" -- "$CHOSEN" # Finally open chosen note + +git add "$CHOSEN" && git commit -m "chore: updates (auto)" && git push && notify-send "Done"