Regenerated
This commit is contained in:
+400
-329
File diff suppressed because it is too large
Load Diff
+94
-29
@@ -2621,13 +2621,13 @@ in
|
||||
force = true;
|
||||
executable = true;
|
||||
};
|
||||
".config/waybar/scripts/workspaceswindows.sh" = {
|
||||
text = builtins.readFile "${assetPath}/scripts/workspaceswindows.sh";
|
||||
".config/waybar/scripts/hypr-workspaces.sh" = {
|
||||
text = builtins.readFile "${assetPath}/scripts/hypr-workspaces.sh";
|
||||
force = true;
|
||||
executable = true;
|
||||
};
|
||||
".config/waybar/scripts/workspaceswindowsmenu.sh" = {
|
||||
text = builtins.readFile "${assetPath}/scripts/workspaceswindowsmenu.sh";
|
||||
".config/waybar/scripts/hypr-workspacesmenu.sh" = {
|
||||
text = builtins.readFile "${assetPath}/scripts/hypr-workspacesmenu.sh";
|
||||
force = true;
|
||||
executable = true;
|
||||
};
|
||||
@@ -2663,7 +2663,10 @@ These are config files for waybar
|
||||
|
||||
//"modules-left": ["hyprland/window"],
|
||||
|
||||
"modules-center": ["hyprland/workspaces" ],
|
||||
"modules-center": [
|
||||
"hyprland/workspaces"
|
||||
"custom/hypr-workspaces"
|
||||
],
|
||||
|
||||
"modules-right": [
|
||||
"idle_inhibitor",
|
||||
@@ -2678,6 +2681,15 @@ These are config files for waybar
|
||||
"clock",
|
||||
],
|
||||
|
||||
"custom/hypr-workspaces": {
|
||||
"exec": "~/.config/waybar/scripts/hypr-workspaces.sh",
|
||||
"interval": 2,
|
||||
"return-type": "json",
|
||||
"format": "{name}",
|
||||
"on-click": "~/.config/waybar/scripts/hypr-workspacesmenu.sh",
|
||||
"tooltip": true
|
||||
}
|
||||
|
||||
"custom/bluetooth": {
|
||||
"exec": "~/.config/waybar/scripts/bluetooth-status.sh",
|
||||
"interval": 5,
|
||||
@@ -2824,6 +2836,28 @@ window#waybar {
|
||||
linear-gradient(45deg, @blue, @green) border-box;
|
||||
}
|
||||
|
||||
/* Hyprland Workspaces module */
|
||||
#custom-hypr-workspaces {
|
||||
display: flex;
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
#custom-hypr-workspaces > * {
|
||||
padding: 0 6px;
|
||||
border-radius: 10px;
|
||||
min-width: 50px;
|
||||
text-align: center;
|
||||
background: linear-gradient(45deg, @blue, @green);
|
||||
color: @text;
|
||||
font-weight: bold;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
#custom-hypr-workspaces > *:hover {
|
||||
background: linear-gradient(45deg, @green, @blue);
|
||||
}
|
||||
|
||||
#clock,
|
||||
#idle_inhibitor,
|
||||
#battery,
|
||||
@@ -2906,29 +2940,60 @@ fi
|
||||
printf '{"text": "%s", "tooltip": "%s"}\n' "$icon" "$tooltip"
|
||||
#+END_SRC
|
||||
|
||||
** =.config/waybar/scripts/workspaceswindows.sh=
|
||||
** =.config/waybar/scripts/hypr-workspaces.sh=
|
||||
These are config files for waybar
|
||||
#+BEGIN_SRC sh :tangle generated/.config/waybar/scripts/workspaceswindows.sh :noweb yes :mkdirp yes :eval never
|
||||
#!/usr/bin/env bash
|
||||
#+BEGIN_SRC sh :tangle generated/.config/waybar/scripts/hypr-workspaces.sh :noweb yes :mkdirp yes :eval never
|
||||
#!/bin/bash
|
||||
|
||||
# Get active workspace ID
|
||||
active_ws=$(hyprctl activeworkspace -j | jq -r '.id')
|
||||
# Get all workspaces
|
||||
# Using hyprctl JSON output
|
||||
workspaces=$(hyprctl workspaces -j)
|
||||
|
||||
# Count clients in the active workspace
|
||||
clients=$(hyprctl -j clients | jq --argjson w "$active_ws" '[.[] | select(.workspace.id==$w)] | length')
|
||||
# Initialize output JSON
|
||||
json="["
|
||||
|
||||
# Output valid JSON for Waybar
|
||||
if [ "$clients" -eq 0 ]; then
|
||||
echo "{\"text\":\"$active_ws\"}"
|
||||
else
|
||||
echo "{\"text\":\"$active_ws ★ $clients\"}"
|
||||
fi
|
||||
index=0
|
||||
for ws in $(echo "$workspaces" | jq -r '.[] | @base64'); do
|
||||
_jq() {
|
||||
echo "$ws" | base64 --decode | jq -r "$1"
|
||||
}
|
||||
|
||||
ws_id=$(_jq '.id')
|
||||
ws_name=$(_jq '.name')
|
||||
|
||||
# Get windows in this workspace
|
||||
windows=$(hyprctl clients -j | jq -r ".[] | select(.workspace.id==$ws_id) | \"\(.id): \(.title)\"")
|
||||
|
||||
# Format tooltip: sequential numbering
|
||||
tooltip=""
|
||||
count=1
|
||||
while read -r win; do
|
||||
tooltip+="$count. $win\n"
|
||||
count=$((count+1))
|
||||
done <<< "$windows"
|
||||
|
||||
# If no windows
|
||||
if [ -z "$tooltip" ]; then
|
||||
tooltip="No windows"
|
||||
fi
|
||||
|
||||
# Output JSON for Waybar
|
||||
json+=$(jq -n \
|
||||
--arg name "$ws_name" \
|
||||
--arg tooltip "$tooltip" \
|
||||
'{text: $name, tooltip: $tooltip}')
|
||||
|
||||
index=$((index+1))
|
||||
[ $index -lt $(echo "$workspaces" | jq length) ] && json+=","
|
||||
done
|
||||
|
||||
json+="]"
|
||||
echo "$json"
|
||||
#+END_SRC
|
||||
|
||||
** =.config/waybar/scripts/workspaceswindowsmenu.sh=
|
||||
** =.config/waybar/scripts/hypr-workspacesmenu.sh=
|
||||
These are config files for waybar
|
||||
#+BEGIN_SRC sh :tangle generated/.config/waybar/scripts/workspaceswindowsmenu.sh :noweb yes :mkdirp yes :eval never
|
||||
#+BEGIN_SRC sh :tangle generated/.config/waybar/scripts/hypr-workspacesmenu.sh :noweb yes :mkdirp yes :eval never
|
||||
#!/usr/bin/env bash
|
||||
active_ws=$(hyprctl activeworkspace -j | jq -r '.id')
|
||||
clients=$(hyprctl clients -j | jq -r \
|
||||
@@ -3382,7 +3447,7 @@ window#waybar {
|
||||
linear-gradient(45deg, @blue, @green) border-box;
|
||||
}
|
||||
|
||||
#custom-workspaceswindows.overflow {
|
||||
#custom-hypr-workspaces.overflow {
|
||||
padding: 0px 1px;
|
||||
min-width: 80px;
|
||||
color: @text;
|
||||
@@ -3395,14 +3460,14 @@ window#waybar {
|
||||
linear-gradient(45deg, @blue, @green) border-box;
|
||||
}
|
||||
|
||||
#custom-workspaceswindows.overflow {
|
||||
#custom-hypr-workspaces.overflow {
|
||||
background:
|
||||
linear-gradient(rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.05))
|
||||
padding-box,
|
||||
linear-gradient(45deg, @blue, @green) border-box;
|
||||
}
|
||||
|
||||
#custom-workspaceswindows.hidden {
|
||||
#custom-hypr-workspaces.hidden {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
min-width: 0;
|
||||
@@ -3486,12 +3551,12 @@ window#waybar {
|
||||
}
|
||||
|
||||
/* =========================================================
|
||||
* Hyprscroll overflow indicator (custom/workspaceswindows)
|
||||
* Hyprscroll overflow indicator (custom/hypr-workspaces)
|
||||
* States: .ok, .overflow, .error
|
||||
* ========================================================= */
|
||||
|
||||
/* Default (no overflow): subtle pill, still hoverable for tooltip */
|
||||
#custom-workspaceswindows.ok {
|
||||
#custom-hypr-workspaces.ok {
|
||||
padding: 0px 1px;
|
||||
min-width: 80px;
|
||||
color: @subtext1;
|
||||
@@ -3503,7 +3568,7 @@ window#waybar {
|
||||
}
|
||||
|
||||
/* Make it feel interactive (hover) */
|
||||
#custom-workspaceswindows.ok:hover {
|
||||
#custom-hypr-workspaces.ok:hover {
|
||||
color: @text;
|
||||
background-color: @surface1;
|
||||
border: 1px solid rgba(255, 255, 255, 0.18);
|
||||
@@ -3511,7 +3576,7 @@ window#waybar {
|
||||
|
||||
/* Overflow state: you already have this; keep it.
|
||||
Optional: add hover tweak so it "pops" a bit. */
|
||||
#custom-workspaceswindows.overflow:hover {
|
||||
#custom-hypr-workspaces.overflow:hover {
|
||||
background:
|
||||
linear-gradient(rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.1))
|
||||
padding-box,
|
||||
@@ -3519,7 +3584,7 @@ window#waybar {
|
||||
}
|
||||
|
||||
/* Error state: clear but not screaming */
|
||||
#custom-workspaceswindows.error {
|
||||
#custom-hypr-workspaces.error {
|
||||
padding: 0px 1px;
|
||||
min-width: 80px;
|
||||
color: @text;
|
||||
@@ -3531,7 +3596,7 @@ window#waybar {
|
||||
}
|
||||
|
||||
/* Optional: if you keep .hidden in the script for any reason */
|
||||
#custom-workspaceswindows.hidden {
|
||||
#custom-hypr-workspaces.hidden {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
min-width: 0;
|
||||
|
||||
@@ -4,7 +4,10 @@
|
||||
|
||||
//"modules-left": ["hyprland/window"],
|
||||
|
||||
"modules-center": ["hyprland/workspaces" ],
|
||||
"modules-center": [
|
||||
"hyprland/workspaces"
|
||||
"custom/hypr-workspaces"
|
||||
],
|
||||
|
||||
"modules-right": [
|
||||
"idle_inhibitor",
|
||||
@@ -19,6 +22,15 @@
|
||||
"clock",
|
||||
],
|
||||
|
||||
"custom/hypr-workspaces": {
|
||||
"exec": "~/.config/waybar/scripts/hypr-workspaces.sh",
|
||||
"interval": 2,
|
||||
"return-type": "json",
|
||||
"format": "{name}",
|
||||
"on-click": "~/.config/waybar/scripts/hypr-workspacesmenu.sh",
|
||||
"tooltip": true
|
||||
}
|
||||
|
||||
"custom/bluetooth": {
|
||||
"exec": "~/.config/waybar/scripts/bluetooth-status.sh",
|
||||
"interval": 5,
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Get all workspaces
|
||||
# Using hyprctl JSON output
|
||||
workspaces=$(hyprctl workspaces -j)
|
||||
|
||||
# Initialize output JSON
|
||||
json="["
|
||||
|
||||
index=0
|
||||
for ws in $(echo "$workspaces" | jq -r '.[] | @base64'); do
|
||||
_jq() {
|
||||
echo "$ws" | base64 --decode | jq -r "$1"
|
||||
}
|
||||
|
||||
ws_id=$(_jq '.id')
|
||||
ws_name=$(_jq '.name')
|
||||
|
||||
# Get windows in this workspace
|
||||
windows=$(hyprctl clients -j | jq -r ".[] | select(.workspace.id==$ws_id) | \"\(.id): \(.title)\"")
|
||||
|
||||
# Format tooltip: sequential numbering
|
||||
tooltip=""
|
||||
count=1
|
||||
while read -r win; do
|
||||
tooltip+="$count. $win\n"
|
||||
count=$((count+1))
|
||||
done <<< "$windows"
|
||||
|
||||
# If no windows
|
||||
if [ -z "$tooltip" ]; then
|
||||
tooltip="No windows"
|
||||
fi
|
||||
|
||||
# Output JSON for Waybar
|
||||
json+=$(jq -n \
|
||||
--arg name "$ws_name" \
|
||||
--arg tooltip "$tooltip" \
|
||||
'{text: $name, tooltip: $tooltip}')
|
||||
|
||||
index=$((index+1))
|
||||
[ $index -lt $(echo "$workspaces" | jq length) ] && json+=","
|
||||
done
|
||||
|
||||
json+="]"
|
||||
echo "$json"
|
||||
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
active_ws=$(hyprctl activeworkspace -j | jq -r '.id')
|
||||
clients=$(hyprctl clients -j | jq -r \
|
||||
".[] | select(.workspace.id==$active_ws) | \"\(.address)|\(.title)\"")
|
||||
choice=$(echo "$clients" | cut -d'|' -f2 | wofi -dmenu -j -p "Windows")
|
||||
[ -z "$choice" ] && exit 0
|
||||
addr=$(echo "$clients" | grep "|$choice" | head -n1 | cut -d'|' -f1)
|
||||
hyprctl dispatch focuswindow address:$addr
|
||||
@@ -66,7 +66,7 @@ window#waybar {
|
||||
linear-gradient(45deg, @blue, @green) border-box;
|
||||
}
|
||||
|
||||
#custom-workspaceswindows.overflow {
|
||||
#custom-hypr-workspaces.overflow {
|
||||
padding: 0px 1px;
|
||||
min-width: 80px;
|
||||
color: @text;
|
||||
@@ -79,14 +79,14 @@ window#waybar {
|
||||
linear-gradient(45deg, @blue, @green) border-box;
|
||||
}
|
||||
|
||||
#custom-workspaceswindows.overflow {
|
||||
#custom-hypr-workspaces.overflow {
|
||||
background:
|
||||
linear-gradient(rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.05))
|
||||
padding-box,
|
||||
linear-gradient(45deg, @blue, @green) border-box;
|
||||
}
|
||||
|
||||
#custom-workspaceswindows.hidden {
|
||||
#custom-hypr-workspaces.hidden {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
min-width: 0;
|
||||
@@ -170,12 +170,12 @@ window#waybar {
|
||||
}
|
||||
|
||||
/* =========================================================
|
||||
* Hyprscroll overflow indicator (custom/workspaceswindows)
|
||||
* Hyprscroll overflow indicator (custom/hypr-workspaces)
|
||||
* States: .ok, .overflow, .error
|
||||
* ========================================================= */
|
||||
|
||||
/* Default (no overflow): subtle pill, still hoverable for tooltip */
|
||||
#custom-workspaceswindows.ok {
|
||||
#custom-hypr-workspaces.ok {
|
||||
padding: 0px 1px;
|
||||
min-width: 80px;
|
||||
color: @subtext1;
|
||||
@@ -187,7 +187,7 @@ window#waybar {
|
||||
}
|
||||
|
||||
/* Make it feel interactive (hover) */
|
||||
#custom-workspaceswindows.ok:hover {
|
||||
#custom-hypr-workspaces.ok:hover {
|
||||
color: @text;
|
||||
background-color: @surface1;
|
||||
border: 1px solid rgba(255, 255, 255, 0.18);
|
||||
@@ -195,7 +195,7 @@ window#waybar {
|
||||
|
||||
/* Overflow state: you already have this; keep it.
|
||||
Optional: add hover tweak so it "pops" a bit. */
|
||||
#custom-workspaceswindows.overflow:hover {
|
||||
#custom-hypr-workspaces.overflow:hover {
|
||||
background:
|
||||
linear-gradient(rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.1))
|
||||
padding-box,
|
||||
@@ -203,7 +203,7 @@ window#waybar {
|
||||
}
|
||||
|
||||
/* Error state: clear but not screaming */
|
||||
#custom-workspaceswindows.error {
|
||||
#custom-hypr-workspaces.error {
|
||||
padding: 0px 1px;
|
||||
min-width: 80px;
|
||||
color: @text;
|
||||
@@ -215,7 +215,7 @@ window#waybar {
|
||||
}
|
||||
|
||||
/* Optional: if you keep .hidden in the script for any reason */
|
||||
#custom-workspaceswindows.hidden {
|
||||
#custom-hypr-workspaces.hidden {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
min-width: 0;
|
||||
|
||||
@@ -24,13 +24,13 @@ in
|
||||
force = true;
|
||||
executable = true;
|
||||
};
|
||||
".config/waybar/scripts/workspaceswindows.sh" = {
|
||||
text = builtins.readFile "${assetPath}/scripts/workspaceswindows.sh";
|
||||
".config/waybar/scripts/hypr-workspaces.sh" = {
|
||||
text = builtins.readFile "${assetPath}/scripts/hypr-workspaces.sh";
|
||||
force = true;
|
||||
executable = true;
|
||||
};
|
||||
".config/waybar/scripts/workspaceswindowsmenu.sh" = {
|
||||
text = builtins.readFile "${assetPath}/scripts/workspaceswindowsmenu.sh";
|
||||
".config/waybar/scripts/hypr-workspacesmenu.sh" = {
|
||||
text = builtins.readFile "${assetPath}/scripts/hypr-workspacesmenu.sh";
|
||||
force = true;
|
||||
executable = true;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user