Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 49 additions & 15 deletions cos_nov21/dotfiles/hypr/hyprland.conf
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ source = ~/.config/hypr/colors.conf

$terminal = kitty
$fileManager = thunar
$browser = firefox
$musicPlayer = ncmpcpp
$menu = wofi --show drun
$super = SUPER


#################
Expand Down Expand Up @@ -54,37 +57,53 @@ env = WLR_NO_HARDWARE_CURSORS,1
#####################

general {
gaps_in = 2
gaps_out = 4
border_size = 2
gaps_in = 6
gaps_out = 12
border_size = 3

col.active_border = rgba(89b4faee)
col.inactive_border = rgba(595959aa)
col.active_border = rgba(89b4faee) rgba(94e2d5ee) 45deg
col.inactive_border = rgba(3b3b4b88)

layout = dwindle
}

decoration {
rounding = 0
rounding = 12

active_opacity = 1.0
inactive_opacity = 1.0
active_opacity = 0.96
inactive_opacity = 0.86


drop_shadow = true
shadow_range = 24
shadow_render_power = 3
col.shadow = rgba(00000055)

blur {
enabled = false
enabled = true
size = 10
passes = 3
new_optimizations = true
ignore_opacity = true
noise = 0.015
contrast = 1.05
brightness = 1.02
}
}

animations {
enabled = true

bezier = simple, 0.16, 1, 0.3, 1

animation = windows, 1, 3, simple
animation = fade, 1, 3, simple
animation = workspaces, 1, 3, simple
bezier = easeOutQuint, 0.23, 1, 0.32, 1
bezier = easeInBack, 0.36, -0.08, 0.68, -0.48
bezier = fastSpring, 0.26, 1, 0.48, 1

animation = windows, 1, 8, easeOutQuint, popin 80%
animation = windowsOut, 1, 7, easeInBack, popin 80%
animation = border, 1, 12, fastSpring
animation = fade, 1, 7, easeOutQuint
animation = workspaces, 1, 6, easeOutQuint, slidevert
animation = specialWorkspace, 1, 6, easeOutQuint, slidevert
animation = layers, 1, 7, easeOutQuint, slide
}

dwindle {
Expand All @@ -97,6 +116,9 @@ misc {
disable_hyprland_logo = true
disable_splash_rendering = true
vrr = 0
animate_manual_resizes = true
animate_mouse_windowdragging = true
focus_on_activate = true
}


Expand Down Expand Up @@ -133,6 +155,12 @@ bind = $mod, A, exec, $menu
bind = $mod, P, pseudo
bind = $mod, J, togglesplit

# Audio controls with notifications
bindle = , XF86AudioRaiseVolume, exec, ~/.config/hypr/scripts/volume-notify.sh up
bindle = , XF86AudioLowerVolume, exec, ~/.config/hypr/scripts/volume-notify.sh down
bind = , XF86AudioMute, exec, ~/.config/hypr/scripts/volume-notify.sh mute
bind = , XF86AudioMicMute, exec, ~/.config/hypr/scripts/mic-notify.sh toggle

# Screenshots
bind = , Print, exec, grim -g "$(slurp)" - | wl-copy
bind = SHIFT, Print, exec, grim - | wl-copy
Expand All @@ -150,6 +178,12 @@ bind = $mod CTRL, Left, exec, ~/.config/hypr/scripts/wallpaper-prev.sh # Pre
bind = $mod CTRL, Up, exec, ~/.config/hypr/scripts/wallpaper-random.sh # Random wallpaper
bind = $mod, H, exec, ~/.config/hypr/scripts/keybinds-hint.sh # Show keybindings

# Super key quick launchers (install on demand)
bind = $super, E, exec, ~/.config/hypr/scripts/app-launch.sh files
bind = $super, N, exec, ~/.config/hypr/scripts/app-launch.sh nvim
bind = $super, B, exec, ~/.config/hypr/scripts/app-launch.sh browser
bind = $super, M, exec, ~/.config/hypr/scripts/app-launch.sh music

# Focus windows
bind = $mod, left, movefocus, l
bind = $mod, right, movefocus, r
Expand Down
64 changes: 64 additions & 0 deletions cos_nov21/dotfiles/hypr/scripts/app-launch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#!/bin/bash
# Launch common apps, installing them first when missing.

set -e

notify_missing() {
local cmd="$1"
local pkg="$2"
notify-send "Missing $cmd" "Attempting to install $pkg"
}

pick_installer() {
if command -v paru >/dev/null 2>&1; then
echo "paru -S --needed --noconfirm"
elif command -v yay >/dev/null 2>&1; then
echo "yay -S --needed --noconfirm"
elif command -v pacman >/dev/null 2>&1; then
echo "sudo pacman -S --needed"
else
echo ""
fi
}

run_or_install() {
local cmd="$1"
local pkg="$2"
shift 2
local args=("$@")

if command -v "$cmd" >/dev/null 2>&1; then
exec "$cmd" "${args[@]}"
fi

local installer
installer=$(pick_installer)

if [ -n "$installer" ]; then
notify_missing "$cmd" "$pkg"
kitty -e bash -lc "$installer $pkg" || notify-send "Install $pkg" "Installer closed or failed"
exec "$cmd" "${args[@]}"
else
notify-send "No installer available" "Install $pkg then retry"
exit 1
fi
}

case "$1" in
files)
run_or_install thunar thunar
;;
nvim)
run_or_install nvim neovim
;;
browser)
run_or_install firefox firefox
;;
music)
run_or_install ncmpcpp ncmpcpp
;;
*)
notify-send "Unknown launcher target" "$1"
exit 1
;;
esac
49 changes: 38 additions & 11 deletions cos_nov21/dotfiles/hypr/scripts/wallpaper-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,58 @@
# Shared wallpaper library functions
# Used by wallpaper-next.sh, wallpaper-prev.sh, etc.

HYPR_DIR="$HOME/.config/hypr"
WALLPAPER_DIR="$HOME/Pictures/wallpapers"
HYPR_DIR="${HYPR_DIR:-$HOME/.config/hypr}"
WALLPAPER_PRIMARY_DIR="${WALLPAPER_PRIMARY_DIR:-$HOME/Pictures/wallpapers}"
WALLPAPER_SECONDARY_DIR="${WALLPAPER_SECONDARY_DIR:-$HOME/Pictures/Wallpapers}"

get_wallpaper_roots() {
local roots=()

if [ -d "$WALLPAPER_PRIMARY_DIR" ]; then
roots+=("$WALLPAPER_PRIMARY_DIR")
fi

if [ -d "$WALLPAPER_SECONDARY_DIR" ]; then
roots+=("$WALLPAPER_SECONDARY_DIR")
fi

printf '%s\n' "${roots[@]}"
}

# Get list of available wallpapers
get_wallpaper_list() {
local THEME_NAME=$(cat "$HYPR_DIR/.current-theme" 2>/dev/null || echo "default")
local THEME_NAME=$(cat "$HYPR_DIR/.current-theme" 2>/dev/null || echo "catppuccin-mocha")
local WALLPAPER_LIST=()
local ROOT_DIRS=($(get_wallpaper_roots))

# Check for theme-specific wallpapers
if [ -d "$WALLPAPER_DIR/$THEME_NAME" ]; then
WALLPAPER_LIST=($(find "$WALLPAPER_DIR/$THEME_NAME" -type f \( -iname "*.jpg" -o -iname "*.jpeg" -o -iname "*.png" -o -iname "*.webp" \) 2>/dev/null))
if [ ${#ROOT_DIRS[@]} -eq 0 ]; then
return 1
fi

# Fallback to main wallpaper directory
# Check for theme-specific wallpapers
for dir in "${ROOT_DIRS[@]}"; do
if [ -d "$dir/$THEME_NAME" ]; then
while IFS= read -r file; do
WALLPAPER_LIST+=("$file")
done < <(find "$dir/$THEME_NAME" -type f \( -iname "*.jpg" -o -iname "*.jpeg" -o -iname "*.png" -o -iname "*.webp" \) 2>/dev/null)
fi
done

# Fallback to main wallpaper directory (recursive to capture nested sets)
if [ ${#WALLPAPER_LIST[@]} -eq 0 ]; then
WALLPAPER_LIST=($(find "$WALLPAPER_DIR" -maxdepth 1 -type f \( -iname "*.jpg" -o -iname "*.jpeg" -o -iname "*.png" -o -iname "*.webp" \) 2>/dev/null))
for dir in "${ROOT_DIRS[@]}"; do
while IFS= read -r file; do
WALLPAPER_LIST+=("$file")
done < <(find "$dir" -type f \( -iname "*.jpg" -o -iname "*.jpeg" -o -iname "*.png" -o -iname "*.webp" \) 2>/dev/null)
done
fi

if [ ${#WALLPAPER_LIST[@]} -eq 0 ]; then
return 1
fi

# Sort for consistent order
IFS=$'\n' WALLPAPER_LIST=($(sort <<<"${WALLPAPER_LIST[*]}"))
unset IFS
mapfile -t WALLPAPER_LIST < <(printf '%s\n' "${WALLPAPER_LIST[@]}" | sort -u)

printf '%s\n' "${WALLPAPER_LIST[@]}"
}
Expand Down Expand Up @@ -82,7 +109,7 @@ cycle_wallpaper() {
local WALLPAPER_LIST=($(get_wallpaper_list))

if [ ${#WALLPAPER_LIST[@]} -eq 0 ]; then
notify-send "No Wallpapers" "No wallpapers found in $WALLPAPER_DIR" -u critical
notify-send "No Wallpapers" "No wallpapers found in $(get_wallpaper_roots | paste -sd ', ' -)" -u critical
return 1
fi

Expand Down
93 changes: 48 additions & 45 deletions cos_nov21/dotfiles/hypr/scripts/wallpaper-select.sh
Original file line number Diff line number Diff line change
@@ -1,69 +1,72 @@
#!/bin/bash
# Interactive wallpaper selector with preview - Hyde Style

HYPR_DIR="$HOME/.config/hypr"
WALLPAPER_DIR="$HOME/Pictures/Wallpapers"
THEME_NAME=$(cat "$HYPR_DIR/.current-theme" 2>/dev/null || echo "catppuccin-mocha")
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$SCRIPT_DIR/wallpaper-lib.sh"

# Get list of wallpapers
if [ -d "$WALLPAPER_DIR/$THEME_NAME" ]; then
WALLPAPER_LIST=("$WALLPAPER_DIR/$THEME_NAME"/*.{jpg,png,jpeg})
else
WALLPAPER_LIST=("$WALLPAPER_DIR"/*.{jpg,png,jpeg})
fi
HYPR_DIR="${HYPR_DIR:-$HOME/.config/hypr}"

# Remove glob patterns if no files found
WALLPAPER_LIST=("${WALLPAPER_LIST[@]}" | grep -v '\*')
mapfile -t WALLPAPER_LIST < <(get_wallpaper_list)
mapfile -t WALLPAPER_ROOTS < <(get_wallpaper_roots)

if [ ${#WALLPAPER_LIST[@]} -eq 0 ]; then
notify-send "No Wallpapers" "No wallpapers found in $WALLPAPER_DIR" -u critical
notify-send "No Wallpapers" "No wallpapers found in $(get_wallpaper_roots | paste -sd ', ' -)" -u critical
exit 1
fi

# Create menu entries
# Build a readable name that shows folder context for similarly named files
format_wallpaper_label() {
local path="$1"
local shortened="$path"

for root in "${WALLPAPER_ROOTS[@]}"; do
case "$path" in
"$root"/*)
shortened="${path#"$root"/}"
break
;;
esac
done

echo "$shortened"
}

# Create menu entries with deterministic indices so selection always resolves
MENU_ENTRIES=""
CURRENT_WALLPAPER=$(cat "$HYPR_DIR/.current-wallpaper" 2>/dev/null)
for wallpaper in "${WALLPAPER_LIST[@]}"; do
if [ "$wallpaper" = "$CURRENT_WALLPAPER" ]; then
MENU_ENTRIES+="● $(basename "$wallpaper") (current)\n"
else
MENU_ENTRIES+=" $(basename "$wallpaper")\n"
fi
CURRENT_WALLPAPER=$(get_current_wallpaper)
for i in "${!WALLPAPER_LIST[@]}"; do
wallpaper="${WALLPAPER_LIST[$i]}"
marker=" "
[ "$wallpaper" = "$CURRENT_WALLPAPER" ] && marker="● "

MENU_ENTRIES+="$i||$marker$(format_wallpaper_label "$wallpaper")\n"
done

# Show menu and get selection (prefer rofi, fallback to wofi)
if command -v rofi >/dev/null 2>&1; then
SELECTED=$(echo -e "$MENU_ENTRIES" | rofi -dmenu -i -p "󰸉 Select Wallpaper" -theme-str 'window {width: 600px;} listview {lines: 12;}')
# Rofi supports image previews via icon attributes
SELECTED=$(printf "%b" "$MENU_ENTRIES" | while IFS= read -r line; do
idx="${line%%||*}"
label="${line#*||}"
wp_path="${WALLPAPER_LIST[$idx]}"
printf "%s\0icon\x1f%s\n" "$line" "$wp_path"
done | rofi -dmenu -i -p "󰸉 Select Wallpaper" -show-icons -theme-str 'window {width: 780px;} listview {lines: 12;}' )
else
SELECTED=$(echo -e "$MENU_ENTRIES" | wofi --dmenu --prompt "󰸉 Select Wallpaper" --width 600 --height 400)
# Wofi renders inline previews when --allow-images is set and entries start with img:
SELECTED=$(printf "%b" "$MENU_ENTRIES" | while IFS= read -r line; do
idx="${line%%||*}"
wp_path="${WALLPAPER_LIST[$idx]}"
printf "img:%s\t%s\n" "$wp_path" "$line"
done | wofi --dmenu --prompt "󰸉 Select Wallpaper" --width 780 --height 460 --allow-images)
fi

if [ -z "$SELECTED" ]; then
exit 0
fi

# Extract wallpaper name (remove marker and current indicator)
WALLPAPER_NAME=$(echo "$SELECTED" | sed 's/^[● ]*//' | sed 's/ (current)$//')

# Find full path
for wallpaper in "${WALLPAPER_LIST[@]}"; do
if [ "$(basename "$wallpaper")" = "$WALLPAPER_NAME" ]; then
SELECTED_WALLPAPER="$wallpaper"
break
fi
done

# Set wallpaper
if [ -n "$SELECTED_WALLPAPER" ]; then
if command -v swww >/dev/null 2>&1; then
swww img "$SELECTED_WALLPAPER" --transition-type fade --transition-fps 60
else
killall hyprpaper 2>/dev/null
echo "preload = $SELECTED_WALLPAPER" > "$HYPR_DIR/hyprpaper.conf"
echo "wallpaper = ,$SELECTED_WALLPAPER" >> "$HYPR_DIR/hyprpaper.conf"
hyprpaper &
fi
# Resolve selection via stable index prefix (format: index||label)
SELECTED_INDEX=$(echo "$SELECTED" | cut -d '|' -f1)

echo "$SELECTED_WALLPAPER" > "$HYPR_DIR/.current-wallpaper"
notify-send "󰸉 Wallpaper Changed" "$WALLPAPER_NAME" -t 2000
if [[ "$SELECTED_INDEX" =~ ^[0-9]+$ ]] && [ "$SELECTED_INDEX" -lt ${#WALLPAPER_LIST[@]} ]; then
set_wallpaper "${WALLPAPER_LIST[$SELECTED_INDEX]}"
fi
2 changes: 1 addition & 1 deletion cos_nov21/dotfiles/kitty/kitty.conf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ font_size 11.0
# Window configuration
window_padding_width 8
confirm_os_window_close 0
background_opacity 0.85
background_opacity 0.78
dynamic_background_opacity yes

# Tab bar
Expand Down
Loading