feat: formalize in-flight hyprland/dotfiles/role changes

Claude-Session: https://claude.ai/code/session_01PaGefHKzMcjAhoHpNKUe27
This commit is contained in:
Tuan-Dat Tran
2026-07-28 08:51:15 +02:00
parent 753bdfd403
commit 3f4a550f87
13 changed files with 311 additions and 20 deletions

View File

@@ -1,11 +1,4 @@
# #######################################################################################
# AUTOGENERATED HYPRLAND CONFIG.
# EDIT THIS CONFIG ACCORDING TO THE WIKI INSTRUCTIONS.
# #######################################################################################
autogenerated = 0 # remove this line to remove the warning
# This is an example Hyprland config file.
# Refer to the wiki for more information.
# https://wiki.hypr.land/Configuring/
@@ -23,7 +16,7 @@ autogenerated = 0 # remove this line to remove the warning
################
# See https://wiki.hypr.land/Configuring/Monitors/
monitor=,preferred,auto,auto
monitor=,preferred,auto,1
###################
@@ -188,7 +181,7 @@ animations {
# See https://wiki.hypr.land/Configuring/Dwindle-Layout/ for more
dwindle {
pseudotile = true # Master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below
# pseudotile = true # Master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below
preserve_split = true # You probably want this
}
@@ -210,18 +203,18 @@ misc {
# https://wiki.hypr.land/Configuring/Variables/#input
input {
kb_layout = us
kb_layout = eu
kb_variant =
kb_model =
kb_options = caps:ctrl_modifier
kb_rules =
follow_mouse = 1
follow_mouse = 0
sensitivity = 0 # -1.0 - 1.0, 0 means no modification.
touchpad {
natural_scroll = false
natural_scroll = true
}
}
@@ -246,6 +239,7 @@ $mainMod = SUPER # Sets "Windows" key as main modifier
# Example binds, see https://wiki.hypr.land/Configuring/Binds/ for more
bind = $mainMod, Return, exec, $terminal
bind = $mainMod SHIFT, Q, killactive,
bind = $mainMod SHIFT, Space, exec, hyprlock
# bind = $mainMod, M, exec, command -v hyprshutdown >/dev/null 2>&1 && hyprshutdown || hyprctl dispatch exit
bind = $mainMod, E, exec, $fileManager
bind = $mainMod, B, exec, $browser

View File

@@ -0,0 +1,82 @@
# hyprlock.conf
# for more configuration options, refer https://wiki.hyprland.org/Hypr-Ecosystem/hyprlock
$font = Monospace
general {
hide_cursor = false
}
animations {
enabled = true
bezier = linear, 1, 1, 0, 0
animation = fadeIn, 1, 5, linear
animation = fadeOut, 1, 5, linear
animation = inputFieldDots, 1, 2, linear
}
background {
monitor =
path = screenshot
blur_passes = 3
}
input-field {
monitor =
size = 20%, 5%
outline_thickness = 3
inner_color = rgba(0, 0, 0, 0.0)
outer_color = rgba(33ccffee) rgba(00ff99ee) 45deg
check_color = rgba(00ff99ee) rgba(ff6633ee) 120deg
fail_color = rgba(ff6633ee) rgba(ff0066ee) 40deg
font_color = rgb(143, 143, 143)
fade_on_empty = false
rounding = 15
font_family = $font
placeholder_text = Input password...
fail_text = $PAMFAIL
dots_spacing = 0.3
position = 0, -20
halign = center
valign = center
}
# TIME
label {
monitor =
text = $TIME
font_size = 90
font_family = $font
position = -30, 0
halign = right
valign = top
}
# DATE
label {
monitor =
text = cmd[update:60000] date +"%A, %d %B %Y"
font_size = 25
font_family = $font
position = -30, -150
halign = right
valign = top
}
label {
monitor =
text = $LAYOUT[en,ru]
font_size = 24
onclick = hyprctl switchxkblayout all next
position = 250, -20
halign = center
valign = center
}

View File

@@ -0,0 +1,51 @@
#!/bin/bash
PHILIPS="Philips Consumer Electronics Company PHL 325B1L UK02311010066"
INTERNAL="eDP-1"
PENDING_FILE="/tmp/hypr-monitor-pending-pid"
LOG="/tmp/hypr-monitors.log"
log() { echo "[$(date '+%H:%M:%S')] $*" >> "$LOG"; }
handle_monitor_event() {
local monitors
monitors=$(hyprctl monitors)
log "handle_monitor_event called"
log "Active monitors: $(echo "$monitors" | grep '^Monitor')"
if echo "$monitors" | grep -q "$PHILIPS"; then
log "Home setup detected — enabling externals"
hyprctl keyword monitor "DP-6, 2560x1440@60, 0x0, 1" && log "DP-6 ok" || log "DP-6 FAILED"
hyprctl keyword monitor "DP-7, 1920x1080@120, 2560x0, 1" && log "DP-7 ok" || log "DP-7 FAILED"
sleep 1
hyprctl keyword monitor "$INTERNAL, disable" && log "eDP-1 disabled" || log "eDP-1 disable FAILED"
else
log "No external monitor — enabling internal"
hyprctl keyword monitor "$INTERNAL, preferred, 0x0, 1" && log "eDP-1 enabled" || log "eDP-1 enable FAILED"
hyprctl dispatch dpms on "$INTERNAL" && log "eDP-1 DPMS on" || log "eDP-1 DPMS FAILED"
sleep 0.5
for i in $(seq 1 10); do
hyprctl dispatch moveworkspacetomonitor "$i" "$INTERNAL" 2>/dev/null
done
log "Workspaces moved to eDP-1"
fi
}
schedule_handle() {
local pending
pending=$(cat "$PENDING_FILE" 2>/dev/null)
[ -n "$pending" ] && kill "$pending" 2>/dev/null
(sleep 1.5 && handle_monitor_event) &
echo $! > "$PENDING_FILE"
}
log "Script started"
handle_monitor_event
socat -U - UNIX-CONNECT:$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock | while read -r line; do
if [[ $line == "monitoradded"* ]] || [[ $line == "monitorremoved"* ]]; then
schedule_handle
fi
done

View File

@@ -0,0 +1,36 @@
output "Philips Consumer Electronics Company PHL 325B1L UK02311010066" {
mode 2560x1440@60
position 0,0
scale 1
alias $HOME_LEFT
}
output "ASUSTek COMPUTER INC VG248 L4LMQS119147" {
mode 1920x1080@120
position 2560,0
scale 1
alias $HOME_RIGHT
}
output eDP-1 {
mode 1920x1200@60
scale 1
alias $INTERNAL
}
# Profile for when you are at your desk
profile home {
output $HOME_LEFT enable
output $HOME_RIGHT enable
output $INTERNAL disable
}
# Profile for when you are on the go
profile outside {
output $INTERNAL enable
exec sleep 1 && hyprctl dispatch dpms on eDP-1
}
profile fallback {
}

View File

@@ -0,0 +1,34 @@
# Get editor completions based on the config schema
"$schema" = 'https://starship.rs/config-schema.json'
# Inserts a blank line between shell prompts
add_newline = true
# Replace the '' symbol in the prompt with '➜'
[character] # The name of the module we are configuring is 'character'
success_symbol = '[➜](bold green)' # The 'success_symbol' segment is being set to '➜' with the color 'bold green'
# Disable the package module, hiding it from the prompt completely
[package]
disabled = true
[kubernetes]
disabled = false
format = 'on [⛵ ($user on )($cluster in )$context \($namespace\)](dimmed green) '
contexts = [
{ context_pattern = "dev.local.cluster.k8s", style = "green", symbol = "💔 " },
]
[docker_context]
format = 'via [🐋 $context](blue bold)'
[azure]
disabled = false
format = "on [$symbol($username)]($style) "
symbol = '󰠅 '
style = 'blue bold'
[battery]
full_symbol = '🔋 '
charging_symbol = '⚡️ '
discharging_symbol = '💀 '