Compare commits
2 Commits
ee6855f2ce
...
9c3f47615b
| Author | SHA1 | Date | |
|---|---|---|---|
| 9c3f47615b | |||
| a95cd6feed |
@ -5,43 +5,7 @@
|
|||||||
# See https://wiki.hypr.land/Configuring/Monitors/
|
# See https://wiki.hypr.land/Configuring/Monitors/
|
||||||
monitor=,preferred,auto,auto
|
monitor=,preferred,auto,auto
|
||||||
source = ./monitors.conf
|
source = ./monitors.conf
|
||||||
# monitor = DP-2, 2560x1440@165, 0x0, 1
|
source = ./workspaces.conf
|
||||||
# monitor = DP-1, 2560x1440@165, 2560x0, 1
|
|
||||||
# monitor = HDMI-A-2, 1920x1080@60, 5120x-360, 1, transform, 3
|
|
||||||
|
|
||||||
workspace = 1, monitor:DP-1, persistent:true, default:true
|
|
||||||
workspace = 4, monitor:DP-1, persistent:true
|
|
||||||
workspace = 7, monitor:DP-1, persistent:true
|
|
||||||
workspace = 10, monitor:DP-1, persistent:true
|
|
||||||
workspace = 13, monitor:DP-1, persistent:true
|
|
||||||
workspace = 16, monitor:DP-1, persistent:true
|
|
||||||
workspace = 19, monitor:DP-1, persistent:true
|
|
||||||
workspace = 22, monitor:DP-1, persistent:true
|
|
||||||
workspace = 25, monitor:DP-1, persistent:true
|
|
||||||
workspace = 28, monitor:DP-1, persistent:true
|
|
||||||
|
|
||||||
workspace = 2, monitor:HDMI-A-2, persistent:true, default:true
|
|
||||||
workspace = 5, monitor:HDMI-A-2, persistent:true
|
|
||||||
workspace = 8, monitor:HDMI-A-2, persistent:true
|
|
||||||
workspace = 11, monitor:HDMI-A-2, persistent:true
|
|
||||||
workspace = 14, monitor:HDMI-A-2, persistent:true
|
|
||||||
workspace = 17, monitor:HDMI-A-2, persistent:true
|
|
||||||
workspace = 20, monitor:HDMI-A-2, persistent:true
|
|
||||||
workspace = 23, monitor:HDMI-A-2, persistent:true
|
|
||||||
workspace = 26, monitor:HDMI-A-2, persistent:true
|
|
||||||
workspace = 29, monitor:HDMI-A-2, persistent:true
|
|
||||||
|
|
||||||
workspace = 3, monitor:DP-2, persistent:true, default:true
|
|
||||||
workspace = 6, monitor:DP-2, persistent:true
|
|
||||||
workspace = 9, monitor:DP-2, persistent:true
|
|
||||||
workspace = 12, monitor:DP-2, persistent:true
|
|
||||||
workspace = 15, monitor:DP-2, persistent:true
|
|
||||||
workspace = 18, monitor:DP-2, persistent:true
|
|
||||||
workspace = 21, monitor:DP-2, persistent:true
|
|
||||||
workspace = 24, monitor:DP-2, persistent:true
|
|
||||||
workspace = 27, monitor:DP-2, persistent:true
|
|
||||||
workspace = 30, monitor:DP-2, persistent:true
|
|
||||||
|
|
||||||
|
|
||||||
###################
|
###################
|
||||||
### MY PROGRAMS ###
|
### MY PROGRAMS ###
|
||||||
@ -49,7 +13,6 @@ workspace = 30, monitor:DP-2, persistent:true
|
|||||||
|
|
||||||
# See https://wiki.hypr.land/Configuring/Keywords/
|
# See https://wiki.hypr.land/Configuring/Keywords/
|
||||||
|
|
||||||
# Set programs that you use
|
|
||||||
$terminal = ghostty
|
$terminal = ghostty
|
||||||
$fileManager = thunar
|
$fileManager = thunar
|
||||||
$menu = wofi --show drun
|
$menu = wofi --show drun
|
||||||
@ -171,7 +134,6 @@ layerrule = ignorezero, wofi # keep blur even on near-opaque colors
|
|||||||
layerrule = dimaround, wofi # optional: dim background behind wofi
|
layerrule = dimaround, wofi # optional: dim background behind wofi
|
||||||
layerrule = ignorealpha 0.90, wofi # target overall opacity for the layer
|
layerrule = ignorealpha 0.90, wofi # target overall opacity for the layer
|
||||||
|
|
||||||
|
|
||||||
# waybar
|
# waybar
|
||||||
layerrule = blur, waybar
|
layerrule = blur, waybar
|
||||||
layerrule = ignorealpha 0.15, waybar
|
layerrule = ignorealpha 0.15, waybar
|
||||||
@ -286,79 +248,6 @@ bind = $mainMod, right, movefocus, r
|
|||||||
bind = $mainMod, up, movefocus, u
|
bind = $mainMod, up, movefocus, u
|
||||||
bind = $mainMod, down, movefocus, d
|
bind = $mainMod, down, movefocus, d
|
||||||
|
|
||||||
# Switch workspaces with mainMod + [0-9]
|
|
||||||
# -------- PAGE 1 → 1-2-3
|
|
||||||
bind = SUPER, 1, exec, hyprctl --batch " \
|
|
||||||
dispatch focusmonitor DP-1; dispatch workspace 1; \
|
|
||||||
dispatch focusmonitor DP-2; dispatch workspace 2; \
|
|
||||||
dispatch focusmonitor HDMI-A-2; dispatch workspace 3; \
|
|
||||||
dispatch focusmonitor DP-1"
|
|
||||||
|
|
||||||
bind = SUPER, 2, exec, hyprctl --batch " \
|
|
||||||
dispatch focusmonitor DP-1; dispatch workspace 4; \
|
|
||||||
dispatch focusmonitor DP-2; dispatch workspace 5; \
|
|
||||||
dispatch focusmonitor HDMI-A-2; dispatch workspace 6; \
|
|
||||||
dispatch focusmonitor DP-1"
|
|
||||||
|
|
||||||
bind = SUPER, 3, exec, hyprctl --batch " \
|
|
||||||
dispatch focusmonitor DP-1; dispatch workspace 7; \
|
|
||||||
dispatch focusmonitor DP-2; dispatch workspace 8; \
|
|
||||||
dispatch focusmonitor HDMI-A-2; dispatch workspace 9; \
|
|
||||||
dispatch focusmonitor DP-1"
|
|
||||||
|
|
||||||
bind = SUPER, 4, exec, hyprctl --batch " \
|
|
||||||
dispatch focusmonitor DP-1; dispatch workspace 10; \
|
|
||||||
dispatch focusmonitor DP-2; dispatch workspace 11; \
|
|
||||||
dispatch focusmonitor HDMI-A-2; dispatch workspace 12; \
|
|
||||||
dispatch focusmonitor DP-1"
|
|
||||||
|
|
||||||
bind = SUPER, 5, exec, hyprctl --batch " \
|
|
||||||
dispatch focusmonitor DP-1; dispatch workspace 13; \
|
|
||||||
dispatch focusmonitor DP-2; dispatch workspace 14; \
|
|
||||||
dispatch focusmonitor HDMI-A-2; dispatch workspace 15; \
|
|
||||||
dispatch focusmonitor DP-1"
|
|
||||||
|
|
||||||
bind = SUPER, 6, exec, hyprctl --batch " \
|
|
||||||
dispatch focusmonitor DP-1; dispatch workspace 16; \
|
|
||||||
dispatch focusmonitor DP-2; dispatch workspace 17; \
|
|
||||||
dispatch focusmonitor HDMI-A-2; dispatch workspace 18; \
|
|
||||||
dispatch focusmonitor DP-1"
|
|
||||||
|
|
||||||
bind = SUPER, 7, exec, hyprctl --batch " \
|
|
||||||
dispatch focusmonitor DP-1; dispatch workspace 19; \
|
|
||||||
dispatch focusmonitor DP-2; dispatch workspace 20; \
|
|
||||||
dispatch focusmonitor HDMI-A-2; dispatch workspace 21; \
|
|
||||||
dispatch focusmonitor DP-1"
|
|
||||||
|
|
||||||
bind = SUPER, 8, exec, hyprctl --batch " \
|
|
||||||
dispatch focusmonitor DP-1; dispatch workspace 22; \
|
|
||||||
dispatch focusmonitor DP-2; dispatch workspace 23; \
|
|
||||||
dispatch focusmonitor HDMI-A-2; dispatch workspace 24; \
|
|
||||||
dispatch focusmonitor DP-1"
|
|
||||||
|
|
||||||
bind = SUPER, 9, exec, hyprctl --batch " \
|
|
||||||
dispatch focusmonitor DP-1; dispatch workspace 25; \
|
|
||||||
dispatch focusmonitor DP-2; dispatch workspace 26; \
|
|
||||||
dispatch focusmonitor HDMI-A-2; dispatch workspace 27; \
|
|
||||||
dispatch focusmonitor DP-1"
|
|
||||||
|
|
||||||
bind = SUPER, 0, exec, hyprctl --batch " \
|
|
||||||
dispatch focusmonitor DP-1; dispatch workspace 28; \
|
|
||||||
dispatch focusmonitor DP-2; dispatch workspace 29; \
|
|
||||||
dispatch focusmonitor HDMI-A-2; dispatch workspace 30; \
|
|
||||||
dispatch focusmonitor DP-1"
|
|
||||||
|
|
||||||
bind = $mainMod SHIFT, 1, movetoworkspace, 1
|
|
||||||
bind = $mainMod SHIFT, 2, movetoworkspace, 4
|
|
||||||
bind = $mainMod SHIFT, 3, movetoworkspace, 7
|
|
||||||
bind = $mainMod SHIFT, 4, movetoworkspace, 10
|
|
||||||
bind = $mainMod SHIFT, 5, movetoworkspace, 13
|
|
||||||
bind = $mainMod SHIFT, 6, movetoworkspace, 16
|
|
||||||
bind = $mainMod SHIFT, 7, movetoworkspace, 19
|
|
||||||
bind = $mainMod SHIFT, 8, movetoworkspace, 22
|
|
||||||
bind = $mainMod SHIFT, 9, movetoworkspace, 25
|
|
||||||
bind = $mainMod SHIFT, 0, movetoworkspace, 28
|
|
||||||
|
|
||||||
bind = $mainMod SHIFT, left, movewindow, l
|
bind = $mainMod SHIFT, left, movewindow, l
|
||||||
bind = $mainMod SHIFT, right, movewindow, r
|
bind = $mainMod SHIFT, right, movewindow, r
|
||||||
bind = $mainMod SHIFT, up, movewindow, u
|
bind = $mainMod SHIFT, up, movewindow, u
|
||||||
@ -393,6 +282,7 @@ bind = CTRL ALT, Up, exec, playerctl --player=spotify volume 0.05+
|
|||||||
bind = CTRL ALT, Down, exec, playerctl --player=spotify volume 0.05-
|
bind = CTRL ALT, Down, exec, playerctl --player=spotify volume 0.05-
|
||||||
|
|
||||||
bind = ,F7,pass,class:^(discord)$
|
bind = ,F7,pass,class:^(discord)$
|
||||||
|
bind = ,F8,pass,class:^(discord)$
|
||||||
|
|
||||||
# Printscreen
|
# Printscreen
|
||||||
# Screenshot a selected region (interactive)
|
# Screenshot a selected region (interactive)
|
||||||
@ -400,7 +290,7 @@ bind = ,F7,pass,class:^(discord)$
|
|||||||
bind = , Print, exec, hyprshot -zm region
|
bind = , Print, exec, hyprshot -zm region
|
||||||
|
|
||||||
##############################
|
##############################
|
||||||
### WINDOWS AND WORKSPACES ###
|
### WINDOWRULES ###
|
||||||
##############################
|
##############################
|
||||||
|
|
||||||
# See https://wiki.hypr.land/Configuring/Window-Rules/ for more
|
# See https://wiki.hypr.land/Configuring/Window-Rules/ for more
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
# Generated by nwg-displays on 2025-09-07 at 18:49:18. Do not edit manually.
|
# Generated by nwg-displays on 2025-09-09 at 19:00:43. Do not edit manually.
|
||||||
|
|
||||||
monitor=DP-1,2560x1440@165.0,6626x876,1.0
|
monitor=DP-1,2560x1440@165.0,6626x876,1.0
|
||||||
monitor=DP-2,2560x1440@165.0,4066x876,1.0
|
monitor=DP-2,2560x1440@165.0,4066x876,1.0
|
||||||
monitor=HDMI-A-1,3840x2160@60.0,226x156,1.0
|
monitor=HDMI-A-1,0x0@60.0,-1x-1,1.0
|
||||||
monitor=HDMI-A-1,disable
|
monitor=HDMI-A-1,disable
|
||||||
monitor=HDMI-A-2,1920x1080@60.0,9186x396,1.0
|
monitor=HDMI-A-2,1920x1080@60.0,9186x396,1.0
|
||||||
monitor=HDMI-A-2,transform,3
|
monitor=HDMI-A-2,transform,3
|
||||||
|
|||||||
@ -0,0 +1,34 @@
|
|||||||
|
$mainMod = SUPER # Sets "Super" key as main modifier
|
||||||
|
|
||||||
|
workspace = 1, monitor:DP-1, persistent:true, default:true
|
||||||
|
workspace = 2, monitor:DP-1, persistent:true
|
||||||
|
workspace = 3, monitor:DP-1, persistent:true
|
||||||
|
workspace = 4, monitor:DP-2, persistent:true, default:true
|
||||||
|
workspace = 5, monitor:DP-2, persistent:true
|
||||||
|
workspace = 6, monitor:DP-2, persistent:true
|
||||||
|
workspace = 7, monitor:HDMI-A-2, persistent:true, default:true
|
||||||
|
workspace = 8, monitor:HDMI-A-2, persistent:true
|
||||||
|
workspace = 9, monitor:HDMI-A-2, persistent:true
|
||||||
|
workspace = 10, monitor:HDMI-A-1, persistent:true, default:true
|
||||||
|
|
||||||
|
bind = $mainMod, 1, exec, hyprctl --batch "dispatch focusmonitor DP-1; dispatch workspace 1;"
|
||||||
|
bind = $mainMod, 2, exec, hyprctl --batch "dispatch focusmonitor DP-1; dispatch workspace 2;"
|
||||||
|
bind = $mainMod, 3, exec, hyprctl --batch "dispatch focusmonitor DP-1; dispatch workspace 3;"
|
||||||
|
bind = $mainMod, 4, exec, hyprctl --batch "dispatch focusmonitor DP-2; dispatch workspace 4;"
|
||||||
|
bind = $mainMod, 5, exec, hyprctl --batch "dispatch focusmonitor DP-2; dispatch workspace 5;"
|
||||||
|
bind = $mainMod, 6, exec, hyprctl --batch "dispatch focusmonitor DP-2; dispatch workspace 6;"
|
||||||
|
bind = $mainMod, 7, exec, hyprctl --batch "dispatch focusmonitor HDMI-A-2; dispatch workspace 7;"
|
||||||
|
bind = $mainMod, 8, exec, hyprctl --batch "dispatch focusmonitor HDMI-A-2; dispatch workspace 8;"
|
||||||
|
bind = $mainMod, 9, exec, hyprctl --batch "dispatch focusmonitor HDMI-A-2; dispatch workspace 9;"
|
||||||
|
bind = $mainMod, 0, exec, hyprctl --batch "dispatch focusmonitor HDMI-A-1; dispatch workspace 10;"
|
||||||
|
|
||||||
|
bind = $mainMod SHIFT, 1, movetoworkspacesilent, 1
|
||||||
|
bind = $mainMod SHIFT, 2, movetoworkspacesilent, 2
|
||||||
|
bind = $mainMod SHIFT, 3, movetoworkspacesilent, 3
|
||||||
|
bind = $mainMod SHIFT, 4, movetoworkspacesilent, 4
|
||||||
|
bind = $mainMod SHIFT, 5, movetoworkspacesilent, 5
|
||||||
|
bind = $mainMod SHIFT, 6, movetoworkspacesilent, 6
|
||||||
|
bind = $mainMod SHIFT, 7, movetoworkspacesilent, 7
|
||||||
|
bind = $mainMod SHIFT, 8, movetoworkspacesilent, 8
|
||||||
|
bind = $mainMod SHIFT, 9, movetoworkspacesilent, 9
|
||||||
|
bind = $mainMod SHIFT, 0, movetoworkspacesilent, 10
|
||||||
|
|||||||
@ -9,63 +9,45 @@
|
|||||||
"margin-bottom": 0,
|
"margin-bottom": 0,
|
||||||
|
|
||||||
/* order: 1-2-3 | window-title | tray + clock */
|
/* order: 1-2-3 | window-title | tray + clock */
|
||||||
"modules-left": [ "custom/page1", "custom/page2", "custom/page3", "custom/page4","custom/page5","custom/page6","custom/page7","custom/page8","custom/page9","custom/page10"],
|
// "modules-left": [ "custom/group1", "custom/group2", "custom/group3", "custom/group4","custom/group5","custom/group6","custom/group7","custom/group8","custom/group9","custom/group10"],
|
||||||
|
"modules-left": ["hyprland/workspaces"],
|
||||||
"modules-center": [ "hyprland/window" ],
|
"modules-center": [ "hyprland/window" ],
|
||||||
"modules-right": [ "tray", "custom/separator", "network", "bluetooth", "custom/separator", "disk", "cpu", "memory", "pulseaudio", "custom/separator", "clock"],
|
"modules-right": [ "tray", "custom/separator", "network", "bluetooth", "custom/separator", "disk", "cpu", "memory", "pulseaudio", "custom/separator", "clock"],
|
||||||
|
|
||||||
"custom/page1": {
|
|
||||||
"exec": "~/.config/waybar/scripts/page.sh 1",
|
"hyprland/workspaces": {
|
||||||
"exec-persistent": true,
|
"disable-scroll": true,
|
||||||
"return-type": "json"
|
"all-outputs": true,
|
||||||
|
"warp-on-scroll": false,
|
||||||
|
"format": "{icon}",
|
||||||
|
"format-icons": {
|
||||||
|
"1": "1",
|
||||||
|
"2": "2",
|
||||||
|
"3": "3",
|
||||||
|
"4": "4",
|
||||||
|
"5": "5",
|
||||||
|
"6": "6",
|
||||||
|
"7": "7",
|
||||||
|
"8": "8",
|
||||||
|
"9": "9",
|
||||||
|
"10": "0"
|
||||||
},
|
},
|
||||||
"custom/page2": {
|
"persistent-workspaces": {
|
||||||
"exec": "~/.config/waybar/scripts/page.sh 2",
|
"1": [],
|
||||||
"exec-persistent": true,
|
"2": [],
|
||||||
"return-type": "json"
|
"3": [],
|
||||||
},
|
"4": [],
|
||||||
"custom/page3": {
|
"5": [],
|
||||||
"exec": "~/.config/waybar/scripts/page.sh 3",
|
"6": [],
|
||||||
"exec-persistent": true,
|
"7": [],
|
||||||
"return-type": "json"
|
"8": [],
|
||||||
},
|
"9": [],
|
||||||
"custom/page4": {
|
"10": []
|
||||||
"exec": "~/.config/waybar/scripts/page.sh 4",
|
}
|
||||||
"exec-persistent": true,
|
|
||||||
"return-type": "json"
|
|
||||||
},
|
|
||||||
"custom/page5": {
|
|
||||||
"exec": "~/.config/waybar/scripts/page.sh 5",
|
|
||||||
"exec-persistent": true,
|
|
||||||
"return-type": "json"
|
|
||||||
},
|
|
||||||
"custom/page6": {
|
|
||||||
"exec": "~/.config/waybar/scripts/page.sh 6",
|
|
||||||
"exec-persistent": true,
|
|
||||||
"return-type": "json"
|
|
||||||
},
|
|
||||||
"custom/page7": {
|
|
||||||
"exec": "~/.config/waybar/scripts/page.sh 7",
|
|
||||||
"exec-persistent": true,
|
|
||||||
"return-type": "json"
|
|
||||||
},
|
|
||||||
"custom/page8": {
|
|
||||||
"exec": "~/.config/waybar/scripts/page.sh 8",
|
|
||||||
"exec-persistent": true,
|
|
||||||
"return-type": "json"
|
|
||||||
},
|
|
||||||
"custom/page9": {
|
|
||||||
"exec": "~/.config/waybar/scripts/page.sh 9",
|
|
||||||
"exec-persistent": true,
|
|
||||||
"return-type": "json"
|
|
||||||
},
|
|
||||||
"custom/page10": {
|
|
||||||
"exec": "~/.config/waybar/scripts/page.sh 10",
|
|
||||||
"exec-persistent": true,
|
|
||||||
"return-type": "json"
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
"hyprland/window": { "format": "{title}", "max-length": 60 },
|
"hyprland/window": { "format": "{title}", "max-length": 60 },
|
||||||
// "tray": { "icon-size": 16, "spacing": 6 },
|
|
||||||
"tray": { "icon-size": 16, "spacing": 10 },
|
"tray": { "icon-size": 16, "spacing": 10 },
|
||||||
|
|
||||||
"pulseaudio": {
|
"pulseaudio": {
|
||||||
|
|||||||
40
roles/hyprland/files/waybar/scripts/groups.sh
Executable file
40
roles/hyprland/files/waybar/scripts/groups.sh
Executable file
@ -0,0 +1,40 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
current=$(hyprctl activeworkspace -j | jq -r '.id')
|
||||||
|
|
||||||
|
if [ "$1" = "click" ]; then
|
||||||
|
group=$2
|
||||||
|
start=$(( (group - 1) * 3 + 1 ))
|
||||||
|
|
||||||
|
hyprctl --batch " \
|
||||||
|
dispatch focusmonitor DP-1; dispatch workspace $start; \
|
||||||
|
dispatch focusmonitor DP-2; dispatch workspace $((start+1)); \
|
||||||
|
dispatch focusmonitor HDMI-A-2; dispatch workspace $((start+2)); \
|
||||||
|
dispatch focusmonitor DP-1"
|
||||||
|
|
||||||
|
else
|
||||||
|
# Display button state
|
||||||
|
group=$1
|
||||||
|
start=$(( (group - 1) * 3 + 1 ))
|
||||||
|
end=$(( start + 2 ))
|
||||||
|
case $group in
|
||||||
|
1) range="1-3"; icon="" ;;
|
||||||
|
2) range="4-6"; icon="" ;;
|
||||||
|
3) range="7-9"; icon="" ;;
|
||||||
|
4) range="10-12"; icon="" ;;
|
||||||
|
5) range="13-15"; icon="" ;;
|
||||||
|
6) range="16-18"; icon="" ;;
|
||||||
|
7) range="19-21"; icon="" ;;
|
||||||
|
8) range="22-24"; icon="" ;;
|
||||||
|
9) range="25-27"; icon="" ;;
|
||||||
|
10) range="28-30"; icon="" ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ $current -ge $start ] && [ $current -le $end ]; then
|
||||||
|
# Active group - return with active class
|
||||||
|
echo "{\"text\": \"$icon\", \"class\": \"active\"}"
|
||||||
|
else
|
||||||
|
# Inactive group
|
||||||
|
echo "{\"text\": \"$icon\", \"class\": \"inactive\"}"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
@ -1,150 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
# page.sh 1‒10 – Waybar “page” indicator
|
|
||||||
# deps: socat, awk, sed, grep
|
|
||||||
|
|
||||||
page=$1
|
|
||||||
icons=( "" "" "" "" "" "" "" "" "" "" "" )
|
|
||||||
|
|
||||||
to_page() {
|
|
||||||
(( $1 <= 3 )) && echo 1 && return
|
|
||||||
(( $1 <= 6 )) && echo 2 && return
|
|
||||||
(( $1 <= 9 )) && echo 3 && return
|
|
||||||
(( $1 <= 12 )) && echo 4 && return
|
|
||||||
(( $1 <= 15 )) && echo 5 && return
|
|
||||||
(( $1 <= 18 )) && echo 6 && return
|
|
||||||
(( $1 <= 21 )) && echo 7 && return
|
|
||||||
(( $1 <= 24 )) && echo 8 && return
|
|
||||||
(( $1 <= 27 )) && echo 9 && return
|
|
||||||
echo 10
|
|
||||||
}
|
|
||||||
|
|
||||||
# Return 0 if THIS page has at least one window, else 1
|
|
||||||
is_occupied() {
|
|
||||||
# Get workspace id + windows count pairs from JSON
|
|
||||||
# Example snippets: {"id":1,"windows":3, ...}
|
|
||||||
while read -r id windows; do
|
|
||||||
(( $(to_page "$id") == page )) && (( windows > 0 )) && return 0
|
|
||||||
done < <(
|
|
||||||
hyprctl -j workspaces \
|
|
||||||
| grep -o '"id":[0-9]\+|"windows":[0-9]\+' \
|
|
||||||
| sed -n 'N;s/"id":\([0-9]\+\)\n"windows":\([0-9]\+\)/\1 \2/p'
|
|
||||||
)
|
|
||||||
return 1
|
|
||||||
}
|
|
||||||
|
|
||||||
emit() {
|
|
||||||
local classes=()
|
|
||||||
if (( $1 == page )); then
|
|
||||||
classes+=(active)
|
|
||||||
else
|
|
||||||
is_occupied && classes+=(occupied)
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ((${#classes[@]})); then
|
|
||||||
printf '{"text":"%s","class":"%s"}\n' \
|
|
||||||
"${icons[page]}" "$(IFS=' '; echo "${classes[*]}")"
|
|
||||||
else
|
|
||||||
printf '{"text":"%s"}\n' "${icons[page]}"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Initial state
|
|
||||||
active_ws=$(hyprctl activeworkspace | awk '/^ID /{print $2}')
|
|
||||||
current_page=$(to_page "${active_ws:-1}")
|
|
||||||
emit "$current_page"
|
|
||||||
current_occ=$(is_occupied && echo 1 || echo 0)
|
|
||||||
|
|
||||||
# Live updates
|
|
||||||
socket="$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock"
|
|
||||||
socat -U - UNIX-CONNECT:"$socket" | while read -r line; do
|
|
||||||
[[ $line =~ ^(workspace|openwindow|closewindow|movewindow) ]] || continue
|
|
||||||
if [[ $line == workspace* ]]; then
|
|
||||||
ws=${line#*>>}; ws=${ws%% *}
|
|
||||||
new_page=$(to_page "$ws")
|
|
||||||
else
|
|
||||||
new_page=$current_page
|
|
||||||
fi
|
|
||||||
new_occ=$(is_occupied && echo 1 || echo 0)
|
|
||||||
if (( new_page != current_page || new_occ != current_occ )); then
|
|
||||||
emit "$new_page"
|
|
||||||
current_page=$new_page
|
|
||||||
current_occ=$new_occ
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
|
|
||||||
# # page.sh 1‒10 – Waybar “page” indicator
|
|
||||||
# # deps: socat, awk • (still no jq)
|
|
||||||
#
|
|
||||||
# page=$1 # this script instance’s page (1‒10)
|
|
||||||
#
|
|
||||||
# # ── icon lookup table ────────────────────────────────────────────
|
|
||||||
# icons=( "" "" "" "" "" "" "" "" "" "" "" )
|
|
||||||
#
|
|
||||||
# # map numeric workspace → page (1‒10)
|
|
||||||
# to_page() {
|
|
||||||
# (( $1 <= 3 )) && echo 1 && return
|
|
||||||
# (( $1 <= 6 )) && echo 2 && return
|
|
||||||
# (( $1 <= 9 )) && echo 3 && return
|
|
||||||
# (( $1 <= 12 )) && echo 4 && return
|
|
||||||
# (( $1 <= 15 )) && echo 5 && return
|
|
||||||
# (( $1 <= 18 )) && echo 6 && return
|
|
||||||
# (( $1 <= 21 )) && echo 7 && return
|
|
||||||
# (( $1 <= 24 )) && echo 8 && return
|
|
||||||
# (( $1 <= 27 )) && echo 9 && return
|
|
||||||
# echo 10
|
|
||||||
# }
|
|
||||||
#
|
|
||||||
# # does THIS page contain at least one window?
|
|
||||||
# is_occupied() {
|
|
||||||
# while read -r ws_id; do
|
|
||||||
# (( $(to_page "$ws_id") == page )) && return 0
|
|
||||||
# done < <(hyprctl clients | awk '/workspace:/ {print $2}')
|
|
||||||
# return 1
|
|
||||||
# }
|
|
||||||
#
|
|
||||||
# emit() {
|
|
||||||
# local classes=()
|
|
||||||
#
|
|
||||||
# if (( $1 == page )); then # ← is THIS instance the active page?
|
|
||||||
# classes+=(active) # yes → mark it only “active”
|
|
||||||
# else
|
|
||||||
# is_occupied && classes+=(occupied) # no → maybe “occupied”
|
|
||||||
# fi
|
|
||||||
#
|
|
||||||
# if ((${#classes[@]})); then
|
|
||||||
# printf '{"text":"%s","class":"%s"}\n' \
|
|
||||||
# "${icons[page]}" "$(IFS=' '; echo "${classes[*]}")"
|
|
||||||
# else
|
|
||||||
# printf '{"text":"%s"}\n' "${icons[page]}"
|
|
||||||
# fi
|
|
||||||
# }
|
|
||||||
#
|
|
||||||
# # ── initial state ────────────────────────────────────────────────
|
|
||||||
# active_ws=$(hyprctl activeworkspace | awk '/^ID /{print $2}')
|
|
||||||
# current_page=$(to_page "${active_ws:-1}")
|
|
||||||
# emit "$current_page"
|
|
||||||
# current_occ=$(is_occupied && echo 1 || echo 0)
|
|
||||||
#
|
|
||||||
# # ── live updates via Hyprland socket2 ───────────────────────────
|
|
||||||
# socket="$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock"
|
|
||||||
# socat -U - UNIX-CONNECT:"$socket" | while read -r line; do
|
|
||||||
# [[ $line =~ ^(workspace|openwindow|closewindow) ]] || continue
|
|
||||||
#
|
|
||||||
# # recompute state if anything relevant changed
|
|
||||||
# if [[ $line == workspace* ]]; then
|
|
||||||
# ws=${line#*>>}; ws=${ws%% *}
|
|
||||||
# new_page=$(to_page "$ws")
|
|
||||||
# else
|
|
||||||
# new_page=$current_page
|
|
||||||
# fi
|
|
||||||
# new_occ=$(is_occupied && echo 1 || echo 0)
|
|
||||||
#
|
|
||||||
# # update Waybar only when something actually changed
|
|
||||||
# if (( new_page != current_page || new_occ != current_occ )); then
|
|
||||||
# emit "$new_page"
|
|
||||||
# current_page=$new_page
|
|
||||||
# current_occ=$new_occ
|
|
||||||
# fi
|
|
||||||
# done
|
|
||||||
#
|
|
||||||
@ -1,25 +1,23 @@
|
|||||||
/* ==== Waybar GTK CSS: Cosmic glass (v2 lighter) ================= */
|
|
||||||
|
|
||||||
/* Palette */
|
/* Palette */
|
||||||
@define-color glass rgba(12, 14, 20, 0.34); /* was 0.62 → much more transparent */
|
@define-color glass rgba(12, 14, 20, 0.34);
|
||||||
@define-color glass_strong rgba(12, 14, 20, 0.46); /* chips / active */
|
@define-color glass_strong rgba(12, 14, 20, 0.46);
|
||||||
@define-color fg #DDE1EA;
|
@define-color fg #DDE1EA;
|
||||||
@define-color fg_dim #B8BECC;
|
@define-color fg_dim #B8BECC;
|
||||||
@define-color accent1 #7F5AF0;
|
@define-color accent1 #7F5AF0;
|
||||||
@define-color accent2 #00D1FF;
|
@define-color accent2 #00D1FF;
|
||||||
|
@define-color occupied #a8557f;
|
||||||
|
|
||||||
/* Whole bar: more vertical padding, no border, stronger shadow */
|
/* Whole bar: more vertical padding, no border, stronger shadow */
|
||||||
window#waybar {
|
window#waybar {
|
||||||
background: @glass;
|
background: @glass;
|
||||||
color: @fg;
|
color: @fg;
|
||||||
border-radius: 12px;
|
border-radius: 12px;
|
||||||
margin: 6px 8px;
|
/* margin: 6px 8px; */
|
||||||
border: none; /* ← removed border */
|
border: none; /* ← removed border */
|
||||||
box-shadow: 0 10px 34px rgba(0,0,0,0.34);
|
box-shadow: 0 10px 34px rgba(0,0,0,0.34);
|
||||||
-gtk-outline-radius: 12px;
|
-gtk-outline-radius: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Global typography: Roboto Mono Nerd Font */
|
|
||||||
* {
|
* {
|
||||||
border: none;
|
border: none;
|
||||||
padding: 2px 6px;
|
padding: 2px 6px;
|
||||||
@ -45,42 +43,6 @@ window#waybar {
|
|||||||
padding: 0 4px;
|
padding: 0 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* --- PAGE BUTTONS --------------------------------------------------------- */
|
|
||||||
#custom-page1, #custom-page2, #custom-page3, #custom-page4, #custom-page5,
|
|
||||||
#custom-page6, #custom-page7, #custom-page8, #custom-page9, #custom-page10 {
|
|
||||||
background: transparent;
|
|
||||||
min-width: 18px;
|
|
||||||
padding-left: 2px;
|
|
||||||
color: @fg_dim;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Active page: glass chip, no border */
|
|
||||||
#custom-page1.active, #custom-page2.active, #custom-page3.active, #custom-page4.active,
|
|
||||||
#custom-page5.active, #custom-page6.active, #custom-page7.active, #custom-page8.active,
|
|
||||||
#custom-page9.active, #custom-page10.active {
|
|
||||||
background: @glass_strong;
|
|
||||||
border-radius: 8px;
|
|
||||||
color: @fg;
|
|
||||||
box-shadow: inset 0 0 0 9999px rgba(255,255,255,0.015);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Occupied (not active): cyan glyph */
|
|
||||||
#custom-page1.occupied:not(.active), #custom-page2.occupied:not(.active),
|
|
||||||
#custom-page3.occupied:not(.active), #custom-page4.occupied:not(.active),
|
|
||||||
#custom-page5.occupied:not(.active), #custom-page6.occupied:not(.active),
|
|
||||||
#custom-page7.occupied:not(.active), #custom-page8.occupied:not(.active),
|
|
||||||
#custom-page9.occupied:not(.active), #custom-page10.occupied:not(.active) {
|
|
||||||
color: @accent2;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Hover feedback (very light) */
|
|
||||||
#custom-page1:hover, #custom-page2:hover, #custom-page3:hover, #custom-page4:hover,
|
|
||||||
#custom-page5:hover, #custom-page6:hover, #custom-page7:hover, #custom-page8:hover,
|
|
||||||
#custom-page9:hover, #custom-page10:hover {
|
|
||||||
background: rgba(255,255,255,0.03);
|
|
||||||
border-radius: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Tray tweaks */
|
/* Tray tweaks */
|
||||||
#tray { margin-right: 0px; }
|
#tray { margin-right: 0px; }
|
||||||
#tray * { padding-left: 0px; padding-right: 0px; }
|
#tray * { padding-left: 0px; padding-right: 0px; }
|
||||||
@ -97,38 +59,42 @@ window#waybar {
|
|||||||
#tray menu menuitem { padding: 6px 12px; }
|
#tray menu menuitem { padding: 6px 12px; }
|
||||||
#tray menu menuitem:hover { background: alpha(@accent1, 0.16); }
|
#tray menu menuitem:hover { background: alpha(@accent1, 0.16); }
|
||||||
|
|
||||||
|
#workspaces button {
|
||||||
|
padding: 0 8px;
|
||||||
#custom-hyprland-workspaces {
|
|
||||||
padding: 0;
|
|
||||||
margin: 0 4px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.workspace {
|
|
||||||
/* display: inline-block; */
|
|
||||||
padding: 4px 8px;
|
|
||||||
margin: 0 2px;
|
|
||||||
border-radius: 4px;
|
|
||||||
color: #e6e6e6; /* off-white for empty workspaces */
|
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
border: 1px solid #444;
|
color: #6c7086;
|
||||||
/* cursor: pointer; */
|
border-radius: 3px;
|
||||||
transition: all 0.2s ease;
|
margin: 2px;
|
||||||
min-width: 20px;
|
transition: all 0.2s ease-in-out;
|
||||||
/* text-align: center; */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.workspace.occupied {
|
/* Hover effect */
|
||||||
color: #a855f7; /* purple for occupied workspaces */
|
#workspaces button:hover {
|
||||||
border-color: #a855f7;
|
background-color: #74c7ec;
|
||||||
|
color: #1e1e2e;
|
||||||
}
|
}
|
||||||
|
|
||||||
.workspace.focused {
|
#workspaces button:not(.active):not(.empty) {
|
||||||
background-color: rgba(168, 85, 247, 0.2); /* light purple background for focused */
|
color: #cdd6f4;
|
||||||
color: #a855f7;
|
background-color: #585b70;
|
||||||
border-color: #a855f7;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.workspace:hover {
|
/* Active/focused workspace */
|
||||||
background-color: rgba(168, 85, 247, 0.1);
|
#workspaces button.active {
|
||||||
|
color: #1e1e2e;
|
||||||
|
background-color: @occupied;
|
||||||
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#workspaces button.visible {
|
||||||
|
color: #f9e2af;
|
||||||
|
/* background-color: #45475a; */
|
||||||
|
border: 1px solid #f9e2af;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Default state for persistent workspaces */
|
||||||
|
#workspaces button {
|
||||||
|
color: #6c7086;
|
||||||
|
background-color: @glass;
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user