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
+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": ""
}
}