diff options
| author | krolxon <krolyxon@tutanota.com> | 2025-08-13 15:01:43 +0530 |
|---|---|---|
| committer | krolxon <krolyxon@tutanota.com> | 2025-08-13 15:01:43 +0530 |
| commit | 32247d59a2ea42542328071c3784bec753b8ce00 (patch) | |
| tree | 0bb000d17e97cdc43ef1a720cb92da749112b382 /.local | |
| parent | ecb14b548ec5104d72043759d7b405990ee47c50 (diff) | |
use Fira Code as font, add setwall script
Diffstat (limited to '.local')
| -rwxr-xr-x | .local/bin/genwall | 18 | ||||
| -rwxr-xr-x | .local/bin/randomwall | 17 | ||||
| -rwxr-xr-x | .local/bin/screenshot | 6 | ||||
| -rwxr-xr-x | .local/bin/setwall | 52 |
4 files changed, 55 insertions, 38 deletions
diff --git a/.local/bin/genwall b/.local/bin/genwall deleted file mode 100755 index ccbe75e..0000000 --- a/.local/bin/genwall +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh - -# Dependencies: -# convert wal xdotool xwallpaper - -wall_dir=~/pix/wall - -if [ -z "$1" ]; then - wall="$(find "$wall_dir" -type f -name "*.jpg" -o -name "*.png" | shuf -n1)" -else - wall="$1" -fi - -convert "$wall" ~/.local/share/bg.jpg -xwallpaper --zoom ~/.local/share/bg.jpg -wal -c -wal -i ~/.local/share/bg.jpg -xdotool key super+F5 diff --git a/.local/bin/randomwall b/.local/bin/randomwall deleted file mode 100755 index fee4482..0000000 --- a/.local/bin/randomwall +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash -WALL_DIR="$HOME/pix/wallpapers/onedarkwallpapers/" -NEW_WALL=$(find "$WALL_DIR" -type f | shuf -n 1) - -if ! pgrep -x hyprpaper >/dev/null; then - # hyprpaper not running → write config and start it - cat > ~/.config/hypr/hyprpaper.conf <<EOF -preload = $NEW_WALL -wallpaper = ,$NEW_WALL -EOF - hyprpaper & -else - # hyprpaper is running → just update it live - hyprctl hyprpaper preload "$NEW_WALL" - hyprctl hyprpaper wallpaper ",$NEW_WALL" -fi - diff --git a/.local/bin/screenshot b/.local/bin/screenshot index c8f2bfb..3cb9b0f 100755 --- a/.local/bin/screenshot +++ b/.local/bin/screenshot @@ -3,9 +3,9 @@ ocr_cmd="wl-copy" case "$(printf "a selected area (copy)\ncurrent window (copy)\nfull screen (copy)\na selected area\ncurrent window\nfull screen\na selected area (OCR)" | rofi -dmenu -l 7 -i -p "Screenshot which area?")" in - "a selected area (copy)") hyprshot -m region -c ;; - "current window (copy)") hyprshot -m window -c ;; - "full screen (copy)") hyprshot -m output -c ;; + "a selected area (copy)") hyprshot -m region --clipboard-only ;; + "current window (copy)") hyprshot -m window --clipboard-only ;; + "full screen (copy)") hyprshot -m output --clipboard-only ;; "a selected area") hyprshot -m region -o ~/pix/ss -f "pic-selected-$(uuidgen | awk -F- '{printf $2}')-$(date '+%y-%m-%d').png" ;; "current window") hyprshot -m window -o ~/pix/ss -f "pic-window-$(uuidgen | awk -F- '{printf $2}')-$(date '+%y-%m-%d').png" ;; diff --git a/.local/bin/setwall b/.local/bin/setwall new file mode 100755 index 0000000..36c46db --- /dev/null +++ b/.local/bin/setwall @@ -0,0 +1,52 @@ +#!/bin/bash +WALL_DIR="$HOME/pix/wallpapers/onedarkwallpapers/" +MODE="random" +CUSTOM_PATH="" + +# Parse options +while getopts ":mp:" opt; do + case $opt in + m) MODE="menu" ;; + p) MODE="path"; CUSTOM_PATH="$OPTARG" ;; + \?) echo "Usage: $0 [-m] [-p /path/to/image]" >&2; exit 1 ;; + :) echo "Option -$OPTARG requires an argument." >&2; exit 1 ;; + esac +done + +# Choose wallpaper +case $MODE in + random) + NEW_WALL=$(find "$WALL_DIR" -type f | shuf -n 1) + ;; + path) + if [[ -f "$CUSTOM_PATH" ]]; then + NEW_WALL="$CUSTOM_PATH" + else + echo "Error: File not found -> $CUSTOM_PATH" >&2 + exit 1 + fi + ;; + menu) + WALLPAPER_LIST=$(find "$WALL_DIR" -type f | sort | sed "s|$WALL_DIR||") + CHOSEN=$(echo "$WALLPAPER_LIST" | rofi -dmenu -i -p "Choose wallpaper:") + if [[ -z "$CHOSEN" ]]; then + NEW_WALL=$(find "$WALL_DIR" -type f | shuf -n 1) + else + NEW_WALL="$WALL_DIR$CHOSEN" + fi + ;; +esac + +# Apply wallpaper +if ! pgrep -x hyprpaper >/dev/null; then + # Hyprpaper not running → start with chosen wallpaper + cat > ~/.config/hypr/hyprpaper.conf <<EOF +preload = $NEW_WALL +wallpaper = ,$NEW_WALL +EOF + hyprpaper & +else + # Hyprpaper is running → change it live + hyprctl hyprpaper preload "$NEW_WALL" + hyprctl hyprpaper wallpaper ",$NEW_WALL" +fi |
