diff --git a/hypr/autostart.sh b/hypr/autostart.sh new file mode 100755 index 0000000..c404f30 --- /dev/null +++ b/hypr/autostart.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# ~/.config/hypr/autostart.sh +# Launches apps and moves them to the correct workspace once their window appears. +# Use in hyprland.conf: +# exec-once = ~/.config/hypr/autostart.sh + +# ── helpers ─────────────────────────────────────────────────────────────────── + +# Wait for a window matching a class/title regex, then move it to a workspace. +# Usage: launch_on +launch_on() { + local ws="$1" + local class="$2" + shift 2 + local cmd=("$@") + + # Launch the app in the background + "${cmd[@]}" & + + # Poll until the window appears, then move it + for _ in $(seq 1 30); do + sleep 1 + local addr + addr=$(hyprctl clients -j \ + | grep -i "\"class\": \"$class\"" \ + | head -1) + if [[ -n "$addr" ]]; then + hyprctl dispatch movetoworkspacesilent "$ws,class:^(${class})$" + break + fi + done +} + +# ── app definitions ─────────────────────────────────────────────────────────── +# launch_on + +launch_on 1 firefox firefox +launch_on 2 code code +launch_on 3 kitty kitty +launch_on 4 vesktop vesktop +launch_on 5 steam steam +launch_on 6 spotify spotify \ No newline at end of file diff --git a/hypr/hyprland.conf b/hypr/hyprland.conf index 2ed4ffe..13b827a 100644 --- a/hypr/hyprland.conf +++ b/hypr/hyprland.conf @@ -105,8 +105,7 @@ decoration { # https://wiki.hypr.land/Configuring/Variables/#animations animations { - enabled = yes, please :) - + enabled = yes # Default curves, see https://wiki.hypr.land/Configuring/Animations/#curves # NAME, X0, Y0, X1, Y1 bezier = easeOutQuint, 0.23, 1, 0.32, 1 @@ -160,19 +159,7 @@ misc { # https://wiki.hypr.land/Configuring/Variables/#input input { - kb_layout = us - kb_variant = - kb_model = - kb_options = - kb_rules = - - follow_mouse = 1 - - sensitivity = 0 # -1.0 - 1.0, 0 means no modification. - - touchpad { - natural_scroll = false - } + kb_layout = us,dk } # See https://wiki.hypr.land/Configuring/Gestures @@ -197,7 +184,7 @@ $mainMod = SUPER # Sets "Windows" key as main modifier bind = $mainMod, return, exec, $terminal bind = $mainMod, W, killactive, bind = $mainMod, M, exec, command -v hyprshutdown >/dev/null 2>&1 && hyprshutdown || hyprctl dispatch exit -bind = $mainMod, R, exec, hyprctl reload & killall -SIGUSR2 waybar & hyprpaper +bind = SUPER, R, exec, sh -c '~/.config/hypr/reload.sh' bind = $mainMod, V, togglefloating, bind = $mainMod, space, exec, $menu bind = $mainMod, P, pseudo, # dwindle @@ -243,7 +230,7 @@ bind = SUPER ALT, left, movefocus, l # Example special workspace (scratchpad) -bind = $mainMod, S, togglespecialworkspace, magic +bind = $mainMod, S, exec, grim -g "$(slurp)" - | wl-copy bind = $mainMod SHIFT, S, movetoworkspace, special:magic # Scroll through existing workspaces with mainMod + scroll @@ -274,6 +261,7 @@ bind = $mainMod CTRL, left, resizeactive, -50 0 bind = $mainMod CTRL, up, resizeactive, 0 -50 bind = $mainMod CTRL, down, resizeactive, 0 50 +bind = $mainMod CTRL, Space, exec, hyprctl switchxkblayout at-translated-set-2-keyboard next ############################## ### WINDOWS AND WORKSPACES ### ############################## @@ -314,26 +302,8 @@ windowrule { float = yes } -exec-once = hyprpaper +# env stuff exec-once = waybar - -# NEW 0.53 syntax -windowrule = match:class ^(discord)$, workspace 4 silent -windowrule = match:class ^(Spotify)$, workspace 6 silent - -exec-once = discord -exec-once = spotify - -exec-once = discord -exec-once = spotify - -exec-once = [workspace 1 silent] firefox -exec-once = [workspace 2 silent] code -exec-once = [workspace 3 silent] kitty -exec-once = [workspace 5 silent] rmpc -exec-once = discord -exec-once = spotify - - -# Format: monitor=name,resolution@refreshrate,position,scale - +exec-once = hyprpaper +exec-once = ~/.config/hypr/autostart.sh +exec-once = ~/.config/hypr/wallpaper-cycle.sh \ No newline at end of file diff --git a/hypr/hyprpaper.conf b/hypr/hyprpaper.conf index 02fd45b..5d51857 100644 --- a/hypr/hyprpaper.conf +++ b/hypr/hyprpaper.conf @@ -1,14 +1,5 @@ -ipc = off +# ~/.config/hypr/hyprpaper.conf +ipc = true splash = false -wallpaper { - monitor = DP-2 - path = ~/.config/hypr/paper/harbor-sunset.jpg - fit_mode = cover -} - -wallpaper { - monitor = HDMI-A-1 - path = ~/.config/hypr/paper/harbor-sunset.jpg - fit_mode = cover -} - +preload = ~/.config/hypr/paper/day.jpg +preload = ~/.config/hypr/paper/night.jpg \ No newline at end of file diff --git a/hypr/paper/day.jpg b/hypr/paper/day.jpg new file mode 100644 index 0000000..74af522 Binary files /dev/null and b/hypr/paper/day.jpg differ diff --git a/hypr/paper/harbor-sunset.jpg b/hypr/paper/harbor-sunset.jpg deleted file mode 100644 index 5d81907..0000000 Binary files a/hypr/paper/harbor-sunset.jpg and /dev/null differ diff --git a/hypr/paper/harbor-sunset.webp b/hypr/paper/harbor-sunset.webp deleted file mode 100644 index 1c8f0c0..0000000 Binary files a/hypr/paper/harbor-sunset.webp and /dev/null differ diff --git a/hypr/paper/night.jpg b/hypr/paper/night.jpg new file mode 100644 index 0000000..ee20e46 Binary files /dev/null and b/hypr/paper/night.jpg differ diff --git a/hypr/paper/wall2.jpeg b/hypr/paper/wall2.jpeg deleted file mode 100644 index 0ab906b..0000000 Binary files a/hypr/paper/wall2.jpeg and /dev/null differ diff --git a/hypr/paper/wallpaper.jpg b/hypr/paper/wallpaper.jpg deleted file mode 100644 index 047b6f6..0000000 Binary files a/hypr/paper/wallpaper.jpg and /dev/null differ diff --git a/hypr/reload.sh b/hypr/reload.sh new file mode 100755 index 0000000..c28bd05 --- /dev/null +++ b/hypr/reload.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +killall -SIGUSR2 waybar 2>/dev/null + +pkill hyprpaper 2>/dev/null +setsid hyprpaper &>/dev/null & + +pkill -f wallpaper-cycle.sh 2>/dev/null +setsid ~/.config/hypr/wallpaper-cycle.sh &>/dev/null & + +hyprctl reload \ No newline at end of file diff --git a/hypr/wallpaper-cycle.sh b/hypr/wallpaper-cycle.sh new file mode 100755 index 0000000..447fd9d --- /dev/null +++ b/hypr/wallpaper-cycle.sh @@ -0,0 +1,48 @@ +#!/usr/bin/env bash + +DAY_HOUR=7 +NIGHT_HOUR=20 + +DAY_WALL="$HOME/.config/hypr/paper/day.jpg" +NIGHT_WALL="$HOME/.config/hypr/paper/night.jpg" + +apply_day() { + hyprctl hyprpaper wallpaper "DP-2,$DAY_WALL" &>/dev/null + hyprctl hyprpaper wallpaper "HDMI-A-1,$DAY_WALL" &>/dev/null +} +apply_night() { + hyprctl hyprpaper wallpaper "DP-2,$NIGHT_WALL" &>/dev/null + hyprctl hyprpaper wallpaper "HDMI-A-1,$NIGHT_WALL" &>/dev/null +} + +apply_now() { + hour=$(date +%H) + if (( hour >= DAY_HOUR && hour < NIGHT_HOUR )); then + apply_night + echo "night" + else + apply_day + echo "day" + fi +} + +# --- FAST START --- +current_mode=$(apply_now) + +# If hyprpaper wasn't ready yet, retry once shortly after +sleep 0.5 +current_mode=$(apply_now) + +# --- MAIN LOOP --- +while true; do + hour=$(date +%H) + + if (( hour >= DAY_HOUR && hour < NIGHT_HOUR )); then + [[ "$current_mode" != "day" ]] && current_mode=$(apply_now) + else + [[ "$current_mode" != "night" ]] && current_mode=$(apply_now) + fi + + # sleep until next minute boundary (feels instant at change) + sleep $((60 - $(date +%S))) +done \ No newline at end of file diff --git a/waybar/config.jsonc b/waybar/config.jsonc index 67e9cf5..2ae0eea 100644 --- a/waybar/config.jsonc +++ b/waybar/config.jsonc @@ -5,7 +5,7 @@ "position": "top", "height": 24, "spacing": 4, - "margin-top": 4, + "margin-top": 8, "margin-left": 10, "margin-right": 10, "modules-left": ["hyprland/workspaces", "hyprland/window"], @@ -21,7 +21,7 @@ }, "format-icons": { "1": "1", "2": "2", "3": "3", "4": "4", "5": "5", - "urgent": "", "active": "╳", "default": "" + "urgent": "", "default": "" } }, "hyprland/window": { "format": " {}", "max-length": 20, "separate-outputs": true }, @@ -60,7 +60,7 @@ "position": "top", "height": 24, "spacing": 4, - "margin-top": 4, + "margin-top": 8, "margin-left": 10, "margin-right": 10, "modules-left": ["hyprland/workspaces", "hyprland/window"], @@ -76,7 +76,7 @@ }, "format-icons": { "6": "6", "7": "7", "8": "8", "9": "9", "10": "10", - "urgent": "", "active": "╳", "default": "" + "urgent": "", "default": "" } }, "hyprland/window": { "format": " {}", "max-length": 50, "separate-outputs": true }, diff --git a/waybar/style.css b/waybar/style.css index 2dc5b2c..718acfd 100644 --- a/waybar/style.css +++ b/waybar/style.css @@ -32,13 +32,12 @@ window#waybar { #workspaces button:hover { background: rgba(137, 180, 250, 0.15); - color: #89b4fa; + color: #ffffff; } #workspaces button.active { - color: #89b4fa; - background: rgba(137, 180, 250, 0.20); - border-bottom: 2px solid #89b4fa; + background: rgb(167, 124, 215); + color: #ffffff; } #workspaces button.urgent { @@ -47,7 +46,7 @@ window#waybar { } #workspaces button.empty { - color: #313244; + color: #6c7086; } /* ── Window title ───────────────────────────────────── */