mirror of
https://github.com/Ahwxorg/nixos-config.git
synced 2025-12-04 23:00:14 +01:00
feat: adds notes script
This commit is contained in:
parent
632aaadc06
commit
bb944a92d9
2 changed files with 24 additions and 28 deletions
|
|
@ -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
|
||||
|
||||
];
|
||||
}
|
||||
|
|
|
|||
18
modules/home/scripts/scripts/notes.sh
Normal file
18
modules/home/scripts/scripts/notes.sh
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
#!/bin/sh
|
||||
|
||||
# MIT license
|
||||
# Ahwx <ahwx at ahwx dot org> 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"
|
||||
Loading…
Add table
Add a link
Reference in a new issue