feat: move to "self-written shell script packages"

This commit is contained in:
Ahwx 2024-10-14 08:23:02 +02:00
parent b2ec9acae2
commit 66e198e7e5
3 changed files with 11 additions and 6 deletions

View file

@ -3,7 +3,8 @@
wallpaper-picker = pkgs.writeShellScriptBin "wallpaper-picker" (builtins.readFile ./scripts/wallpaper-picker.sh); wallpaper-picker = pkgs.writeShellScriptBin "wallpaper-picker" (builtins.readFile ./scripts/wallpaper-picker.sh);
runbg = pkgs.writeShellScriptBin "runbg" (builtins.readFile ./scripts/runbg.sh); runbg = pkgs.writeShellScriptBin "runbg" (builtins.readFile ./scripts/runbg.sh);
notes = pkgs.writeShellScriptBin "runbg" (builtins.readFile ./scripts/runbg.sh); notes = pkgs.writeShellScriptBin "notes" (builtins.readFile ./scripts/notes.sh);
grabtext = pkgs.writeShellScriptBin "grabtext" (builtins.readFile ./scripts/grabtext.sh);
toggle_blur = pkgs.writeScriptBin "toggle_blur" (builtins.readFile ./scripts/toggle_blur.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); toggle_oppacity = pkgs.writeScriptBin "toggle_oppacity" (builtins.readFile ./scripts/toggle_oppacity.sh);
@ -20,6 +21,7 @@ in {
runbg runbg
notes notes
grabtext
ascii ascii

View file

@ -0,0 +1,3 @@
#!/usr/bin/env bash
slurp | xargs -I {} grim -s 2 -t png -g {} - | tesseract - - | wl-copy -n

View file

@ -3,16 +3,16 @@
# MIT license # MIT license
# Ahwx <ahwx at ahwx dot org> https://ahwx.org - 2024 # Ahwx <ahwx at ahwx dot org> https://ahwx.org - 2024
# #
# Dependencies: find/grep/tofi/ping/git/ # Dependencies: find/grep/bemenu/ping/git/
NOTEDIR="$HOME/Notes" NOTEDIR="$HOME/Notes"
CHOSEN=$(find "$HOME/Notes" -follow | grep -E '.md$' | tofi) CHOSEN=$(find "$HOME/Notes" -follow | grep -E '.md$' | bemenu -l 10)
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? 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" echo "Check if connected 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... 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 kitty -e nvim "$CHOSEN" # Finally open chosen note
git add "$CHOSEN" && git commit -m "chore: updates (auto)" && git push && notify-send "Done" git add "$CHOSEN" && git commit -m "chore: updates (auto)" && git push && notify-send "Changes pushed"