updated monocle bar and added wayshell framework with some modules.

This commit is contained in:
2026-06-27 17:35:39 +02:00
parent 79b45ab123
commit 66065960cf
43 changed files with 2163 additions and 97 deletions
+2
View File
@@ -4,6 +4,8 @@ animations=1
layer_animations=1 layer_animations=1
animation_type_open=zoom animation_type_open=zoom
animation_type_close=zoom animation_type_close=zoom
#layer_animation_type_open=slide
#layer_animation_type_close=slide
animation_fade_in=1 animation_fade_in=1
animation_fade_out=1 animation_fade_out=1
tag_animation_direction=1 tag_animation_direction=1
+4 -1
View File
@@ -5,4 +5,7 @@ windowrule=appid:firefox,focused_opacity:0.95,unfocused_opacity:0.85
windowrule=appid:virt-manager,focused_opacity:1,unfocused_opacity:1 windowrule=appid:virt-manager,focused_opacity:1,unfocused_opacity:1
# fix some issues with warframe not capturing mouse. # fix some issues with warframe not capturing mouse.
windowrule=appid:broken,focused_opacity:1,unfocused_opacity:1,isfullscreen:1,monitor:HDMI-A-1 windowrule=appid:broken,focused_opacity:1,unfocused_opacity:1,isfullscreen:1,monitor:HDMI-A-1
layerrule=layer_name:^dms.*,animation_type_open:fade,animation_type_close:fade
layerrule=layer_name:^waybar.*,animation_type_open:slide,animation_type_close:fade
+6 -1
View File
@@ -85,4 +85,9 @@ output_path = '~/.config/caffyne-shell/style/colors.css'
[templates.wayshell] [templates.wayshell]
input_path = '~/.config/matugen/templates/InioX/colors.css' input_path = '~/.config/matugen/templates/InioX/colors.css'
output_path = '~/.config/sdgos/wayshell/colors.css' output_path = '~/.config/sdgos/wayshell/colors.css'
[templates.wayshellbars]
input_path = '~/.config/matugen/templates/InioX/colors.css'
output_path = '~/.config/sdgos/wayshell/configs/colors.css'
+35
View File
@@ -0,0 +1,35 @@
{
"layer": "top",
"position": "bottom",
"fixed-center": "true",
"output": "DP-1",
"margin-top": 0,
"margin-bottom": 0,
"margin-left": 0,
"margin-right": 0,
"spacing": 3,
// Load Modules
"include": [
"~/.config/sdgos/monocle/modules-dp1.json"
],
"modules-left": [
"custom/daemon",
"custom/window1",
"custom/window2",
"custom/window3",
"custom/window4",
"custom/window5",
"custom/window6",
"custom/window7",
"custom/window8",
"custom/window9",
"custom/window10",
],
"modules-center": [
],
"modules-right": [
]
}
+35
View File
@@ -0,0 +1,35 @@
{
"layer": "top",
"position": "bottom",
"fixed-center": "true",
"output": "DP-3",
"margin-top": 0,
"margin-bottom": 0,
"margin-left": 0,
"margin-right": 0,
"spacing": 3,
// Load Modules
"include": [
"~/.config/sdgos/monocle/modules-dp3.json"
],
"modules-left": [
"custom/daemon",
"custom/window1",
"custom/window2",
"custom/window3",
"custom/window4",
"custom/window5",
"custom/window6",
"custom/window7",
"custom/window8",
"custom/window9",
"custom/window10",
],
"modules-center": [
],
"modules-right": [
]
}
@@ -11,7 +11,7 @@
// Load Modules // Load Modules
"include": [ "include": [
"~/.config/sdgos/monocle/modules.json" "~/.config/sdgos/monocle/modules-hdmi.json"
], ],
"modules-left": [ "modules-left": [
"custom/daemon", "custom/daemon",
+3 -2
View File
@@ -2,12 +2,13 @@
INDEX="$1" INDEX="$1"
MONITOR=$2
while [ -e ~/.config/monocle.lock ]; do while [ -e ~/.config/monocle-$MONITOR.lock ]; do
sleep 0.01 sleep 0.01
done done
WINDOWTITLE=$(cat ~/.config/monocle.state | grep -e "index:$INDEX" | cut -d'\' -f2) WINDOWTITLE=$(cat ~/.config/monocle-$MONITOR.state | grep -e "index:$INDEX" | cut -d'\' -f2)
+6 -5
View File
@@ -1,21 +1,22 @@
#!/bin/bash #!/bin/bash
ACTIVEMON=$2
INDEX="$1" INDEX="$1"
while [ -e ~/.config/monocle.lock ]; do while [ -e ~/.config/monocle-$ACTIVEMON.lock ]; do
sleep 0.01 sleep 0.01
echo "sleeping" echo "sleeping"
done done
ACTIVEMON=$(mmsg get all-monitors | jq '.monitors[] | select(.active == true) | .name' -r)
echo "activemon is $ACTIVEMON" echo "activemon is $ACTIVEMON"
ACTIVETAG=$(mmsg get tags $ACTIVEMON | jq '.tags[] | select(.is_active == true) | .index' -r) ACTIVETAG=$(mmsg get tags $ACTIVEMON | jq '.tags[] | select(.is_active == true) | .index' -r)
echo "activetag is $ACTIVETAG" echo "activetag is $ACTIVETAG"
WINDOWID=$(cat ~/.config/monocle.state | grep -e "index:$INDEX" | cut -d'\' -f3) WINDOWID=$(cat ~/.config/monocle-$ACTIVEMON.state | grep -e "index:$INDEX" | cut -d'\' -f3)
WINDOWtitle=$(cat ~/.config/monocle.state | grep -e "index:$INDEX" | cut -d'\' -f2) WINDOWtitle=$(cat ~/.config/monocle-$ACTIVEMON.state | grep -e "index:$INDEX" | cut -d'\' -f2)
echo "moving window $WINDOWID" echo "moving window $WINDOWID"
mmsg dispatch zoom client,$WINDOWID mmsg dispatch focusid client,$WINDOWID
+6 -6
View File
@@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
MONITOR=HDMI-A-1 MONITOR=$1
# get all clients on that monitor: mmsg get all-clients | jq '.clients[] | select( .monitor == "HDMI-A-1") | .id' -r # get all clients on that monitor: mmsg get all-clients | jq '.clients[] | select( .monitor == "HDMI-A-1") | .id' -r
@@ -10,26 +10,26 @@ ACTIVEMON=$(mmsg get all-monitors | jq '.monitors[] | select(.active == true) |
#echo "activemon is $ACTIVEMON" #echo "activemon is $ACTIVEMON"
ACTIVETAG=$(mmsg get tags $MONITOR | jq '.tags[] | select(.is_active == true) | .index' -r) ACTIVETAG=$(mmsg get tags $MONITOR | jq '.tags[] | select(.is_active == true) | .index' -r)
#echo "activetag is $ACTIVETAG" #echo "activetag is $ACTIVETAG"
ACTIVEWINDOWS=$(mmsg get all-clients | jq -r --arg ACTIVETAG "$ACTIVETAG" --arg ACTIVEMON "$MONOCLEMON" '.clients[] | select(.tags[] == ($ACTIVETAG | tonumber) and .monitor == $ACTIVEMON) | .id' | sort) ACTIVEWINDOWS=$(mmsg get all-clients | jq -r --arg ACTIVETAG "$ACTIVETAG" --arg ACTIVEMON "$MONITOR" '.clients[] | select(.tags[] == ($ACTIVETAG | tonumber) and .monitor == $ACTIVEMON) | .id' | sort)
#echo "active windows are:" #echo "active windows are:"
#echo "----------------------------------------" #echo "----------------------------------------"
#echo "$ACTIVEWINDOWS" #echo "$ACTIVEWINDOWS"
#echo "----------------------------------------" #echo "----------------------------------------"
echo "lock" > ~/.config/monocle.lock echo "lock" > ~/.config/monocle-$MONITOR.lock
sleep 0.05 sleep 0.05
INDEX=0 INDEX=0
echo "" > ~/.config/monocle.state echo "" > ~/.config/monocle-$MONITOR.state
while read LINE; do while read LINE; do
ID=$LINE ID=$LINE
TITLE=$(mmsg get all-clients | jq -r --arg ID "$LINE" '.clients[] | select(.id == ($ID | tonumber)) | .title' ) TITLE=$(mmsg get all-clients | jq -r --arg ID "$LINE" '.clients[] | select(.id == ($ID | tonumber)) | .title' )
INDEX=$((INDEX+1)) INDEX=$((INDEX+1))
echo "index:$INDEX \ $TITLE \ $ID" >> ~/.config/monocle.state echo "index:$INDEX \ $TITLE \ $ID" >> ~/.config/monocle-$MONITOR.state
done <<< "$ACTIVEWINDOWS" done <<< "$ACTIVEWINDOWS"
sleep 0.05 sleep 0.05
rm ~/.config/monocle.lock rm ~/.config/monocle-$MONITOR.lock
echo "(running)" echo "(running)"
@@ -7,8 +7,8 @@
"tooltip": true, "tooltip": true,
"format":"{text}", "format":"{text}",
"tooltip-format": "daemon is running, click to refresh", "tooltip-format": "daemon is running, click to refresh",
"on-click": "~/.config/sdgos/monocle/indexer.sh", "on-click": "~/.config/sdgos/monocle/indexer.sh DP-1",
"exec": "~/.config/sdgos/monocle/indexer.sh", "exec": "~/.config/sdgos/monocle/indexer.sh DP-1",
"max-length": 20, "max-length": 20,
"interval": 1 "interval": 1
@@ -18,8 +18,8 @@
"tooltip": true, "tooltip": true,
"format":"{text}", "format":"{text}",
"tooltip-format": "window 1: {text}", "tooltip-format": "window 1: {text}",
"on-click": "~/.config/sdgos/monocle/focuswindow.sh 1", "on-click": "~/.config/sdgos/monocle/focuswindow.sh 1 DP-1",
"exec": "~/.config/sdgos/monocle/fetchwindow.sh 1", "exec": "~/.config/sdgos/monocle/fetchwindow.sh 1 DP-1",
"max-length": 20, "max-length": 20,
"interval": 1.5 "interval": 1.5
@@ -28,8 +28,8 @@
"tooltip": true, "tooltip": true,
"format":"{text}", "format":"{text}",
"tooltip-format": "window 2: {text}", "tooltip-format": "window 2: {text}",
"on-click": "~/.config/sdgos/monocle/focuswindow.sh 2", "on-click": "~/.config/sdgos/monocle/focuswindow.sh 2 DP-1",
"exec": "~/.config/sdgos/monocle/fetchwindow.sh 2", "exec": "~/.config/sdgos/monocle/fetchwindow.sh 2 DP-1",
"max-length": 20, "max-length": 20,
"interval": 1.5 "interval": 1.5
@@ -39,8 +39,8 @@
"tooltip": true, "tooltip": true,
"format":"{text}", "format":"{text}",
"tooltip-format": "window 3: {text}", "tooltip-format": "window 3: {text}",
"on-click": "~/.config/sdgos/monocle/focuswindow.sh 3", "on-click": "~/.config/sdgos/monocle/focuswindow.sh 3 DP-1",
"exec": "~/.config/sdgos/monocle/fetchwindow.sh 3", "exec": "~/.config/sdgos/monocle/fetchwindow.sh 3 DP-1",
"max-length": 20, "max-length": 20,
"interval": 1.5 "interval": 1.5
@@ -50,8 +50,8 @@
"tooltip": true, "tooltip": true,
"format":"{text}", "format":"{text}",
"tooltip-format": "window 4: {text}", "tooltip-format": "window 4: {text}",
"on-click": "~/.config/sdgos/monocle/focuswindow.sh 4", "on-click": "~/.config/sdgos/monocle/focuswindow.sh 4 DP-1",
"exec": "~/.config/sdgos/monocle/fetchwindow.sh 4", "exec": "~/.config/sdgos/monocle/fetchwindow.sh 4 DP-1",
"max-length": 20, "max-length": 20,
"interval": 1.5 "interval": 1.5
@@ -61,8 +61,8 @@
"tooltip": true, "tooltip": true,
"format":"{text}", "format":"{text}",
"tooltip-format": "window 5: {text}", "tooltip-format": "window 5: {text}",
"on-click": "~/.config/sdgos/monocle/focuswindow.sh 5", "on-click": "~/.config/sdgos/monocle/focuswindow.sh 5 DP-1",
"exec": "~/.config/sdgos/monocle/fetchwindow.sh 5", "exec": "~/.config/sdgos/monocle/fetchwindow.sh 5 DP-1",
"max-length": 20, "max-length": 20,
"interval": 1.5 "interval": 1.5
@@ -72,8 +72,8 @@
"tooltip": true, "tooltip": true,
"format":"{text}", "format":"{text}",
"tooltip-format": "window 6: {text}", "tooltip-format": "window 6: {text}",
"on-click": "~/.config/sdgos/monocle/focuswindow.sh 6", "on-click": "~/.config/sdgos/monocle/focuswindow.sh 6 DP-1",
"exec": "~/.config/sdgos/monocle/fetchwindow.sh 6", "exec": "~/.config/sdgos/monocle/fetchwindow.sh 6 DP-1",
"max-length": 20, "max-length": 20,
"interval": 1.5 "interval": 1.5
@@ -83,8 +83,8 @@
"tooltip": true, "tooltip": true,
"format":"{text}", "format":"{text}",
"tooltip-format": "window 7: {text}", "tooltip-format": "window 7: {text}",
"on-click": "~/.config/sdgos/monocle/focuswindow.sh 7", "on-click": "~/.config/sdgos/monocle/focuswindow.sh 7 DP-1",
"exec": "~/.config/sdgos/monocle/fetchwindow.sh 7", "exec": "~/.config/sdgos/monocle/fetchwindow.sh 7 DP-1",
"max-length": 20, "max-length": 20,
"interval": 1.5 "interval": 1.5
@@ -94,8 +94,8 @@
"tooltip": true, "tooltip": true,
"format":"{text}", "format":"{text}",
"tooltip-format": "window 8: {text}", "tooltip-format": "window 8: {text}",
"on-click": "~/.config/sdgos/monocle/focuswindow.sh 8", "on-click": "~/.config/sdgos/monocle/focuswindow.sh 8 DP-1",
"exec": "~/.config/sdgos/monocle/fetchwindow.sh 8", "exec": "~/.config/sdgos/monocle/fetchwindow.sh 8 DP-1",
"max-length": 20, "max-length": 20,
"interval": 1.5 "interval": 1.5
@@ -105,8 +105,8 @@
"tooltip": true, "tooltip": true,
"format":"{text}", "format":"{text}",
"tooltip-format": "window 9: {text}", "tooltip-format": "window 9: {text}",
"on-click": "~/.config/sdgos/monocle/focuswindow.sh 9", "on-click": "~/.config/sdgos/monocle/focuswindow.sh 9 DP-1",
"exec": "~/.config/sdgos/monocle/fetchwindow.sh 9", "exec": "~/.config/sdgos/monocle/fetchwindow.sh 9 DP-1",
"max-length": 20, "max-length": 20,
"interval": 1.5 "interval": 1.5
@@ -116,8 +116,8 @@
"tooltip": true, "tooltip": true,
"format":"{text}", "format":"{text}",
"tooltip-format": "window 10: {text}", "tooltip-format": "window 10: {text}",
"on-click": "~/.config/sdgos/monocle/focuswindow.sh 10", "on-click": "~/.config/sdgos/monocle/focuswindow.sh 10 DP-1",
"exec": "~/.config/sdgos/monocle/fetchwindow.sh 10", "exec": "~/.config/sdgos/monocle/fetchwindow.sh 10 DP-1",
"max-length": 20, "max-length": 20,
"interval": 1.5 "interval": 1.5
+351
View File
@@ -0,0 +1,351 @@
{
// Test Button
"custom/daemon": {
"tooltip": true,
"format":"{text}",
"tooltip-format": "daemon is running, click to refresh",
"on-click": "~/.config/sdgos/monocle/indexer.sh DP-3",
"exec": "~/.config/sdgos/monocle/indexer.sh DP-3",
"max-length": 20,
"interval": 1
},
"custom/window1": {
"tooltip": true,
"format":"{text}",
"tooltip-format": "window 1: {text}",
"on-click": "~/.config/sdgos/monocle/focuswindow.sh 1 DP-3",
"exec": "~/.config/sdgos/monocle/fetchwindow.sh 1 DP-3",
"max-length": 20,
"interval": 1.5
},
"custom/window2": {
"tooltip": true,
"format":"{text}",
"tooltip-format": "window 2: {text}",
"on-click": "~/.config/sdgos/monocle/focuswindow.sh 2 DP-3",
"exec": "~/.config/sdgos/monocle/fetchwindow.sh 2 DP-3",
"max-length": 20,
"interval": 1.5
},
"custom/window3": {
"tooltip": true,
"format":"{text}",
"tooltip-format": "window 3: {text}",
"on-click": "~/.config/sdgos/monocle/focuswindow.sh 3 DP-3",
"exec": "~/.config/sdgos/monocle/fetchwindow.sh 3 DP-3",
"max-length": 20,
"interval": 1.5
},
"custom/window4": {
"tooltip": true,
"format":"{text}",
"tooltip-format": "window 4: {text}",
"on-click": "~/.config/sdgos/monocle/focuswindow.sh 4 DP-3",
"exec": "~/.config/sdgos/monocle/fetchwindow.sh 4 DP-3",
"max-length": 20,
"interval": 1.5
},
"custom/window5": {
"tooltip": true,
"format":"{text}",
"tooltip-format": "window 5: {text}",
"on-click": "~/.config/sdgos/monocle/focuswindow.sh 5 DP-3",
"exec": "~/.config/sdgos/monocle/fetchwindow.sh 5 DP-3",
"max-length": 20,
"interval": 1.5
},
"custom/window6": {
"tooltip": true,
"format":"{text}",
"tooltip-format": "window 6: {text}",
"on-click": "~/.config/sdgos/monocle/focuswindow.sh 6 DP-3",
"exec": "~/.config/sdgos/monocle/fetchwindow.sh 6 DP-3",
"max-length": 20,
"interval": 1.5
},
"custom/window7": {
"tooltip": true,
"format":"{text}",
"tooltip-format": "window 7: {text}",
"on-click": "~/.config/sdgos/monocle/focuswindow.sh 7 DP-3",
"exec": "~/.config/sdgos/monocle/fetchwindow.sh 7 DP-3",
"max-length": 20,
"interval": 1.5
},
"custom/window8": {
"tooltip": true,
"format":"{text}",
"tooltip-format": "window 8: {text}",
"on-click": "~/.config/sdgos/monocle/focuswindow.sh 8 DP-3",
"exec": "~/.config/sdgos/monocle/fetchwindow.sh 8 DP-3",
"max-length": 20,
"interval": 1.5
},
"custom/window9": {
"tooltip": true,
"format":"{text}",
"tooltip-format": "window 9: {text}",
"on-click": "~/.config/sdgos/monocle/focuswindow.sh 9 DP-3",
"exec": "~/.config/sdgos/monocle/fetchwindow.sh 9 DP-3",
"max-length": 20,
"interval": 1.5
},
"custom/window10": {
"tooltip": true,
"format":"{text}",
"tooltip-format": "window 10: {text}",
"on-click": "~/.config/sdgos/monocle/focuswindow.sh 10 DP-3",
"exec": "~/.config/sdgos/monocle/fetchwindow.sh 10 DP-3",
"max-length": 20,
"interval": 1.5
},
"custom/test-button2": {
"tooltip": true,
"format":"oooh",
"tooltip-format": "this is a button",
"on-click": "ydotool key 125:1 16:1 125:0 16:0"
},
"custom/button-fuzzel": {
"tooltip": true,
"format":"run",
"tooltip-format": "application start menu",
"on-click": "fuzzel"
},
"custom/button-term": {
"tooltip": true,
"format":"shell",
"tooltip-format": "launch terminal",
"on-click": "alacritty"
},
"custom/button-files": {
"tooltip": true,
"format":"files",
"tooltip-format": "launch files",
"on-click": "nautilus"
},
"custom/button-next": {
"tooltip": true,
"format":"next",
"tooltip-format": "next window",
"on-click": "ydotool key 56:1 15:1 56:0 15:0"
},
"custom/button-prev": {
"tooltip": true,
"format": "prev",
"tooltip-format": "previous window",
"on-click": "ydotool key 56:1 42:1 15:1 56:0 42:0 15:0"
},
"custom/button-fit": {
"tooltip": true,
"format":"fit",
"tooltip-format": "fit cluster to viewport",
"on-click": "ydotool key 125:1 42:1 50:1 125:0 42:0 50:0"
},
"custom/button-zoomin": {
"tooltip": true,
"format":"+",
"tooltip-format": "zoom in",
"on-click": "ydotool key 125:1 13:1 125:0 13:0"
},
"custom/button-zoomout": {
"tooltip": true,
"format":"-",
"tooltip-format": "zoom out",
"on-click": "ydotool key 125:1 12:1 125:0 12:0"
},
// Keyboard State
"keyboard-state": {
"numlock": true,
"capslock": true,
"format": "{name} {icon}",
"format-icons": {
"locked": "",
"unlocked": ""
}
},
// System tray
"tray": {
// "icon-size": 21,
"spacing": 10
},
// Clock
"clock": {
// "timezone": "Europe/Amsterdam",
"tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>",
"format-alt": "{:%Y-%m-%d}"
},
// System
"custom/system": {
"format": "",
"tooltip": false
},
// CPU
"cpu": {
"format": "/ C {usage}% ",
"on-click": "alacritty -e btop"
},
// Memory
"memory": {
"format": "/ M {}% ",
"on-click": "alacritty -e btop"
},
// Harddisc space used
"disk": {
"interval": 30,
"format": "D {percentage_used}% ",
"path": "/",
"on-click": "alacritty -e btop"
},
"hyprland/language": {
"format": "/ K {short}"
},
// Group Hardware
"group/hardware": {
"orientation": "inherit",
"drawer": {
"transition-duration": 300,
"children-class": "not-memory",
"transition-left-to-right": false
},
"modules": [
"custom/system",
"disk",
"cpu",
"memory",
"hyprland/language"
]
},
// Network
"network": {
"format": "{ifname}",
"format-wifi": " {essid}({signalStrength}%)",
"format-ethernet": " {ifname}",
"format-disconnected": "Disconnected ⚠",
"tooltip-format": " {ifname} via {gwaddri}",
"tooltip-format-wifi": " {ifname} @ {essid}\nIP: {ipaddr}\nStrength: {signalStrength}%\nFreq: {frequency}MHz\nUp: {bandwidthUpBits} Down: {bandwidthDownBits}",
"tooltip-format-ethernet": " {ifname}\nIP: {ipaddr}\n up: {bandwidthUpBits} down: {bandwidthDownBits}",
"tooltip-format-disconnected": "Disconnected",
"max-length": 50,
"on-click": "nm-connection-editor"
},
// Battery
"battery": {
"states": {
// "good": 95,
"warning": 30,
"critical": 15
},
"format": "{icon} {capacity}%",
"format-charging": " {capacity}%",
"format-plugged": " {capacity}%",
"format-alt": "{icon} {time}",
// "format-good": "", // An empty format will hide the module
// "format-full": "",
"format-icons": [" ", " ", " ", " ", " "]
},
// Pulseaudio
"pulseaudio": {
// "scroll-step": 1, // %, can be a float
"format": "{icon} {volume}%",
"format-bluetooth": "{volume}% {icon} {format_source}",
"format-bluetooth-muted": " {icon} {format_source}",
"format-muted": " {format_source}",
"format-source": "{volume}% ",
"format-source-muted": "",
"format-icons": {
"headphone": "",
"hands-free": "",
"headset": "",
"phone": "",
"portable": "",
"car": "",
"default": ["", " ", " "]
},
"on-click": "pavucontrol"
},
// Bluetooth
"bluetooth": {
"format-disabled": "",
"format-off": "",
"interval": 30,
"on-click": "blueman-manager",
"format-no-controller": ""
},
// Other
"user": {
"format": "{user}",
"interval": 60,
"icon": false
},
// Idle Inhibator
"idle_inhibitor": {
"format": "{icon}",
"tooltip": true,
"format-icons":{
"activated": "",
"deactivated": ""
},
"on-click-right": "hyprlock"
}
}
+351
View File
@@ -0,0 +1,351 @@
{
// Test Button
"custom/daemon": {
"tooltip": true,
"format":"{text}",
"tooltip-format": "daemon is running, click to refresh",
"on-click": "~/.config/sdgos/monocle/indexer.sh HDMI-A-1",
"exec": "~/.config/sdgos/monocle/indexer.sh HDMI-A-1",
"max-length": 20,
"interval": 1
},
"custom/window1": {
"tooltip": true,
"format":"{text}",
"tooltip-format": "window 1: {text}",
"on-click": "~/.config/sdgos/monocle/focuswindow.sh 1 HDMI-A-1",
"exec": "~/.config/sdgos/monocle/fetchwindow.sh 1 HDMI-A-1",
"max-length": 20,
"interval": 1.5
},
"custom/window2": {
"tooltip": true,
"format":"{text}",
"tooltip-format": "window 2: {text}",
"on-click": "~/.config/sdgos/monocle/focuswindow.sh 2 HDMI-A-1",
"exec": "~/.config/sdgos/monocle/fetchwindow.sh 2 HDMI-A-1",
"max-length": 20,
"interval": 1.5
},
"custom/window3": {
"tooltip": true,
"format":"{text}",
"tooltip-format": "window 3: {text}",
"on-click": "~/.config/sdgos/monocle/focuswindow.sh 3 HDMI-A-1",
"exec": "~/.config/sdgos/monocle/fetchwindow.sh 3 HDMI-A-1",
"max-length": 20,
"interval": 1.5
},
"custom/window4": {
"tooltip": true,
"format":"{text}",
"tooltip-format": "window 4: {text}",
"on-click": "~/.config/sdgos/monocle/focuswindow.sh 4 HDMI-A-1",
"exec": "~/.config/sdgos/monocle/fetchwindow.sh 4 HDMI-A-1",
"max-length": 20,
"interval": 1.5
},
"custom/window5": {
"tooltip": true,
"format":"{text}",
"tooltip-format": "window 5: {text}",
"on-click": "~/.config/sdgos/monocle/focuswindow.sh 5 HDMI-A-1",
"exec": "~/.config/sdgos/monocle/fetchwindow.sh 5 HDMI-A-1",
"max-length": 20,
"interval": 1.5
},
"custom/window6": {
"tooltip": true,
"format":"{text}",
"tooltip-format": "window 6: {text}",
"on-click": "~/.config/sdgos/monocle/focuswindow.sh 6 HDMI-A-1",
"exec": "~/.config/sdgos/monocle/fetchwindow.sh 6 HDMI-A-1",
"max-length": 20,
"interval": 1.5
},
"custom/window7": {
"tooltip": true,
"format":"{text}",
"tooltip-format": "window 7: {text}",
"on-click": "~/.config/sdgos/monocle/focuswindow.sh 7 HDMI-A-1",
"exec": "~/.config/sdgos/monocle/fetchwindow.sh 7 HDMI-A-1",
"max-length": 20,
"interval": 1.5
},
"custom/window8": {
"tooltip": true,
"format":"{text}",
"tooltip-format": "window 8: {text}",
"on-click": "~/.config/sdgos/monocle/focuswindow.sh 8 HDMI-A-1",
"exec": "~/.config/sdgos/monocle/fetchwindow.sh 8 HDMI-A-1",
"max-length": 20,
"interval": 1.5
},
"custom/window9": {
"tooltip": true,
"format":"{text}",
"tooltip-format": "window 9: {text}",
"on-click": "~/.config/sdgos/monocle/focuswindow.sh 9 HDMI-A-1",
"exec": "~/.config/sdgos/monocle/fetchwindow.sh 9 HDMI-A-1",
"max-length": 20,
"interval": 1.5
},
"custom/window10": {
"tooltip": true,
"format":"{text}",
"tooltip-format": "window 10: {text}",
"on-click": "~/.config/sdgos/monocle/focuswindow.sh 10 HDMI-A-1",
"exec": "~/.config/sdgos/monocle/fetchwindow.sh 10 HDMI-A-1",
"max-length": 20,
"interval": 1.5
},
"custom/test-button2": {
"tooltip": true,
"format":"oooh",
"tooltip-format": "this is a button",
"on-click": "ydotool key 125:1 16:1 125:0 16:0"
},
"custom/button-fuzzel": {
"tooltip": true,
"format":"run",
"tooltip-format": "application start menu",
"on-click": "fuzzel"
},
"custom/button-term": {
"tooltip": true,
"format":"shell",
"tooltip-format": "launch terminal",
"on-click": "alacritty"
},
"custom/button-files": {
"tooltip": true,
"format":"files",
"tooltip-format": "launch files",
"on-click": "nautilus"
},
"custom/button-next": {
"tooltip": true,
"format":"next",
"tooltip-format": "next window",
"on-click": "ydotool key 56:1 15:1 56:0 15:0"
},
"custom/button-prev": {
"tooltip": true,
"format": "prev",
"tooltip-format": "previous window",
"on-click": "ydotool key 56:1 42:1 15:1 56:0 42:0 15:0"
},
"custom/button-fit": {
"tooltip": true,
"format":"fit",
"tooltip-format": "fit cluster to viewport",
"on-click": "ydotool key 125:1 42:1 50:1 125:0 42:0 50:0"
},
"custom/button-zoomin": {
"tooltip": true,
"format":"+",
"tooltip-format": "zoom in",
"on-click": "ydotool key 125:1 13:1 125:0 13:0"
},
"custom/button-zoomout": {
"tooltip": true,
"format":"-",
"tooltip-format": "zoom out",
"on-click": "ydotool key 125:1 12:1 125:0 12:0"
},
// Keyboard State
"keyboard-state": {
"numlock": true,
"capslock": true,
"format": "{name} {icon}",
"format-icons": {
"locked": "",
"unlocked": ""
}
},
// System tray
"tray": {
// "icon-size": 21,
"spacing": 10
},
// Clock
"clock": {
// "timezone": "Europe/Amsterdam",
"tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>",
"format-alt": "{:%Y-%m-%d}"
},
// System
"custom/system": {
"format": "",
"tooltip": false
},
// CPU
"cpu": {
"format": "/ C {usage}% ",
"on-click": "alacritty -e btop"
},
// Memory
"memory": {
"format": "/ M {}% ",
"on-click": "alacritty -e btop"
},
// Harddisc space used
"disk": {
"interval": 30,
"format": "D {percentage_used}% ",
"path": "/",
"on-click": "alacritty -e btop"
},
"hyprland/language": {
"format": "/ K {short}"
},
// Group Hardware
"group/hardware": {
"orientation": "inherit",
"drawer": {
"transition-duration": 300,
"children-class": "not-memory",
"transition-left-to-right": false
},
"modules": [
"custom/system",
"disk",
"cpu",
"memory",
"hyprland/language"
]
},
// Network
"network": {
"format": "{ifname}",
"format-wifi": " {essid}({signalStrength}%)",
"format-ethernet": " {ifname}",
"format-disconnected": "Disconnected ⚠",
"tooltip-format": " {ifname} via {gwaddri}",
"tooltip-format-wifi": " {ifname} @ {essid}\nIP: {ipaddr}\nStrength: {signalStrength}%\nFreq: {frequency}MHz\nUp: {bandwidthUpBits} Down: {bandwidthDownBits}",
"tooltip-format-ethernet": " {ifname}\nIP: {ipaddr}\n up: {bandwidthUpBits} down: {bandwidthDownBits}",
"tooltip-format-disconnected": "Disconnected",
"max-length": 50,
"on-click": "nm-connection-editor"
},
// Battery
"battery": {
"states": {
// "good": 95,
"warning": 30,
"critical": 15
},
"format": "{icon} {capacity}%",
"format-charging": " {capacity}%",
"format-plugged": " {capacity}%",
"format-alt": "{icon} {time}",
// "format-good": "", // An empty format will hide the module
// "format-full": "",
"format-icons": [" ", " ", " ", " ", " "]
},
// Pulseaudio
"pulseaudio": {
// "scroll-step": 1, // %, can be a float
"format": "{icon} {volume}%",
"format-bluetooth": "{volume}% {icon} {format_source}",
"format-bluetooth-muted": " {icon} {format_source}",
"format-muted": " {format_source}",
"format-source": "{volume}% ",
"format-source-muted": "",
"format-icons": {
"headphone": "",
"hands-free": "",
"headset": "",
"phone": "",
"portable": "",
"car": "",
"default": ["", " ", " "]
},
"on-click": "pavucontrol"
},
// Bluetooth
"bluetooth": {
"format-disabled": "",
"format-off": "",
"interval": 30,
"on-click": "blueman-manager",
"format-no-controller": ""
},
// Other
"user": {
"format": "{user}",
"interval": 60,
"icon": false
},
// Idle Inhibator
"idle_inhibitor": {
"format": "{icon}",
"tooltip": true,
"format-icons":{
"activated": "",
"deactivated": ""
},
"on-click-right": "hyprlock"
}
}
+5
View File
@@ -0,0 +1,5 @@
#!/bin/bash
MON=$1
waybar -c ~/.config/sdgos/monocle/config-$MON -s ~/.config/sdgos/monocle/style.css
-5
View File
@@ -1,5 +0,0 @@
#!/bin/bash
echo "off" > ~/.config/monocledaemon.state
# constant command: mmsg watch all-monitors | jq -r '.monitors[] | select(.tags[] | select(.is_active == true) | .layout | test("M|K|VK")) | .name'
-7
View File
@@ -8,10 +8,3 @@ SELECTED=$(cat ~/.config/sdgos/tuis/layouts.list | cut -d '|' -f 1 | fzf --layou
CMD=$(cat ~/.config/sdgos/tuis/layouts.list | grep -e "$SELECTED" | cut -d '|' -f 2) CMD=$(cat ~/.config/sdgos/tuis/layouts.list | grep -e "$SELECTED" | cut -d '|' -f 2)
eval $CMD eval $CMD
if [[ "$SELECTED" == "Deck - horizontal " ]] || [[ "$SELECTED" == "Deck - vertical " ]]; then
pkill -9 waybar
mmsg dispatch spawn_shell,'waybar -c ~/.config/sdgos/monocle/config -s ~/.config/sdgos/monocle/style.css'
else
pkill -9 waybar
fi
+17
View File
@@ -0,0 +1,17 @@
#!/bin/bash
BAR_WIDTH=24
get_brightness() {
brightnessctl -m 2>/dev/null | cut -d, -f4 | tr -d '%'
}
pct=$(get_brightness)
[[ -z "$pct" ]] && pct=0
filled=$(( pct * BAR_WIDTH / 100 ))
empty=$(( BAR_WIDTH - filled ))
for ((i=0; i<filled; i++)); do printf "█"; done
for ((i=0; i<empty; i++)); do printf "░"; done
printf "\n"
+49
View File
@@ -0,0 +1,49 @@
@import "./colors.css";
window#waybar {
background: transparent;
box-shadow: none;
border: none;
}
#custom-brightness-up,
#custom-brightness-bar,
#custom-brightness-down,
#custom-brightness-icon {
background-color: @surface_container;
color: @primary;
font-size: 12px;
}
#custom-brightness-up,
#custom-brightness-bar,
#custom-brightness-down {
margin: 0;
border-color: @primary;
border-style: solid;
}
#custom-brightness-up {
padding: 4px 6px;
border-width: 2px 2px 0 2px;
border-radius: 10px 10px 0 0;
}
#custom-brightness-bar {
padding: 0 2px;
border-width: 0 2px;
border-radius: 0;
}
#custom-brightness-down {
padding: 4px 6px;
border-width: 0 2px 2px 2px;
border-radius: 0 0 10px 10px;
}
#custom-brightness-icon {
padding: 4px 6px;
border: 2px solid @primary;
border-radius: 10px;
margin-top: 6px;
}
+24
View File
@@ -0,0 +1,24 @@
{
"layer": "overlay",
"exclusive": false,
"position": "left",
"width": 36,
"margin-top": 240,
"margin-bottom": 240,
"margin-left": 6,
"margin-right": 0,
"spacing": 0,
"include": [
"~/.config/sdgos/wayshell/configs/waybar-modules"
],
"modules-left": [
],
"modules-center": [
"custom/brightness-up",
"custom/brightness-bar",
"custom/brightness-down",
"custom/brightness-icon"
],
"modules-right": [
]
}
+26
View File
@@ -0,0 +1,26 @@
#!/bin/bash
BAR_WIDTH=20
get_brightness() {
brightnessctl -m 2>/dev/null | cut -d, -f4 | tr -d '%'
}
render_bar() {
local pct=$1
local filled=$(( pct * BAR_WIDTH / 100 ))
local empty=$(( BAR_WIDTH - filled ))
local text="▲"
for ((i=0; i<filled; i++)); do text+=$'\n'"█"; done
for ((i=0; i<empty; i++)); do text+=$'\n'"░"; done
text+=$'\n'"▼"
echo "$text"
}
pct=$(get_brightness)
[[ -z "$pct" ]] && pct=0
bar=$(render_bar "$pct")
# Escape newlines for JSON
escaped=$(printf '%s' "$bar" | awk '{if(NR>1)printf "\\n"; printf "%s", $0}')
printf '{"text":"%s","class":"brightness","percentage":%d,"alt":"%d%%"}\n' "$escaped" "$pct" "$pct"
+105
View File
@@ -0,0 +1,105 @@
/*
* Css Colors
* Generated with Matugen
*/
@define-color background #0d141c;
@define-color error #ffb4ab;
@define-color error_container #93000a;
@define-color inverse_on_surface #2a3139;
@define-color inverse_primary #0062a0;
@define-color inverse_surface #dde3ee;
@define-color on_background #dde3ee;
@define-color on_error #690005;
@define-color on_error_container #ffdad6;
@define-color on_primary #003256;
@define-color on_primary_container #d0e4ff;
@define-color on_primary_fixed #001d35;
@define-color on_primary_fixed_variant #00497a;
@define-color on_secondary #22304c;
@define-color on_secondary_container #d8e2ff;
@define-color on_secondary_fixed #0c1b36;
@define-color on_secondary_fixed_variant #394664;
@define-color on_surface #dde3ee;
@define-color on_surface_variant #c0c7d2;
@define-color on_tertiary #282c5a;
@define-color on_tertiary_container #e0e0ff;
@define-color on_tertiary_fixed #121644;
@define-color on_tertiary_fixed_variant #3e4372;
@define-color outline #8b919b;
@define-color outline_variant #414750;
@define-color primary #9bcaff;
@define-color primary_container #00497a;
@define-color primary_fixed #d0e4ff;
@define-color primary_fixed_dim #9bcaff;
@define-color scrim #000000;
@define-color secondary #b8c6ea;
@define-color secondary_container #394664;
@define-color secondary_fixed #d8e2ff;
@define-color secondary_fixed_dim #b8c6ea;
@define-color shadow #000000;
@define-color source_color #6c8cb0;
@define-color surface #0d141c;
@define-color surface_bright #333a42;
@define-color surface_container #192028;
@define-color surface_container_high #242b33;
@define-color surface_container_highest #2f353e;
@define-color surface_container_low #151c24;
@define-color surface_container_lowest #080f16;
@define-color surface_dim #0d141c;
@define-color surface_tint #9bcaff;
@define-color surface_variant #414750;
@define-color tertiary #bfc2fa;
@define-color tertiary_container #3e4372;
@define-color tertiary_fixed #e0e0ff;
@define-color tertiary_fixed_dim #bfc2fa;
+105
View File
@@ -0,0 +1,105 @@
/*
* Css Colors
* Generated with Matugen
*/
@define-color background #0d141c;
@define-color error #ffb4ab;
@define-color error_container #93000a;
@define-color inverse_on_surface #2a3139;
@define-color inverse_primary #0062a0;
@define-color inverse_surface #dde3ee;
@define-color on_background #dde3ee;
@define-color on_error #690005;
@define-color on_error_container #ffdad6;
@define-color on_primary #003256;
@define-color on_primary_container #d0e4ff;
@define-color on_primary_fixed #001d35;
@define-color on_primary_fixed_variant #00497a;
@define-color on_secondary #22304c;
@define-color on_secondary_container #d8e2ff;
@define-color on_secondary_fixed #0c1b36;
@define-color on_secondary_fixed_variant #394664;
@define-color on_surface #dde3ee;
@define-color on_surface_variant #c0c7d2;
@define-color on_tertiary #282c5a;
@define-color on_tertiary_container #e0e0ff;
@define-color on_tertiary_fixed #121644;
@define-color on_tertiary_fixed_variant #3e4372;
@define-color outline #8b919b;
@define-color outline_variant #414750;
@define-color primary #9bcaff;
@define-color primary_container #00497a;
@define-color primary_fixed #d0e4ff;
@define-color primary_fixed_dim #9bcaff;
@define-color scrim #000000;
@define-color secondary #b8c6ea;
@define-color secondary_container #394664;
@define-color secondary_fixed #d8e2ff;
@define-color secondary_fixed_dim #b8c6ea;
@define-color shadow #000000;
@define-color source_color #6c8cb0;
@define-color surface #0d141c;
@define-color surface_bright #333a42;
@define-color surface_container #192028;
@define-color surface_container_high #242b33;
@define-color surface_container_highest #2f353e;
@define-color surface_container_low #151c24;
@define-color surface_container_lowest #080f16;
@define-color surface_dim #0d141c;
@define-color surface_tint #9bcaff;
@define-color surface_variant #414750;
@define-color tertiary #bfc2fa;
@define-color tertiary_container #3e4372;
@define-color tertiary_fixed #e0e0ff;
@define-color tertiary_fixed_dim #bfc2fa;
@@ -0,0 +1,35 @@
{
"layer": "top",
"position": "right",
"fixed-center": "true",
"output": "DP-1",
"margin-top": 0,
"margin-bottom": 0,
"margin-left": 0,
"margin-right": 0,
"spacing": 3,
// Load Modules
"include": [
"~/.config/sdgos/monocle/modules-dp1.json"
],
"modules-left": [
"custom/daemon",
"custom/window1",
"custom/window2",
"custom/window3",
"custom/window4",
"custom/window5",
"custom/window6",
"custom/window7",
"custom/window8",
"custom/window9",
"custom/window10",
],
"modules-center": [
],
"modules-right": [
]
}
@@ -0,0 +1,351 @@
{
// Test Button
"custom/daemon": {
"tooltip": true,
"format":"{text}",
"tooltip-format": "daemon is running, click to refresh",
"on-click": "~/.config/sdgos/monocle/indexer.sh DP-1",
"exec": "~/.config/sdgos/monocle/indexer.sh DP-1",
"max-length": 20,
"interval": 1
},
"custom/window1": {
"tooltip": true,
"format":"{text}",
"tooltip-format": "window 1: {text}",
"on-click": "~/.config/sdgos/monocle/focuswindow.sh 1 DP-1",
"exec": "~/.config/sdgos/monocle/fetchwindow.sh 1 DP-1",
"max-length": 20,
"interval": 1.5
},
"custom/window2": {
"tooltip": true,
"format":"{text}",
"tooltip-format": "window 2: {text}",
"on-click": "~/.config/sdgos/monocle/focuswindow.sh 2 DP-1",
"exec": "~/.config/sdgos/monocle/fetchwindow.sh 2 DP-1",
"max-length": 20,
"interval": 1.5
},
"custom/window3": {
"tooltip": true,
"format":"{text}",
"tooltip-format": "window 3: {text}",
"on-click": "~/.config/sdgos/monocle/focuswindow.sh 3 DP-1",
"exec": "~/.config/sdgos/monocle/fetchwindow.sh 3 DP-1",
"max-length": 20,
"interval": 1.5
},
"custom/window4": {
"tooltip": true,
"format":"{text}",
"tooltip-format": "window 4: {text}",
"on-click": "~/.config/sdgos/monocle/focuswindow.sh 4 DP-1",
"exec": "~/.config/sdgos/monocle/fetchwindow.sh 4 DP-1",
"max-length": 20,
"interval": 1.5
},
"custom/window5": {
"tooltip": true,
"format":"{text}",
"tooltip-format": "window 5: {text}",
"on-click": "~/.config/sdgos/monocle/focuswindow.sh 5 DP-1",
"exec": "~/.config/sdgos/monocle/fetchwindow.sh 5 DP-1",
"max-length": 20,
"interval": 1.5
},
"custom/window6": {
"tooltip": true,
"format":"{text}",
"tooltip-format": "window 6: {text}",
"on-click": "~/.config/sdgos/monocle/focuswindow.sh 6 DP-1",
"exec": "~/.config/sdgos/monocle/fetchwindow.sh 6 DP-1",
"max-length": 20,
"interval": 1.5
},
"custom/window7": {
"tooltip": true,
"format":"{text}",
"tooltip-format": "window 7: {text}",
"on-click": "~/.config/sdgos/monocle/focuswindow.sh 7 DP-1",
"exec": "~/.config/sdgos/monocle/fetchwindow.sh 7 DP-1",
"max-length": 20,
"interval": 1.5
},
"custom/window8": {
"tooltip": true,
"format":"{text}",
"tooltip-format": "window 8: {text}",
"on-click": "~/.config/sdgos/monocle/focuswindow.sh 8 DP-1",
"exec": "~/.config/sdgos/monocle/fetchwindow.sh 8 DP-1",
"max-length": 20,
"interval": 1.5
},
"custom/window9": {
"tooltip": true,
"format":"{text}",
"tooltip-format": "window 9: {text}",
"on-click": "~/.config/sdgos/monocle/focuswindow.sh 9 DP-1",
"exec": "~/.config/sdgos/monocle/fetchwindow.sh 9 DP-1",
"max-length": 20,
"interval": 1.5
},
"custom/window10": {
"tooltip": true,
"format":"{text}",
"tooltip-format": "window 10: {text}",
"on-click": "~/.config/sdgos/monocle/focuswindow.sh 10 DP-1",
"exec": "~/.config/sdgos/monocle/fetchwindow.sh 10 DP-1",
"max-length": 20,
"interval": 1.5
},
"custom/test-button2": {
"tooltip": true,
"format":"oooh",
"tooltip-format": "this is a button",
"on-click": "ydotool key 125:1 16:1 125:0 16:0"
},
"custom/button-fuzzel": {
"tooltip": true,
"format":"run",
"tooltip-format": "application start menu",
"on-click": "fuzzel"
},
"custom/button-term": {
"tooltip": true,
"format":"shell",
"tooltip-format": "launch terminal",
"on-click": "alacritty"
},
"custom/button-files": {
"tooltip": true,
"format":"files",
"tooltip-format": "launch files",
"on-click": "nautilus"
},
"custom/button-next": {
"tooltip": true,
"format":"next",
"tooltip-format": "next window",
"on-click": "ydotool key 56:1 15:1 56:0 15:0"
},
"custom/button-prev": {
"tooltip": true,
"format": "prev",
"tooltip-format": "previous window",
"on-click": "ydotool key 56:1 42:1 15:1 56:0 42:0 15:0"
},
"custom/button-fit": {
"tooltip": true,
"format":"fit",
"tooltip-format": "fit cluster to viewport",
"on-click": "ydotool key 125:1 42:1 50:1 125:0 42:0 50:0"
},
"custom/button-zoomin": {
"tooltip": true,
"format":"+",
"tooltip-format": "zoom in",
"on-click": "ydotool key 125:1 13:1 125:0 13:0"
},
"custom/button-zoomout": {
"tooltip": true,
"format":"-",
"tooltip-format": "zoom out",
"on-click": "ydotool key 125:1 12:1 125:0 12:0"
},
// Keyboard State
"keyboard-state": {
"numlock": true,
"capslock": true,
"format": "{name} {icon}",
"format-icons": {
"locked": "",
"unlocked": ""
}
},
// System tray
"tray": {
// "icon-size": 21,
"spacing": 10
},
// Clock
"clock": {
// "timezone": "Europe/Amsterdam",
"tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>",
"format-alt": "{:%Y-%m-%d}"
},
// System
"custom/system": {
"format": "",
"tooltip": false
},
// CPU
"cpu": {
"format": "/ C {usage}% ",
"on-click": "alacritty -e btop"
},
// Memory
"memory": {
"format": "/ M {}% ",
"on-click": "alacritty -e btop"
},
// Harddisc space used
"disk": {
"interval": 30,
"format": "D {percentage_used}% ",
"path": "/",
"on-click": "alacritty -e btop"
},
"hyprland/language": {
"format": "/ K {short}"
},
// Group Hardware
"group/hardware": {
"orientation": "inherit",
"drawer": {
"transition-duration": 300,
"children-class": "not-memory",
"transition-left-to-right": false
},
"modules": [
"custom/system",
"disk",
"cpu",
"memory",
"hyprland/language"
]
},
// Network
"network": {
"format": "{ifname}",
"format-wifi": " {essid}({signalStrength}%)",
"format-ethernet": " {ifname}",
"format-disconnected": "Disconnected ⚠",
"tooltip-format": " {ifname} via {gwaddri}",
"tooltip-format-wifi": " {ifname} @ {essid}\nIP: {ipaddr}\nStrength: {signalStrength}%\nFreq: {frequency}MHz\nUp: {bandwidthUpBits} Down: {bandwidthDownBits}",
"tooltip-format-ethernet": " {ifname}\nIP: {ipaddr}\n up: {bandwidthUpBits} down: {bandwidthDownBits}",
"tooltip-format-disconnected": "Disconnected",
"max-length": 50,
"on-click": "nm-connection-editor"
},
// Battery
"battery": {
"states": {
// "good": 95,
"warning": 30,
"critical": 15
},
"format": "{icon} {capacity}%",
"format-charging": " {capacity}%",
"format-plugged": " {capacity}%",
"format-alt": "{icon} {time}",
// "format-good": "", // An empty format will hide the module
// "format-full": "",
"format-icons": [" ", " ", " ", " ", " "]
},
// Pulseaudio
"pulseaudio": {
// "scroll-step": 1, // %, can be a float
"format": "{icon} {volume}%",
"format-bluetooth": "{volume}% {icon} {format_source}",
"format-bluetooth-muted": " {icon} {format_source}",
"format-muted": " {format_source}",
"format-source": "{volume}% ",
"format-source-muted": "",
"format-icons": {
"headphone": "",
"hands-free": "",
"headset": "",
"phone": "",
"portable": "",
"car": "",
"default": ["", " ", " "]
},
"on-click": "pavucontrol"
},
// Bluetooth
"bluetooth": {
"format-disabled": "",
"format-off": "",
"interval": 30,
"on-click": "blueman-manager",
"format-no-controller": ""
},
// Other
"user": {
"format": "{user}",
"interval": 60,
"icon": false
},
// Idle Inhibator
"idle_inhibitor": {
"format": "{icon}",
"tooltip": true,
"format-icons":{
"activated": "",
"deactivated": ""
},
"on-click-right": "hyprlock"
}
}
+52
View File
@@ -0,0 +1,52 @@
@import "./colors.css";
* {
font-family: "JetBrainsMono Nerd Font";
font-weight: bold;
min-height: 0;
/* set font-size to 100% if font scaling is set to 1.00 using nwg-look */
font-size: 97%;
font-feature-settings: '"zero", "ss01", "ss02", "ss03", "ss04", "ss05", "cv31"';
border: 0px;
padding-top: 2px;
padding-bottom: 2px;
padding-left: 4px;
background-color: @surface;
animation: gradient_f 20s ease-in infinite;
transition: all 0.3s cubic-bezier(.55,-0.68,.48,1.682);
}
#custom-daemon,
#custom-window1,
#custom-window2,
#custom-window3,
#custom-window4,
#custom-window5,
#custom-window6,
#custom-window7,
#custom-window8,
#custom-window9,
#custom-window10,
#custom-button-term,
#custom-button-files,
#custom-button-next,
#custom-button-prev,
#custom-button-zoomin,
#custom-button-zoomout,
#custom-button-fit {
background-color: @surface_container;
color: @primary;
border: 0px;
border-style: solid;
border-color: white;
border-radius: 10px;
padding-top: 4px;
padding-left: 6px;
padding-right: 6px;
padding-bottom: 4px;
}
+40
View File
@@ -0,0 +1,40 @@
{
"custom/ss-monitor": {
"format": "",
"tooltip-format": "Capture monitor",
"on-click": "mmsg dispatch spawn_shell,'~/.config/sdgos/wayshell/configs/ss-capture.sh output'"
},
"custom/ss-zone": {
"format": "",
"tooltip-format": "Select zone",
"on-click": "mmsg dispatch spawn_shell,'~/.config/sdgos/wayshell/configs/ss-capture.sh area'"
},
"custom/ss-all": {
"format": "",
"tooltip-format": "All monitors",
"on-click": "mmsg dispatch spawn_shell,'~/.config/sdgos/wayshell/configs/ss-capture.sh screen'"
},
"custom/ss-window": {
"format": "",
"tooltip-format": "Capture window",
"on-click": "mmsg dispatch spawn_shell,'~/.config/sdgos/wayshell/configs/ss-capture.sh active'"
},
"custom/ss-obs": {
"format": "",
"tooltip-format": "Open OBS",
"on-click": "mmsg dispatch spawn_shell,'obs'"
},
"custom/ss-mode": {
"exec": "~/.config/sdgos/wayshell/configs/ss-mode.sh",
"interval": 86400,
"signal": 1,
"format": "{}",
"tooltip-format": "Screenshot mode",
"on-click": "mmsg dispatch spawn_shell,'~/.config/sdgos/wayshell/configs/ss-mode-cycle.sh'"
},
"custom/ss-settings": {
"format": "",
"tooltip-format": "Settings",
"on-click": "mmsg dispatch spawn_shell,'~/.config/sdgos/wayshell/configs/ss-settings-menu.sh'"
}
}
+36
View File
@@ -0,0 +1,36 @@
@import "./colors.css";
window#waybar {
background: transparent;
box-shadow: none;
border: none;
}
#custom-ss-monitor,
#custom-ss-zone,
#custom-ss-all,
#custom-ss-window,
#custom-ss-obs,
#custom-ss-mode,
#custom-ss-settings {
background-color: @surface_container;
color: @primary;
font-size: 16px;
padding: 4px 10px 6px;
border-color: @primary;
border-style: solid;
border-width: 0 2px 2px;
border-radius: 0 0 10px 10px;
min-width: 20px;
}
#custom-ss-monitor:hover,
#custom-ss-zone:hover,
#custom-ss-all:hover,
#custom-ss-window:hover,
#custom-ss-obs:hover,
#custom-ss-mode:hover,
#custom-ss-settings:hover {
background-color: @primary;
color: @surface_container;
}
+25
View File
@@ -0,0 +1,25 @@
{
"layer": "overlay",
"exclusive": true,
"position": "top",
"margin-top": -2,
"margin-bottom": -30,
"spacing": 2,
"include": [
"~/.config/sdgos/wayshell/configs/screenshot-modules"
],
"modules-left": [
],
"modules-center": [
"custom/ss-monitor",
"custom/ss-zone",
"custom/ss-all",
"custom/ss-window",
"custom/ss-obs",
"custom/ss-mode",
"custom/ss-settings"
],
"modules-right": [
]
}
+95
View File
@@ -0,0 +1,95 @@
#!/bin/bash
target=$1
state_file=$HOME/.config/sdgos/wayshell/screenshot.state
if [ ! -f "$state_file" ]; then
mkdir -p "$(dirname "$state_file")"
cat > "$state_file" <<- EOF
mode=clipboard
save_dir=$HOME/Pictures/Screenshots
editor=gimp
EOF
fi
mode=$(awk -F= '/^mode=/ {print $2}' "$state_file")
save_dir=$(awk -F= '/^save_dir=/ {print $2}' "$state_file")
editor=$(awk -F= '/^editor=/ {print $2}' "$state_file")
timestamp=$(date +%s)
# Hide the screenshot bar so it doesn't appear in captures
pkill -f "screenshot.json" 2>/dev/null || true
sleep 0.5
# Resolve capture geometry/device
case $target in
output)
monitor=$(mmsg get cursorpos | python3 -c "import json,sys; print(json.load(sys.stdin)['monitor'])")
grim_args=(-o "$monitor")
label="$(echo "$monitor" | sed 's/[-_.]/ /g')"
;;
area)
grim_args=(-g "$(slurp)")
label="selected area"
;;
screen)
grim_args=()
label="all monitors"
;;
active)
slurp -p -f "%x,%y" >/dev/null 2>&1
sleep 0.5
geom=$(mmsg get focusing-client | python3 -c "
import json,sys
d=json.load(sys.stdin)
print(f'{d[\"x\"]},{d[\"y\"]} {d[\"width\"]}x{d[\"height\"]}')
")
grim_args=(-g "$geom")
label="window"
;;
esac
case $mode in
disk)
mkdir -p "$save_dir"
file="$save_dir/screenshot-$timestamp.png"
grim "${grim_args[@]}" "$file"
editor_name=$(echo "$editor" | awk '{print $1}' | sed 's|.*/||')
action=$(notify-send \
-a "Screenshot" \
-i "$file" \
-h "string:image-path:$file" \
-t 10000 \
-A "open=Open in $editor_name" \
"Screenshot saved" \
"$(basename "$file")")
if [ "$action" = "open" ]; then
mmsg dispatch spawn_shell,"$editor $file"
fi
;;
clipboard)
file=$(mktemp /tmp/screenshot-XXXXXX.png)
grim "${grim_args[@]}" "$file"
wl-copy < "$file"
notify-send \
-a "Screenshot" \
-i "$file" \
-h "string:image-path:$file" \
-t 3000 \
"Screenshot copied" \
"$label captured to clipboard"
rm "$file"
;;
editor)
mkdir -p "$save_dir"
file="$save_dir/screenshot-$timestamp.png"
grim "${grim_args[@]}" "$file"
mmsg dispatch spawn_shell,"$editor $file"
notify-send \
-a "Screenshot" \
-i "$file" \
-h "string:image-path:$file" \
-t 3000 \
"Opening in editor" \
"$(basename "$file")"
;;
esac
+35
View File
@@ -0,0 +1,35 @@
#!/bin/bash
state_file=$HOME/.config/sdgos/wayshell/screenshot.state
if [ ! -f "$state_file" ]; then
mkdir -p "$(dirname "$state_file")"
cat > "$state_file" <<- EOF
mode=clipboard
save_dir=$HOME/Pictures/Screenshots
editor=gimp
EOF
new_mode="disk"
else
mode=$(awk -F= '/^mode=/ {print $2}' "$state_file")
case $mode in
disk) new_mode="clipboard" ;;
clipboard) new_mode="editor" ;;
editor) new_mode="disk" ;;
*) new_mode="clipboard" ;;
esac
sed -i "s/^mode=.*/mode=$new_mode/" "$state_file"
fi
killall -SIGRTMIN+1 waybar 2>/dev/null
killall -SIGRTMIN+2 waybar 2>/dev/null
case $new_mode in
disk) icon_char="" ;;
clipboard) icon_char="" ;;
editor) icon_char="" ;;
esac
notify-send \
-a "$icon_char" \
-t 2000 \
"Screenshot mode" \
"Changed to: $new_mode"
+12
View File
@@ -0,0 +1,12 @@
#!/bin/bash
state_file=$HOME/.config/sdgos/wayshell/screenshot.state
icon=""
if [ -f "$state_file" ]; then
mode=$(awk -F= '/^mode=/ {print $2}' "$state_file")
case $mode in
disk) icon="" ;;
editor) icon="" ;;
esac
fi
echo "$icon"
+52
View File
@@ -0,0 +1,52 @@
#!/bin/bash
state_file=$HOME/.config/sdgos/wayshell/screenshot.state
if [ ! -f "$state_file" ]; then
mkdir -p "$(dirname "$state_file")"
cat > "$state_file" <<- EOF
mode=clipboard
save_dir=$HOME/Pictures/Screenshots
editor=gimp
EOF
fi
mode=$(awk -F= '/^mode=/ {print $2}' "$state_file")
save_dir=$(awk -F= '/^save_dir=/ {print $2}' "$state_file")
editor=$(awk -F= '/^editor=/ {print $2}' "$state_file")
case $mode in
disk)
new_dir=$(zenity --file-selection --directory \
--title="Screenshot save directory" \
--filename="$save_dir/")
if [ -n "$new_dir" ]; then
sed -i "s|^save_dir=.*|save_dir=$new_dir|" "$state_file"
notify-send \
-a "" \
-t 3000 \
"Save directory" \
"$(basename "$new_dir")"
fi
;;
clipboard)
notify-send \
-a "" \
-t 2000 \
"Clipboard mode" \
"No settings available"
;;
editor)
new_editor=$(zenity --entry \
--title="Screenshot editor" \
--text="Editor command:" \
--entry-text="$editor")
if [ -n "$new_editor" ]; then
sed -i "s|^editor=.*|editor=$new_editor|" "$state_file"
notify-send \
-a "" \
-t 3000 \
"Editor" \
"$new_editor"
fi
;;
esac
+17
View File
@@ -0,0 +1,17 @@
#!/bin/bash
state_file=$HOME/.config/sdgos/wayshell/screenshot.state
tooltip="Settings"
if [ -f "$state_file" ]; then
mode=$(awk -F= '/^mode=/ {print $2}' "$state_file")
save_dir=$(awk -F= '/^save_dir=/ {print $2}' "$state_file")
editor=$(awk -F= '/^editor=/ {print $2}' "$state_file")
case $mode in
disk) tooltip="Save to: $save_dir" ;;
clipboard) tooltip="Clipboard mode" ;;
editor) tooltip="Editor: $editor" ;;
esac
fi
echo "{\"text\":\"\",\"tooltip\":\"$tooltip\"}"
+17
View File
@@ -0,0 +1,17 @@
#!/bin/bash
BAR_WIDTH=24
get_volume() {
wpctl get-volume @DEFAULT_AUDIO_SINK@ 2>/dev/null | sed 's/.*: //' | awk '{printf "%.0f\n", $1 * 100}'
}
pct=$(get_volume)
[[ -z "$pct" ]] && pct=0
filled=$(( pct * BAR_WIDTH / 100 ))
empty=$(( BAR_WIDTH - filled ))
for ((i=0; i<filled; i++)); do printf "█"; done
for ((i=0; i<empty; i++)); do printf "░"; done
printf "\n"
+7
View File
@@ -0,0 +1,7 @@
#!/bin/bash
if wpctl get-volume @DEFAULT_AUDIO_SINK@ 2>/dev/null | grep -qi "MUTED"; then
printf "\uf026\n"
else
printf "\uf028\n"
fi
+49
View File
@@ -0,0 +1,49 @@
@import "./colors.css";
window#waybar {
background: transparent;
box-shadow: none;
border: none;
}
#custom-volume-up,
#custom-volume-bar,
#custom-volume-down,
#custom-volume-icon {
background-color: @surface_container;
color: @primary;
font-size: 12px;
}
#custom-volume-up,
#custom-volume-bar,
#custom-volume-down {
margin: 0;
border-color: @primary;
border-style: solid;
}
#custom-volume-up {
padding: 4px 6px;
border-width: 2px 2px 0 2px;
border-radius: 10px 10px 0 0;
}
#custom-volume-bar {
padding: 0 2px;
border-width: 0 2px;
border-radius: 0;
}
#custom-volume-down {
padding: 4px 6px;
border-width: 0 2px 2px 2px;
border-radius: 0 0 10px 10px;
}
#custom-volume-icon {
padding: 4px 6px;
border: 2px solid @primary;
border-radius: 10px;
margin-top: 6px;
}
+24
View File
@@ -0,0 +1,24 @@
{
"layer": "overlay",
"exclusive": false,
"position": "right",
"width": 36,
"margin-top": 300,
"margin-bottom": 300,
"margin-left": 0,
"margin-right": 6,
"spacing": 0,
"include": [
"~/.config/sdgos/wayshell/configs/waybar-modules"
],
"modules-left": [
],
"modules-center": [
"custom/volume-up",
"custom/volume-bar",
"custom/volume-down",
"custom/volume-icon"
],
"modules-right": [
]
}
+33
View File
@@ -0,0 +1,33 @@
#!/bin/bash
BAR_WIDTH=20
get_volume() {
wpctl get-volume @DEFAULT_AUDIO_SINK@ 2>/dev/null | sed 's/.*: //' | awk '{printf "%.0f\n", $1 * 100}'
}
is_muted() {
wpctl get-volume @DEFAULT_AUDIO_SINK@ 2>/dev/null | grep -qi "MUTED" && echo "yes" || echo "no"
}
render_bar() {
local pct=$1
local filled=$(( pct * BAR_WIDTH / 100 ))
local empty=$(( BAR_WIDTH - filled ))
local text="▲"
for ((i=0; i<filled; i++)); do text+=$'\n'"█"; done
for ((i=0; i<empty; i++)); do text+=$'\n'"░"; done
text+=$'\n'"▼"
echo "$text"
}
pct=$(get_volume)
[[ -z "$pct" ]] && pct=0
muted=$(is_muted)
bar=$(render_bar "$pct")
cls="volume"
[[ "$muted" == "yes" ]] && cls+=" muted"
# Escape newlines for JSON
escaped=$(printf '%s' "$bar" | awk '{if(NR>1)printf "\\n"; printf "%s", $0}')
printf '{"text":"%s","class":"%s","percentage":%d,"alt":"%d%%"}\n' "$escaped" "$cls" "$pct" "$pct"
+43
View File
@@ -0,0 +1,43 @@
{
"custom/volume-up": {
"on-click": "wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+",
"format": "▲"
},
"custom/volume-bar": {
"exec": "~/.config/sdgos/wayshell/configs/volume-bar.sh",
"interval": 0.3,
"rotate": 90,
"on-scroll-up": "wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+",
"on-scroll-down": "wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-",
"format": "{}"
},
"custom/volume-down": {
"on-click": "wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-",
"format": "▼"
},
"custom/volume-icon": {
"exec": "~/.config/sdgos/wayshell/configs/volume-icon.sh",
"interval": 1,
"on-click": "pavucontrol",
"format": "{}"
},
"custom/brightness-up": {
"on-click": "brightnessctl set +5%",
"format": "▲"
},
"custom/brightness-bar": {
"exec": "~/.config/sdgos/wayshell/configs/brightness-bar.sh",
"interval": 1,
"rotate": 90,
"on-scroll-up": "brightnessctl set +5%",
"on-scroll-down": "brightnessctl set 5%-",
"format": "{}"
},
"custom/brightness-down": {
"on-click": "brightnessctl set 5%-",
"format": "▼"
},
"custom/brightness-icon": {
"format": ""
}
}
+8 -18
View File
@@ -15,15 +15,11 @@
# - mmsg # - mmsg
#=============================================================================== #===============================================================================
declare -A ACTIVE_LAYOUTS declare -A MONITOR_LAYOUT
make_key() {
echo "${1}:${2}:${3}"
}
process_tags_update() { process_tags_update() {
local json="$1" local json="$1"
local monitors monitor tag layout is_active key new_keys="" local monitors monitor tag layout is_active
monitors=$(jq -c '.all_tags[]' <<< "$json" 2>/dev/null) monitors=$(jq -c '.all_tags[]' <<< "$json" 2>/dev/null)
@@ -37,25 +33,19 @@ process_tags_update() {
tag=$(jq -r '.index' <<< "$tag_entry" 2>/dev/null) tag=$(jq -r '.index' <<< "$tag_entry" 2>/dev/null)
layout=$(jq -r '.layout' <<< "$tag_entry" 2>/dev/null) layout=$(jq -r '.layout' <<< "$tag_entry" 2>/dev/null)
is_active=$(jq -r '.is_active' <<< "$tag_entry" 2>/dev/null) is_active=$(jq -r '.is_active' <<< "$tag_entry" 2>/dev/null)
key=$(make_key "$monitor" "$tag" "$layout")
new_keys="$new_keys $key"
if [[ "$is_active" == "true" ]]; then if [[ "$is_active" == "true" ]]; then
if [[ -z "${ACTIVE_LAYOUTS[$key]}" ]]; then local prev="${MONITOR_LAYOUT[$monitor]}"
if [[ "$prev" != "$layout" ]]; then
if [[ -n "$prev" ]]; then
echo "{\"layout\":\"$prev\",\"state\":\"inactive\",\"monitor\":\"$monitor\",\"tag\":$tag}"
fi
echo "{\"layout\":\"$layout\",\"state\":\"active\",\"monitor\":\"$monitor\",\"tag\":$tag}" echo "{\"layout\":\"$layout\",\"state\":\"active\",\"monitor\":\"$monitor\",\"tag\":$tag}"
MONITOR_LAYOUT["$monitor"]="$layout"
fi fi
ACTIVE_LAYOUTS["$key"]="active"
fi fi
done < <(jq -c '.tags[]' <<< "$entry" 2>/dev/null) done < <(jq -c '.tags[]' <<< "$entry" 2>/dev/null)
done <<< "$monitors" done <<< "$monitors"
for key in "${!ACTIVE_LAYOUTS[@]}"; do
if [[ ! " $new_keys " =~ $key ]]; then
IFS=':' read -r monitor tag layout <<< "$key"
echo "{\"layout\":\"$layout\",\"state\":\"inactive\",\"monitor\":\"$monitor\",\"tag\":$tag}"
unset "ACTIVE_LAYOUTS[$key]"
fi
done
} }
if ! command -v mmsg &>/dev/null || ! command -v jq &>/dev/null; then if ! command -v mmsg &>/dev/null || ! command -v jq &>/dev/null; then
+3
View File
@@ -0,0 +1,3 @@
mode=editor
save_dir=/home/den/Pictures/temp
editor=satty --filename
+15 -5
View File
@@ -1,8 +1,18 @@
# Wayshell daemon configuration # Wayshell daemon configuration
# zone_buffer — distance in pixels from screen edge that defines a "zone" (default: 10) # zone_buffer — distance in pixels from screen edge that defines a "zone" (default: 10)
# on_delay — debounce delay in ms before triggering ON action (default: 100) # on_delay — default debounce delay in ms before triggering ON action (default: 100)
# off_delay — debounce delay in ms before triggering OFF action (default: 100) # off_delay — default debounce delay in ms before triggering OFF action (default: 100)
# Per-type overrides (fall back to on_delay/off_delay if unset):
# zone_on_delay / zone_off_delay
# layout_on_delay / layout_off_delay
# focused_on_delay / focused_off_delay
zone_buffer=30 zone_buffer=40
on_delay=500 on_delay=300
off_delay=500 off_delay=500
zone_on_delay=300
zone_off_delay=1500
layout_on_delay=200
layout_off_delay=0
focused_on_delay=50
focused_off_delay=500d
+28 -12
View File
@@ -1,5 +1,5 @@
# Wayshell module definitions # Wayshell module definitions
# Format: name,on_exec,off_exec,type,args... # Format: name|on_exec|off_exec|type|args...
# name — unique identifier for the module # name — unique identifier for the module
# on_exec — command executed when the condition becomes true # on_exec — command executed when the condition becomes true
# off_exec — command executed when the condition becomes false # off_exec — command executed when the condition becomes false
@@ -12,19 +12,35 @@
# Focused args: app_id (e.g. firefox, com.mitchellh.ghostty) # Focused args: app_id (e.g. firefox, com.mitchellh.ghostty)
# Zone modules — trigger when cursor enters/exits screen edges # Zone modules — trigger when cursor enters/exits screen edges
zone_left,notify-send "left show",notify-send "left hide",zone,0,0,30,1080 zone_left|mmsg dispatch spawn_shell,waybar -c ~/.config/sdgos/wayshell/configs/brightness.json -s ~/.config/sdgos/wayshell/configs/brightness.css|pkill -f "waybar -c /home/$(whoami)/.config/sdgos/wayshell/configs/brightness.json -s /home/$(whoami)/.config/sdgos/wayshell/configs/brightness.css"|zone|0,300,40,780
zone_right,notify-send "right show",notify-send "right hide",zone,1890,0,1920,1080 zone_right|mmsg dispatch spawn_shell,waybar -c ~/.config/sdgos/wayshell/configs/volume.json -s ~/.config/sdgos/wayshell/configs/volume.css|pkill -f "waybar -c /home/$(whoami)/.config/sdgos/wayshell/configs/volume.json -s /home/$(whoami)/.config/sdgos/wayshell/configs/volume.css"|zone|1880,300,1920,780
zone_top,notify-send "top show",notify-send "top hide",zone,0,0,1920,30 #zone_top|notify-send "top show"|notify-send "top hide"|zone|0,0,1920,30
zone_bottom,notify-send "bottom show",notify-send "bottom hide",zone,0,1050,1920,1080 #zone_bottom|notify-send "bottom show"|notify-send "bottom hide"|zone|0,1050,1920,1080
# Screenshot toolbar — triggered from top-center of any monitor (monitor-local)
zone_topcenter|mmsg dispatch spawn_shell,waybar -c ~/.config/sdgos/wayshell/configs/screenshot.json -s ~/.config/sdgos/wayshell/configs/screenshot.css|pkill -f "waybar -c /home/$(whoami)/.config/sdgos/wayshell/configs/screenshot.json -s /home/$(whoami)/.config/sdgos/wayshell/configs/screenshot.css"|zone|760,0,1160,40
# Layout modules — trigger when a layout is activated/deactivated on any tag # Layout modules — trigger when a layout is activated/deactivated on any tag
# Append a monitor name after the layout to restrict to one display: # Append a monitor name after the layout to restrict to one display:
# monocle_dp1,...,layout,M,DP-1 # monocle_dp1|...|...|layout|M,DP-1
#monocle,notify-send "monocle on HDMI",notify-send "monocle off HDMI",layout,M,HDMI-A-1
#monocle_dp1,notify-send "monocle on DP-1",notify-send "monocle off DP-1",layout,M,DP-1 # monocle bar
#monocle_dp3,notify-send "monocle on DP-3",notify-send "monocle off DP-2",layout,M,DP-3 monocle|mmsg dispatch spawn_shell,~/.config/sdgos/monocle/monocle.sh hdmi|pkill -f "waybar -c /home/$(whoami)/.config/sdgos/monocle/config-hdmi -s /home/den/.config/sdgos/monocle/style.css"|layout|M,HDMI-A-1
#dwindle,notify-send "dwindle on",notify-send "dwindle off",layout,DW,HDMI-A-1 monocle_dp1|mmsg dispatch spawn_shell,~/.config/sdgos/monocle/monocle.sh dp1|pkill -f "waybar -c /home/$(whoami)/.config/sdgos/monocle/config-dp1 -s /home/den/.config/sdgos/monocle/style.css"|M,DP-1
monocle_dp3|mmsg dispatch spawn_shell,~/.config/sdgos/monocle/monocle.sh dp3|pkill -f "waybar -c /home/$(whoami)/.config/sdgos/monocle/config-dp3 -s /home/den/.config/sdgos/monocle/style.css"|layout|M,DP-3
# monocle bar on deck
deck-hdmi|mmsg dispatch spawn_shell,~/.config/sdgos/monocle/monocle.sh hdmi|pkill -f "waybar -c /home/$(whoami)/.config/sdgos/monocle/config-hdmi -s /home/den/.config/sdgos/monocle/style.css"|layout|K,HDMI-A-1
deck-dp1|mmsg dispatch spawn_shell,~/.config/sdgos/monocle/monocle.sh dp1|pkill -f "waybar -c /home/$(whoami)/.config/sdgos/monocle/config-dp1 -s /home/den/.config/sdgos/monocle/style.css"|K,DP-1
deck-dp3|mmsg dispatch spawn_shell,~/.config/sdgos/monocle/monocle.sh dp3|pkill -f "waybar -c /home/$(whoami)/.config/sdgos/monocle/config-dp3 -s /home/den/.config/sdgos/monocle/style.css"|layout|K,DP-3
# monocle bar on vertical deck
vdeck-hdmi|mmsg dispatch spawn_shell,~/.config/sdgos/monocle/monocle.sh hdmi|pkill -f "waybar -c /home/$(whoami)/.config/sdgos/monocle/config-hdmi -s /home/den/.config/sdgos/monocle/style.css"|layout|VK,HDMI-A-1
vdeck-dp1|mmsg dispatch spawn_shell,~/.config/sdgos/monocle/monocle.sh dp1|pkill -f "waybar -c /home/$(whoami)/.config/sdgos/monocle/config-dp1 -s /home/den/.config/sdgos/monocle/style.css"|VK,DP-1
vdeck-dp3|mmsg dispatch spawn_shell,~/.config/sdgos/monocle/monocle.sh dp3|pkill -f "waybar -c /home/$(whoami)/.config/sdgos/monocle/config-dp3 -s /home/den/.config/sdgos/monocle/style.css"|layout|VK,DP-3
# Focused modules — trigger when specific app gains/loses focus # Focused modules — trigger when specific app gains/loses focus
#term_focused,notify-send "terminal focused",notify-send "terminal unfocused",focused,com.mitchellh.ghostty #term_focused|notify-send "terminal focused"|notify-send "terminal unfocused"|focused|com.mitchellh.ghostty
#browser_focused,notify-send "browser focused",notify-send "browser unfocused",focused,firefox #browser_focused|notify-send "browser focused"|notify-send "browser unfocused"|focused|firefox
+33 -12
View File
@@ -32,7 +32,14 @@ trap cleanup SIGTERM SIGINT EXIT
# --- Config --- # --- Config ---
ON_DELAY=$(grep -oP 'on_delay=\K[0-9]+' "$CONFIG_FILE" 2>/dev/null || echo "100") ON_DELAY=$(grep -oP 'on_delay=\K[0-9]+' "$CONFIG_FILE" 2>/dev/null || echo "100")
OFF_DELAY=$(grep -oP 'off_delay=\K[0-9]+' "$CONFIG_FILE" 2>/dev/null || echo "100") OFF_DELAY=$(grep -oP 'off_delay=\K[0-9]+' "$CONFIG_FILE" 2>/dev/null || echo "100")
echo "Config: on_delay=$ON_DELAY, off_delay=$OFF_DELAY"
ZONE_ON_DELAY=$(grep -oP 'zone_on_delay=\K[0-9]+' "$CONFIG_FILE" 2>/dev/null || echo "$ON_DELAY")
ZONE_OFF_DELAY=$(grep -oP 'zone_off_delay=\K[0-9]+' "$CONFIG_FILE" 2>/dev/null || echo "$OFF_DELAY")
LAYOUT_ON_DELAY=$(grep -oP 'layout_on_delay=\K[0-9]+' "$CONFIG_FILE" 2>/dev/null || echo "$ON_DELAY")
LAYOUT_OFF_DELAY=$(grep -oP 'layout_off_delay=\K[0-9]+' "$CONFIG_FILE" 2>/dev/null || echo "$OFF_DELAY")
FOCUSED_ON_DELAY=$(grep -oP 'focused_on_delay=\K[0-9]+' "$CONFIG_FILE" 2>/dev/null || echo "$ON_DELAY")
FOCUSED_OFF_DELAY=$(grep -oP 'focused_off_delay=\K[0-9]+' "$CONFIG_FILE" 2>/dev/null || echo "$OFF_DELAY")
echo "Config: on_delay=$ON_DELAY, off_delay=$OFF_DELAY zone_on=$ZONE_ON_DELAY zone_off=$ZONE_OFF_DELAY layout_on=$LAYOUT_ON_DELAY layout_off=$LAYOUT_OFF_DELAY focused_on=$FOCUSED_ON_DELAY focused_off=$FOCUSED_OFF_DELAY"
# --- Storage --- # --- Storage ---
declare -A MODULES declare -A MODULES
@@ -45,10 +52,10 @@ parse_modules() {
echo "Parsing modules from $MODULES_FILE" echo "Parsing modules from $MODULES_FILE"
[[ -f "$MODULES_FILE" ]] || { echo "ERROR: Modules file not found"; exit 1; } [[ -f "$MODULES_FILE" ]] || { echo "ERROR: Modules file not found"; exit 1; }
local count=0 local count=0
while IFS=',' read -r name onexec offexec type args; do while IFS='|' read -r name onexec offexec type args; do
name="${name// /}" name="${name// /}"
[[ "$name" =~ ^#.*$ || -z "$name" ]] && continue [[ "$name" =~ ^#.*$ || -z "$name" ]] && continue
MODULES["$name"]="$onexec,$offexec,$type,$args" MODULES["$name"]="$onexec|$offexec|$type|$args"
MODULE_STATES["$name"]="disabled" MODULE_STATES["$name"]="disabled"
((count++)) ((count++))
echo " [$count] $name ($type)" echo " [$count] $name ($type)"
@@ -61,7 +68,7 @@ parse_modules
modules_by_type() { modules_by_type() {
local t="$1" local t="$1"
for n in "${!MODULES[@]}"; do for n in "${!MODULES[@]}"; do
IFS=',' read -r _ _ mt _ <<< "${MODULES[$n]}" IFS='|' read -r _ _ mt _ <<< "${MODULES[$n]}"
[[ "$mt" == "$t" ]] && echo "$n" [[ "$mt" == "$t" ]] && echo "$n"
done done
} }
@@ -89,17 +96,24 @@ get_monitor_offset() {
# --- Check debounce timers and fire actions --- # --- Check debounce timers and fire actions ---
# Called every ~50ms from the main event loop. # Called every ~50ms from the main event loop.
check_fires() { check_fires() {
local now name onexec offexec local now name onexec offexec mtype on_delay off_delay
now=$(date +%s%3N) now=$(date +%s%3N)
# Pending ON fires # Pending ON fires
for name in "${!MODULE_ENTER_TS[@]}"; do for name in "${!MODULE_ENTER_TS[@]}"; do
local st=${MODULE_STATES[$name]} local st=${MODULE_STATES[$name]}
[[ "$st" != "pending_on" && "$st" != "pending_off" ]] && continue [[ "$st" != "pending_on" && "$st" != "pending_off" ]] && continue
if (( now - MODULE_ENTER_TS[$name] >= ON_DELAY )); then IFS='|' read -r _ _ mtype _ <<< "${MODULES[$name]}"
case "$mtype" in
zone) on_delay=$ZONE_ON_DELAY ;;
layout) on_delay=$LAYOUT_ON_DELAY ;;
focused) on_delay=$FOCUSED_ON_DELAY ;;
*) on_delay=$ON_DELAY ;;
esac
if (( now - MODULE_ENTER_TS[$name] >= on_delay )); then
if [[ "$st" == "pending_on" ]]; then if [[ "$st" == "pending_on" ]]; then
MODULE_STATES["$name"]="enabled" MODULE_STATES["$name"]="enabled"
IFS=',' read -r onexec _ _ _ <<< "${MODULES[$name]}" IFS='|' read -r onexec _ _ _ <<< "${MODULES[$name]}"
echo "ON $name" echo "ON $name"
eval "$onexec" & eval "$onexec" &
fi fi
@@ -111,9 +125,16 @@ check_fires() {
for name in "${!MODULE_EXIT_TS[@]}"; do for name in "${!MODULE_EXIT_TS[@]}"; do
local st=${MODULE_STATES[$name]} local st=${MODULE_STATES[$name]}
[[ "$st" != "pending_off" && "$st" != "enabled" ]] && continue [[ "$st" != "pending_off" && "$st" != "enabled" ]] && continue
if (( now - MODULE_EXIT_TS[$name] >= OFF_DELAY )); then IFS='|' read -r _ _ mtype _ <<< "${MODULES[$name]}"
case "$mtype" in
zone) off_delay=$ZONE_OFF_DELAY ;;
layout) off_delay=$LAYOUT_OFF_DELAY ;;
focused) off_delay=$FOCUSED_OFF_DELAY ;;
*) off_delay=$OFF_DELAY ;;
esac
if (( now - MODULE_EXIT_TS[$name] >= off_delay )); then
MODULE_STATES["$name"]="disabled" MODULE_STATES["$name"]="disabled"
IFS=',' read -r _ offexec _ _ <<< "${MODULES[$name]}" IFS='|' read -r _ offexec _ _ <<< "${MODULES[$name]}"
echo "OFF $name" echo "OFF $name"
eval "$offexec" & eval "$offexec" &
unset "MODULE_EXIT_TS[$name]" unset "MODULE_EXIT_TS[$name]"
@@ -159,7 +180,7 @@ process_zone_event() {
while IFS= read -r module_name; do while IFS= read -r module_name; do
[[ -z "$module_name" ]] && continue [[ -z "$module_name" ]] && continue
IFS=',' read -r onexec offexec _ args <<< "${MODULES[$module_name]}" IFS='|' read -r onexec offexec _ args <<< "${MODULES[$module_name]}"
IFS=',' read -r x1 y1 x2 y2 <<< "$args" IFS=',' read -r x1 y1 x2 y2 <<< "$args"
local ax1=$(( x1 + mx )) ay1=$(( y1 + my )) local ax1=$(( x1 + mx )) ay1=$(( y1 + my ))
local ax2=$(( x2 + mx )) ay2=$(( y2 + my )) local ax2=$(( x2 + mx )) ay2=$(( y2 + my ))
@@ -195,7 +216,7 @@ process_layout_event() {
local now; now=$(date +%s%3N) local now; now=$(date +%s%3N)
while IFS= read -r module_name; do while IFS= read -r module_name; do
[[ -z "$module_name" ]] && continue [[ -z "$module_name" ]] && continue
IFS=',' read -r onexec offexec _ args <<< "${MODULES[$module_name]}" IFS='|' read -r onexec offexec _ args <<< "${MODULES[$module_name]}"
# args = "layout_name" or "layout_name,monitor_name" # args = "layout_name" or "layout_name,monitor_name"
local expected_layout="${args%%,*}" local expected_layout="${args%%,*}"
local expected_monitor="" local expected_monitor=""
@@ -223,7 +244,7 @@ process_focused_event() {
local now; now=$(date +%s%3N) local now; now=$(date +%s%3N)
while IFS= read -r module_name; do while IFS= read -r module_name; do
[[ -z "$module_name" ]] && continue [[ -z "$module_name" ]] && continue
IFS=',' read -r onexec offexec _ expected <<< "${MODULES[$module_name]}" IFS='|' read -r onexec offexec _ expected <<< "${MODULES[$module_name]}"
[[ "$app_id" != "$expected" ]] && continue [[ "$app_id" != "$expected" ]] && continue
local st=${MODULE_STATES[$module_name]} local st=${MODULE_STATES[$module_name]}
if [[ "$state" == "focused" && "$st" == "disabled" ]]; then if [[ "$state" == "focused" && "$st" == "disabled" ]]; then