From f9f756d80b3aee6915fee944ef74bbd5543a9095 Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Sat, 14 Feb 2026 21:52:18 -0500 Subject: [PATCH] fix: reorg dirs --- config/X11/xinitrc | 2 +- config/hypr/hyprland.conf | 3 ++- home/modules/bootstrap.nix | 13 ++++++------ home/modules/hyprland.nix | 4 ++-- home/modules/ui.nix | 1 + scripts/ctl | 43 +++++++++++++++++++++++++++++++++++--- scripts/wp | 2 +- scripts/x | 2 +- 8 files changed, 55 insertions(+), 15 deletions(-) diff --git a/config/X11/xinitrc b/config/X11/xinitrc index ce37f37..c3a0da3 100644 --- a/config/X11/xinitrc +++ b/config/X11/xinitrc @@ -8,7 +8,7 @@ fi x setup x mon -x bg ~/img/wp/one/progress.jpg ~/img/wp/one/lilies.jpg +x bg ~/Pictures/wp/one/progress.jpg ~/Pictures/wp/one/lilies.jpg setxkbmap -layout us -variant colemak & pgrep -u "$USER" -f clipmenud >/dev/null || clipmenud & # dwmblocks & diff --git a/config/hypr/hyprland.conf b/config/hypr/hyprland.conf index 7af6833..3725d96 100644 --- a/config/hypr/hyprland.conf +++ b/config/hypr/hyprland.conf @@ -107,7 +107,8 @@ bind = , A, exec, ctl audio out bind = , C, exec, sh -lc 'cliphist list | fuzzel --dmenu --prompt="clip: " | cliphist decode | wl-copy' bind = , K, exec, ctl keyboard next bind = , O, exec, ctl ocr -bind = , P, exec, hypr pull +bind = , M, exec, ctl media +bind = , P, exec, ctl power bind = , S, exec, ctl screenshot bind = , T, exec, theme diff --git a/home/modules/bootstrap.nix b/home/modules/bootstrap.nix index 772fa01..03a525c 100644 --- a/home/modules/bootstrap.nix +++ b/home/modules/bootstrap.nix @@ -13,17 +13,18 @@ let [ "dev" "Downloads" - "img" + "Pictures" ] ++ lib.optionals hostConfig.isLinux [ - "img/screen" - "img/wp" + "Pictures/Screensavers" + "Pictures/Screenshots" + "Pictures/wp" ]; in { home.activation.createDirectories = lib.hm.dag.entryAfter [ "writeBoundary" ] '' for dir in ${lib.concatStringsSep " " directories}; do - $DRY_RUN_CMD mkdir -p "$HOME/$dir" + run mkdir -p "$HOME/$dir" done ''; @@ -36,12 +37,12 @@ in home.activation.linkWallpapers = lib.mkIf hostConfig.isLinux ( lib.hm.dag.entryAfter [ "createDirectories" ] '' src="${repoDir}/config/screen" - dest="$HOME/img/screen" + dest="$HOME/Pictures/Screensavers" if [ -d "$src" ]; then for f in "$src"/*; do [ -f "$f" ] || continue name=$(basename "$f") - [ -L "$dest/$name" ] || $DRY_RUN_CMD ln -sf "$f" "$dest/$name" + [ -L "$dest/$name" ] || run ln -sf "$f" "$dest/$name" done fi '' diff --git a/home/modules/hyprland.nix b/home/modules/hyprland.nix index aeed01e..936451e 100644 --- a/home/modules/hyprland.nix +++ b/home/modules/hyprland.nix @@ -61,7 +61,7 @@ in xdg.configFile."hypr/hyprpaper.conf".text = '' wallpaper { monitor = - path = ${config.home.homeDirectory}/img/screen/wallpaper.jpg + path = ${config.home.homeDirectory}/Pictures/Screensavers/wallpaper.jpg } splash = false @@ -75,7 +75,7 @@ in background { monitor = - path = ${config.home.homeDirectory}/img/screen/lock.jpg + path = ${config.home.homeDirectory}/Pictures/Screensavers/lock.jpg } animations { diff --git a/home/modules/ui.nix b/home/modules/ui.nix index 7459120..66a8497 100644 --- a/home/modules/ui.nix +++ b/home/modules/ui.nix @@ -62,6 +62,7 @@ in cliphist grim slurp + wf-recorder libnotify brightnessctl socat diff --git a/scripts/ctl b/scripts/ctl index 5c47ddc..ad4052b 100755 --- a/scripts/ctl +++ b/scripts/ctl @@ -11,7 +11,7 @@ require() { case "$1" in screenshot) - dir="$HOME/img/ss" + dir="$HOME/Pictures/Screenshots" mkdir -p "$dir" file="$dir/$(openssl rand -hex 10)-$(date +'%Y-%m-%d_%H-%M-%S').png" if [ "${XDG_SESSION_TYPE:-}" = "wayland" ]; then @@ -24,7 +24,7 @@ screenshot) ;; ocr) require tesseract - dir="$HOME/img/ss" + dir="$HOME/Pictures/Screenshots" mkdir -p "$dir" file="$dir/$(openssl rand -hex 10)-$(date +'%Y-%m-%d_%H-%M-%S').png" if [ "${XDG_SESSION_TYPE:-}" = "wayland" ]; then @@ -184,6 +184,43 @@ wifi) ;; esac ;; +media) + if pgrep -x wf-recorder >/dev/null 2>&1; then + pkill -INT wf-recorder + notify-send -a ctl -t 2500 "recording saved" + exit 0 + fi + require fuzzel grim slurp wl-copy wf-recorder hyprctl jq + ss_dir="$HOME/Pictures/Screenshots" + rec_dir="$HOME/Pictures/Recordings" + mkdir -p "$ss_dir" "$rec_dir" + desktop=" Capture Desktop" + area=" Capture Area" + rec_desktop=" Record Desktop" + rec_window=" Record Window" + chosen="$(printf '%s\n' "$desktop" "$area" "$rec_desktop" "$rec_window" | fuzzel --dmenu --hide-prompt --lines=4 --width=25 --no-icons)" + case "$chosen" in + "$desktop") + file="$ss_dir/$(date +'%Y-%m-%d_%H-%M-%S').png" + grim "$file" && wl-copy < "$file" + ;; + "$area") + file="$ss_dir/$(date +'%Y-%m-%d_%H-%M-%S').png" + grim -g "$(slurp)" "$file" && wl-copy < "$file" + ;; + "$rec_desktop") + file="$rec_dir/$(date +'%Y-%m-%d_%H-%M-%S').mp4" + notify-send -a ctl -t 2500 "recording started" + wf-recorder -f "$file" & + ;; + "$rec_window") + geom=$(hyprctl activewindow -j | jq -r '"\(.at[0]),\(.at[1]) \(.size[0])x\(.size[1])"') + file="$rec_dir/$(date +'%Y-%m-%d_%H-%M-%S').mp4" + notify-send -a ctl -t 2500 "recording started" + wf-recorder -g "$geom" -f "$file" & + ;; + esac + ;; power) require fuzzel lock="󰌾 Lock" @@ -201,7 +238,7 @@ power) esac ;; *) - echo "Usage: ctl {screenshot|ocr|keyboard|audio|wifi|brightness|volume|power}" >&2 + echo "Usage: ctl {screenshot|ocr|keyboard|audio|wifi|brightness|volume|media|power}" >&2 exit 1 ;; esac diff --git a/scripts/wp b/scripts/wp index 50ad15c..7ac4d9b 100755 --- a/scripts/wp +++ b/scripts/wp @@ -13,7 +13,7 @@ except ImportError: sys.exit(1) HOME = os.environ["HOME"] -DIR = f"{HOME}/img/screen" +DIR = f"{HOME}/Pictures/Screensavers" os.makedirs(DIR, exist_ok=True) diff --git a/scripts/x b/scripts/x index bc62061..f1afd98 100755 --- a/scripts/x +++ b/scripts/x @@ -33,7 +33,7 @@ bg) require xrandr feh randr="$(xrandr | rg ' connected ')" mons="$(echo "$randr" | wc -l)" - wpdir="$HOME"/img/wp + wpdir="$HOME"/Pictures/wp [ "$1" ] && bgone="$1" || bgone="$wpdir"/one/cliff.jpg cmd="feh --no-fehbg --bg-fill $bgone"