updating wallpaper with a cycle 7am and 8pm
This commit is contained in:
42
hypr/autostart.sh
Executable file
42
hypr/autostart.sh
Executable file
@@ -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 <workspace> <class_regex> <command>
|
||||
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 <workspace> <window class> <command ...>
|
||||
|
||||
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
|
||||
@@ -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
|
||||
@@ -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
|
||||
BIN
hypr/paper/day.jpg
Normal file
BIN
hypr/paper/day.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 279 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 6.9 MiB |
Binary file not shown.
|
Before Width: | Height: | Size: 140 KiB |
BIN
hypr/paper/night.jpg
Normal file
BIN
hypr/paper/night.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 48 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 1.4 MiB |
Binary file not shown.
|
Before Width: | Height: | Size: 24 KiB |
11
hypr/reload.sh
Executable file
11
hypr/reload.sh
Executable file
@@ -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
|
||||
48
hypr/wallpaper-cycle.sh
Executable file
48
hypr/wallpaper-cycle.sh
Executable file
@@ -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
|
||||
@@ -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 },
|
||||
|
||||
@@ -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 ───────────────────────────────────── */
|
||||
|
||||
Reference in New Issue
Block a user