refactor: waybar, hypr config

This commit is contained in:
2026-03-11 15:55:48 +03:00
parent c048717831
commit b54b5c823f
13 changed files with 128 additions and 97 deletions

View File

@@ -1,36 +1,21 @@
general { general {
lock_cmd = hyprlock > /tmp/pidor.txt # avoid starting multiple hyprlock instances. lock_cmd = hyprlock > /tmp/pidor.txt # avoid starting multiple hyprlock instances.
before_sleep_cmd = loginctl lock-session # lock before suspend. before_sleep_cmd = loginctl lock-session # lock before suspend.
after_sleep_cmd = hyprctl dispatch dpms on # to avoid having to press a key twice to turn on the display. after_sleep_cmd = hyprctl dispatch dpms on # to avoid having to press a key twice to turn on the display.
} }
listener { listener {
timeout = 140 # 2.5min. timeout = 290 # 5min - 10s (for the screen fade delay).
#on-timeout = brightnessctl -s set 10 # set monitor backlight to minimum, avoid 0 on OLED monitor.
on-timeout = touch /tmp/asleepin && /home/greg/.config/hypr/scripts/dimscreen.sh on-timeout = touch /tmp/asleepin && /home/greg/.config/hypr/scripts/dimscreen.sh
on-resume = rm /tmp/asleepin && brightnessctl -r on-resume = rm /tmp/asleepin && brightnessctl -r
#on-resume = brightnessctl -r # monitor backlight restore.
} }
# turn off keyboard backlight, comment out this section if you dont have a keyboard backlight.
# listener {
# timeout = 150 # 2.5min.
# on-timeout = brightnessctl -sd rgb:kbd_backlight set 0 # turn off keyboard backlight.
# on-resume = brightnessctl -rd rgb:kbd_backlight # turn on keyboard backlight.
# }
listener { listener {
timeout = 150 # 1min timeout = 300 # 5min
on-timeout = loginctl lock-session # lock screen when timeout has passed on-timeout = loginctl lock-session # lock screen when timeout has passed
} }
# listener {
# timeout = 150 # 5.5min
# on-timeout = hyprctl dispatch dpms off # screen off when timeout has passed
# on-resume = hyprctl dispatch dpms on && brightnessctl -r # screen on when activity is detected after timeout has fired.
# }
listener { listener {
timeout = 900 # 30min timeout = 1800 # 30min
on-timeout = systemctl suspend # suspend pc on-timeout = systemctl suspend # suspend pc
} }

View File

@@ -1,8 +1,5 @@
################
### MONITORS ###
################
source = ~/.config/hypr/monitors.conf source = ~/.config/hypr/monitors.conf
source = ~/.config/hypr/permissions.conf
################### ###################
### MY PROGRAMS ### ### MY PROGRAMS ###
@@ -45,6 +42,7 @@ exec-once = $startDelay && ~/.config/hypr/scripts/sounds.sh
exec-once = $startDelay && ~/.config/hypr/scripts/random_wallpaper.sh exec-once = $startDelay && ~/.config/hypr/scripts/random_wallpaper.sh
exec-once = $startDelay && ~/.config/hypr/scripts/autofreezer.sh exec-once = $startDelay && ~/.config/hypr/scripts/autofreezer.sh
exec-once = .cargo/bin/mpd-discord-rpc exec-once = .cargo/bin/mpd-discord-rpc
exec-once = .venv312/bin/python3 .venv312/bin/jellyfin-rpc --ini-path $HOME/.config/jellyfin-rpc/jellyfin_rpc.ini
exec-shutdown = play -v 0.7 $HOME/Templates/Sounds/teleport.mp3 exec-shutdown = play -v 0.7 $HOME/Templates/Sounds/teleport.mp3
@@ -55,10 +53,6 @@ exec-shutdown = play -v 0.7 $HOME/Templates/Sounds/teleport.mp3
env = XCURSOR_SIZE,24 env = XCURSOR_SIZE,24
env = HYPRCURSOR_SIZE,24 env = HYPRCURSOR_SIZE,24
###################
### PERMISSIONS ###
###################
##################### #####################
### LOOK AND FEEL ### ### LOOK AND FEEL ###
##################### #####################
@@ -169,6 +163,8 @@ workspace = 6, monitor:HDMI-A-1
workspace = 7, monitor:HDMI-A-1 workspace = 7, monitor:HDMI-A-1
workspace = 8, monitor:HDMI-A-1 workspace = 8, monitor:HDMI-A-1
workspace = 9, monitor:HDMI-A-1 workspace = 9, monitor:HDMI-A-1
workspace = special:magic
workspace = special:dungeon
dwindle { 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
@@ -198,6 +194,7 @@ misc {
size_limits_tiled = true size_limits_tiled = true
on_focus_under_fullscreen = 0 on_focus_under_fullscreen = 0
exit_window_retains_fullscreen = false exit_window_retains_fullscreen = false
close_special_on_empty = false
} }
############## ##############
@@ -215,8 +212,6 @@ cursor {
input { input {
kb_layout = us,ru kb_layout = us,ru
kb_options = grp:caps_toggle,grp_led:caps kb_options = grp:caps_toggle,grp_led:caps
repeat_rate = 25
repeat_delay = 200
follow_mouse = 2 follow_mouse = 2
float_switch_override_focus = 0 float_switch_override_focus = 0
@@ -228,6 +223,8 @@ input {
disable_while_typing = true disable_while_typing = true
middle_button_emulation = true middle_button_emulation = true
} }
special_fallthrough = true
} }
gestures { gestures {
@@ -259,13 +256,14 @@ $mainMod = SUPER
binds { binds {
allow_workspace_cycles = true allow_workspace_cycles = true
hide_special_on_workspace_change = true
} }
# Exit hyprland # Exit hyprland
bind = $mainMod ALT, Q, exit, bind = $mainMod ALT, Q, exit,
# Shutdown # Shutdown
bind = $mainMod SHIFT, delete, exec, shutdown now bind = $mainMod SHIFT, delete, exec, sudo poweroff -f
# Menu dropdown # Menu dropdown
bind = $mainMod, P, sendshortcut, , Menu, activewindow bind = $mainMod, P, sendshortcut, , Menu, activewindow
@@ -327,18 +325,32 @@ bind = $mainMod, k, movefocus, u
bind = $mainMod, j, movefocus, d bind = $mainMod, j, movefocus, d
# Switch workspaces with mainMod + [0,1,2,3,4,5,6,7,8,9,0,-,=] # Switch workspaces with mainMod + [0,1,2,3,4,5,6,7,8,9,0,-,=]
bind = $mainMod, 1, workspace, 1 bindr = $mainMod, 1, workspace, 1
bind = $mainMod, 2, workspace, 2 bindr = $mainMod, 2, workspace, 2
bind = $mainMod, 3, workspace, 3 bindr = $mainMod, 3, workspace, 3
bind = $mainMod, 4, workspace, 4 bindr = $mainMod, 4, workspace, 4
bind = $mainMod, 5, workspace, 5 bindr = $mainMod, 5, workspace, 5
bind = $mainMod, 6, workspace, 6 bindr = $mainMod, 6, workspace, 6
bind = $mainMod, 7, workspace, 7 bindr = $mainMod, 7, workspace, 7
bind = $mainMod, 8, workspace, 8 bindr = $mainMod, 8, workspace, 8
bind = $mainMod, 9, workspace, 9 bindr = $mainMod, 9, workspace, 9
bind = $mainMod, 0, workspace, 10 bindr = $mainMod, 0, workspace, 10
bind = $mainMod, minus, workspace, 11 bindr = $mainMod, minus, workspace, 11
bind = $mainMod, equal, workspace, 12 bindr = $mainMod, equal, workspace, 12
# Switch to workspace and send it to another monitor
bindo = $mainMod, 1, exec, hyprctl dispatch workspace 1 && hyprctl dispatch movecurrentworkspacetomonitor +1
bindo = $mainMod, 2, exec, hyprctl dispatch workspace 2 && hyprctl dispatch movecurrentworkspacetomonitor +1
bindo = $mainMod, 3, exec, hyprctl dispatch workspace 3 && hyprctl dispatch movecurrentworkspacetomonitor +1
bindo = $mainMod, 4, exec, hyprctl dispatch workspace 4 && hyprctl dispatch movecurrentworkspacetomonitor +1
bindo = $mainMod, 5, exec, hyprctl dispatch workspace 5 && hyprctl dispatch movecurrentworkspacetomonitor +1
bindo = $mainMod, 6, exec, hyprctl dispatch workspace 6 && hyprctl dispatch movecurrentworkspacetomonitor +1
bindo = $mainMod, 7, exec, hyprctl dispatch workspace 7 && hyprctl dispatch movecurrentworkspacetomonitor +1
bindo = $mainMod, 8, exec, hyprctl dispatch workspace 8 && hyprctl dispatch movecurrentworkspacetomonitor +1
bindo = $mainMod, 9, exec, hyprctl dispatch workspace 9 && hyprctl dispatch movecurrentworkspacetomonitor +1
bindo = $mainMod, 0, exec, hyprctl dispatch workspace 10 && hyprctl dispatch movecurrentworkspacetomonitor +1
bindo = $mainMod, minus, exec, hyprctl dispatch workspace 11 && hyprctl dispatch movecurrentworkspacetomonitor +1
bindo = $mainMod, equal, exec, hyprctl dispatch workspace 12 && hyprctl dispatch movecurrentworkspacetomonitor +1
# Move active window to a workspace with mainMod + SHIFT + [0-9] # Move active window to a workspace with mainMod + SHIFT + [0-9]
bind = $mainMod SHIFT, 1, movetoworkspacesilent, 1 bind = $mainMod SHIFT, 1, movetoworkspacesilent, 1
@@ -357,17 +369,13 @@ bind = $mainMod SHIFT, equal, movetoworkspacesilent, 12
# Cycle monitors # Cycle monitors
bind = $mainMod, O, focusmonitor, +1 bind = $mainMod, O, focusmonitor, +1
# Move current workspace to another monitor
bind = $mainMod SHIFT, y, movecurrentworkspacetomonitor, +1
bind = $mainMod SHIFT, v, moveworkspacetomonitor, +0 +1
# Example special workspace (scratchpad) # Example special workspace (scratchpad)
bind = $mainMod, M, togglespecialworkspace, magic bind = $mainMod, M, togglespecialworkspace, magic
bind = $mainMod SHIFT, M, movetoworkspace, special:magic bind = $mainMod SHIFT, M, movetoworkspace, special:magic
# Go to previous/next workspace # Go to previous/next workspace
bind = $mainMod, bracketleft, workspace, -1 bind = $mainMod, bracketleft, workspace, r-1
bind = $mainMod, bracketright, workspace, +1 bind = $mainMod, bracketright, workspace, r+1
# Go to previous/next occupied workspace # Go to previous/next occupied workspace
bind = $mainMod SHIFT, bracketleft, workspace, m-1 bind = $mainMod SHIFT, bracketleft, workspace, m-1
@@ -560,33 +568,6 @@ bind = $mainMod, Tab, submap, reset
bind = $mainMod, Escape, submap, reset bind = $mainMod, Escape, submap, reset
submap = reset submap = reset
# Activate MPD submap with $mainMod + U
bind = $mainMod, U, submap, mpd
# Define the MPD submap
submap = mpd
# MPD controls (actions that exit submap)
bind = , P, exec, mpc toggle
bind = SHIFT, H, exec, mpc prev
bind = SHIFT, L, exec, mpc next
# MPD Seek
binde = , H, exec, mpc seek "-00:00:5"
binde = , L, exec, mpc seek "+00:00:5"
# Volume controls (remain in submap for repeated adjustments)
bind = , J, exec, mpc volume -5
bind = , K, exec, mpc volume +5
# Alternative exit methods
bind = , escape, submap, reset
bind = , Return, submap, reset
bind = , Space, submap, reset
# End the submap definition
submap = reset
############################## ##############################
### WINDOWS AND WORKSPACES ### ### WINDOWS AND WORKSPACES ###
############################## ##############################
@@ -881,7 +862,13 @@ plugin {
} }
} }
ecosystem {
no_donation_nag = true
}
debug { debug {
disable_logs = false disable_logs = false
overlay = false overlay = false
error_position = 1
} }

View File

@@ -1,7 +1,7 @@
# BACKGROUND # BACKGROUND
background { background {
monitor = monitor =
path = /home/greg/Pictures/Wallpapers/waporvape-dark-tvlike-pink.png path = ~/.config/hypr/hyprlock.png
blur_passes = 0 blur_passes = 0
contrast = 0.8916 contrast = 0.8916
brightness = 0.8172 brightness = 0.8172
@@ -19,7 +19,7 @@ general {
# Time-Hour # Time-Hour
label { label {
monitor = monitor =
text = cmd[update:1000] echo "<span>$(date +"%I")</span>" text = cmd[update:1000] echo "<span>$(date +"%H")</span>"
color = rgba(255, 255, 255, 1) color = rgba(255, 255, 255, 1)
font_size = 125 font_size = 125
font_family = StretchPro font_family = StretchPro

BIN
hypr/hyprlock.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

19
hypr/permissions.conf Normal file
View File

@@ -0,0 +1,19 @@
###################
### PERMISSIONS ###
###################
permission = /usr/bin/hypr.*, screencopy, deny
permission = /usr/bin/hyprpm, screencopy, deny
permission = /usr/bin/hyprlock, screencopy, allow
permission = /usr/bin/hyprpicker, screencopy, allow
permission = /usr/bin/grim, screencopy, allow
permission = /usr/bin/obs, screencopy, allow
permission = /usr/bin/obs-ffmpeg-mux, screencopy, allow
permission = /usr/(lib|libexec|lib64)/xdg-desktop-portal-hyprland, screencopy, allow
permission = /usr/(lib|libexec|lib64)/xdg-desktop-portal-hyprland, screencopy, allow
permission = *, keyboard, ask
ecosystem:enforce_permissions = true
ecosystem {
enforce_permissions = false
}

View File

@@ -71,6 +71,12 @@ windowrule {
match:class = ^(Mullvad VPN)$ match:class = ^(Mullvad VPN)$
} }
windowrule {
name = privacy-rule-qbittorrent
tag = privacy
match:class = ^(org.qbittorrent.qBittorrent)$
}
windowrule { windowrule {
name = privacy-rule-13 name = privacy-rule-13
tag = privacy tag = privacy

View File

@@ -0,0 +1,14 @@
#version 320 es
precision mediump float;
in vec2 v_texcoord; // Use 'in' instead of 'varying'
uniform sampler2D tex;
out vec4 fragColor; // Use 'out' instead of 'gl_FragColor'
void main() {
vec4 this_colour = texture(tex, v_texcoord);
float new_colour = (this_colour.r + this_colour.g + this_colour.b) / 3.0;
fragColor = vec4(new_colour, new_colour, new_colour, 0.0);
}

3
hypr/xdph.conf Normal file
View File

@@ -0,0 +1,3 @@
screencopy {
allow_token_by_default = true
}

View File

@@ -13,8 +13,8 @@
"spacing": 0, "spacing": 0,
"reload_style_on_change": true, "reload_style_on_change": true,
"modules-left": [ "modules-left": [
"tray" "tray",
// "custom/pomodoro" "custom/pomodoro"
], ],
"modules-center": [ "modules-center": [
"wlr/taskbar", "wlr/taskbar",

View File

@@ -33,9 +33,8 @@
} }
}, },
"hyprland/workspaces": { "hyprland/workspaces": {
"persistent-only": true,
"disable-scroll": true, "disable-scroll": true,
"all-outputs": false,
"active-only": false,
"warp-on-scroll": false, "warp-on-scroll": false,
"move-to-monitor": true, "move-to-monitor": true,
"persistent-workspaces": { "persistent-workspaces": {

View File

@@ -8,8 +8,10 @@ TOP_STYLE="$DIR/style/style_top.css"
BOTTOM_CONFIG="$DIR/config_bottom.jsonc" BOTTOM_CONFIG="$DIR/config_bottom.jsonc"
BOTTOM_STYLE="$DIR/style/style_bottom.css" BOTTOM_STYLE="$DIR/style/style_bottom.css"
DOCK_CONFIG="$DIR/config_dock.jsonc" # A hack needed for the bar to recognize the special workspaces defined in the
DOCK_STYLE="$DIR/style/style_dock.css" # Hyprland config instead of creating regular workspaces with the same name,
# breaking the functionality.
# POPULATE_SPECIAL_WORKSPACES=1
kill_bars() { kill_bars() {
if pgrep waybar > /dev/null; then if pgrep waybar > /dev/null; then
@@ -20,9 +22,22 @@ kill_bars() {
} }
run_bars() { run_bars() {
# if [ $POPULATE_SPECIAL_WORKSPACES -eq 1 ]; then
# hyprctl dispatch exec [ workspace special:dungeon silent ] "kitty --class kitty-specialkludge1"
# hyprctl dispatch exec [ workspace special:magic silent ] "kitty --class kitty-specialkludge2"
# sleep 1
# fi
waybar -c "$TOP_CONFIG" -s "$TOP_STYLE" & waybar -c "$TOP_CONFIG" -s "$TOP_STYLE" &
waybar -c "$BOTTOM_CONFIG" -s "$BOTTOM_STYLE" & waybar -c "$BOTTOM_CONFIG" -s "$BOTTOM_STYLE" &
waybar -c "$DOCK_CONFIG" -s "$DOCK_STYLE" &
# if [ $POPULATE_SPECIAL_WORKSPACES -eq 1 ]; then
# sleep 2
# hyprctl dispatch closewindow class:kitty-specialkludge1
# hyprctl dispatch closewindow class:kitty-specialkludge2
# fi
return 0 return 0
} }

View File

@@ -4,9 +4,9 @@
@define-color bg-opaque rgba(23, 28, 39, 0.8); @define-color bg-opaque rgba(23, 28, 39, 0.8);
@define-color border-color-section rgba(0,0,0,0); @define-color border-color-section rgba(0,0,0,0);
@define-color border-color rgba(90, 104, 115, 0.8); /* Matches --noti-border-color */ @define-color border-color rgba(90, 104, 115, 0.8); /* Matches --noti-border-color */
@define-color text-primary #ffffff; @define-color text-primary #cccccc;
@define-color text-secondary alpha(@text-primary,.2); @define-color text-secondary alpha(@text-primary,.2);
@define-color accent #E83C82; @define-color accent #FD5164;
@define-color attention #FFFF00; @define-color attention #FFFF00;
@define-color warning #FFAA00; @define-color warning #FFAA00;
@define-color danger #FF0000; @define-color danger #FF0000;

View File

@@ -77,12 +77,16 @@ window#waybar.chromium {
} }
/* Workspace States */ /* Workspace States */
#workspaces button.empty { #workspaces button.empty:not(.special) {
color: @text-secondary; color: @text-secondary;
} }
#workspaces button.empty:not(.hosting-monitor) { #workspaces button.active:not(.hosting-monitor) {
color: alpha(@text-secondary, 0.1); text-shadow: 0px 0px 8px @accent;
}
#workspaces button.special.active {
text-shadow: 0px 0px 8px @primary;
} }
#workspaces button.active.hosting-monitor { #workspaces button.active.hosting-monitor {
@@ -91,6 +95,10 @@ window#waybar.chromium {
animation: hover 0.8s 1; animation: hover 0.8s 1;
} }
#workspaces button.empty:not(.hosting-monitor):not(.special) {
color: alpha(@text-secondary, 0.45);
}
#workspaces button.urgent { #workspaces button.urgent {
color: @attention; color: @attention;
font-weight: 700; font-weight: 700;
@@ -105,7 +113,7 @@ window#waybar.chromium {
text-shadow: 0px -2px 3px @text-primary; text-shadow: 0px -2px 3px @text-primary;
} }
#workspaces button:not(.hosting-monitor):not(.empty) { #workspaces button:not(.hosting-monitor):not(.empty):not(.special) {
color: alpha(@accent, 0.2); color: alpha(@accent, 0.2);
} }
@@ -119,18 +127,13 @@ window#waybar.chromium {
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
SIDE PANEL GROUPS SIDE PANEL GROUPS
-------------------------------------------------------------------------- */ -------------------------------------------------------------------------- */
#mpd, #mpris, .modules-center, .modules-right { #mpd, #mpris, #workspaces, .modules-right {
/* Layout & Box Model */ /* Layout & Box Model */
border: 1px solid @border-color; border: 1px solid @border-color;
border-radius: 15px; border-radius: 15px;
/* Colors */ /* Colors */
background-color: @bg-panel; background-color: @bg-panel;
/* color: @text-primary; */
/* Effects & Transitions */
/* transition-property: background-color; */
/* transition-duration: 0.5s; */
} }
.modules-left { .modules-left {
@@ -269,7 +272,7 @@ window#waybar.chromium {
-------------------------------------------------------------------------- */ -------------------------------------------------------------------------- */
#window, #window,
#workspaces { #workspaces {
margin: 0 0px; margin: 0 2.5px;
} }
.modules-left > widget:first-child > #workspaces { .modules-left > widget:first-child > #workspaces {