From 0b543b4017784e023e8f5bdccd8922ec9ac3b373 Mon Sep 17 00:00:00 2001 From: "info@data-pro.nu" Date: Thu, 2 Apr 2026 22:25:30 +0200 Subject: [PATCH] Regenerated --- Droidnix/README.html | 729 ++++++++++-------- Droidnix/README.org | 123 ++- Droidnix/generated/.config/waybar/config | 14 +- .../.config/waybar/scripts/hypr-workspaces.sh | 46 ++ .../waybar/scripts/hypr-workspacesmenu.sh | 8 + Droidnix/generated/.config/waybar/style.css | 18 +- .../modules/traveldroid/desktop/waybar.nix | 8 +- 7 files changed, 574 insertions(+), 372 deletions(-) create mode 100644 Droidnix/generated/.config/waybar/scripts/hypr-workspaces.sh create mode 100644 Droidnix/generated/.config/waybar/scripts/hypr-workspacesmenu.sh diff --git a/Droidnix/README.html b/Droidnix/README.html index 5db54d9c1..c82b65e10 100644 --- a/Droidnix/README.html +++ b/Droidnix/README.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Droidnix: A Dendritic NixOS + Home Manager Configuration NixOS Configuration Structure @@ -204,121 +204,121 @@

Table of Contents

-
-

Shortcuts

-
+
+

Shortcuts

+

Introduction The Assets Folder @@ -334,26 +334,26 @@

Introduction   intro

-
-

What is Droidnix

-
+
+

What is Droidnix

+

Droidnix is a modular, declarative NixOS + Home Manager configuration system. It allows users to choose between Hyprland and Mangowc as their window manager, with shared and WM-specific configurations managed via Emacs Org and Nix Flakes. The project is designed for reproducibility, maintainability, and cross-machine compatibility.

-
-

Installed components:

-
+
+

Installed components:

+
    -
  • Core
  • -
  • Hyprland
  • -
  • Mangowc
  • +
  • Core
  • +
  • Hyprland
  • +
  • Mangowc
-
-

Goals, project Structure, import hierarchy

-
+
+

Goals, project Structure, import hierarchy

+

This project uses a modular NixOS configuration with Hyprland and MangoWC support, designed for literate programming and cross-device reusability. The Droidnix repository is organized into two main parts: @@ -366,9 +366,9 @@ The Droidnix repository is organized into two main parts:

-
-

Root Level

-
+
+

Root Level

+
  • flake.nix is the entry point and imports:
      @@ -379,16 +379,16 @@ The Droidnix repository is organized into two main parts:
-
-

Generated Structure

-
+
+

Generated Structure

+

The generated/ directory contains all generated configurations, divided into three main groups: system, hyprland, and mangowc.

-
-

First Setup

-
+
+

First Setup

+
  1. Clone this repository.
  2. Run the setup script: ./setup_droid.
  3. @@ -418,9 +418,9 @@ The .assets/ folder contains all static files, such as configs, scr This section contains the Org blocks for tangling Nix code into the generated folders.

-
-

flake.nix

-
+
+

flake.nix

+

The Nix flake definition for Droidnix.

@@ -489,9 +489,9 @@ The Nix flake definition for Droidnix.
-
-

generated/hosts/traveldroid/host.nix

-
+
+

generated/hosts/traveldroid/host.nix

+
{ lib, config, pkgs, flakeRoot, import-tree, home-manager, ... }:
 
@@ -549,9 +549,9 @@ in
 
-
-

generated/hosts/traveldroid/hardware-configuration.nix

-
+
+

generated/hosts/traveldroid/hardware-configuration.nix

+
  1. Boot into NixOS Live ISO or your installed system.
  2. Open a terminal.
  3. @@ -609,9 +609,9 @@ in
-
-

generated/hosts/traveldroid/boot.nix

-
+
+

generated/hosts/traveldroid/boot.nix

+
{ config, pkgs, lib, flakeRoot, ... }:
 
@@ -660,17 +660,17 @@ in
 
-
-

Following are the imported modules

+
+

Following are the imported modules

-
-

generated/traveldroid/modules/apps

-
+
+

generated/traveldroid/modules/apps

+
-
-

generated/modules/traveldroid/apps/2_b_installed.nix

-
+
+

generated/modules/traveldroid/apps/2_b_installed.nix

+

This installs a list of apps

@@ -778,9 +778,9 @@ in {
-
-

generated/assets/2_b_installed.conf

-
+
+

generated/assets/2_b_installed.conf

+

This is a list of additional apps to install

@@ -833,9 +833,9 @@ com.todoist.Todoist
-
-

generated/modules/traveldroid/apps/flameshot.nix

-
+
+

generated/modules/traveldroid/apps/flameshot.nix

+

This is top file of this level which contains just an import statement for all relevant files and/or the subfolder in this folder

@@ -874,9 +874,9 @@ in
-
-

generated/modules/traveldroid/apps/kitty.nix

-
+
+

generated/modules/traveldroid/apps/kitty.nix

+

This file sets up Kitty terminal

@@ -934,9 +934,9 @@ in
-
-

generated/modules/traveldroid/apps/starship.nix

-
+
+

generated/modules/traveldroid/apps/starship.nix

+

This file sets up starship prompt

@@ -975,9 +975,9 @@ in
-
-

.config/starship.toml

-
+
+

.config/starship.toml

+

These are config files for .config

@@ -1266,9 +1266,9 @@ crust = "#181926"
-
-

generated/modules/traveldroid/apps/thunar.nix

-
+
+

generated/modules/traveldroid/apps/thunar.nix

+

This is top file of this level which contains just an import statement for all relevant files and/or the subfolder in this folder

@@ -1309,9 +1309,9 @@ in
-
-

generated/modules/traveldroid/apps/wofi.nix

-
+
+

generated/modules/traveldroid/apps/wofi.nix

+

This is the install for Wofi, the launcher

@@ -1344,9 +1344,9 @@ in
-
-

.config/wofi/config

-
+
+

.config/wofi/config

+

These are config files for .config/wofi

@@ -1393,9 +1393,9 @@ prompt = >
-
-

.config/wofi/style.css

-
+
+

.config/wofi/style.css

+

These are config files for .config/wofi

@@ -1484,9 +1484,9 @@ These are config files for .config/wofi
-
-

generated/modules/traveldroid/apps/zenbrowser.nix

-
+
+

generated/modules/traveldroid/apps/zenbrowser.nix

+

This installs zen browser

@@ -1506,9 +1506,9 @@ in
-
-

generated/modules/traveldroid/apps/zsh.nix

-
+
+

generated/modules/traveldroid/apps/zsh.nix

+

This sets up the zsh in the terminal

@@ -1571,9 +1571,9 @@ in
-
-

=generated/.config/zsh/.zshrc

-
+
+

=generated/.config/zsh/.zshrc

+

This sets up the zsh in the terminal

@@ -1594,9 +1594,9 @@ fi
-
-

generated/modules/traveldroid/apps/emacs/emacs.nix

-
+
+

generated/modules/traveldroid/apps/emacs/emacs.nix

+

This installs emacs

@@ -1692,9 +1692,9 @@ in
-
-

generated/.config/emacs/early-init.el

-
+
+

generated/.config/emacs/early-init.el

+

This contaions emacs

@@ -1795,9 +1795,9 @@ package-archive-priorities '(("gnu" . 99)
-
-

generated/.config/emacs/init.el

-
+
+

generated/.config/emacs/init.el

+

This contaions emacs

@@ -2208,13 +2208,13 @@ the top of the file."
-
-

generated/modules/traveldroid/desktop

-
+
+

generated/modules/traveldroid/desktop

+
-
-

generated/modules/traveldroid/desktop/fonts.nix

-
+
+

generated/modules/traveldroid/desktop/fonts.nix

+

This file installs and configures fonts

@@ -2232,9 +2232,9 @@ This file installs and configures fonts
-
-

generated/modules/traveldroid/desktop/gtk.nix

-
+
+

generated/modules/traveldroid/desktop/gtk.nix

+

Setting up GTK

@@ -2260,9 +2260,9 @@ in
-
-

generated/modules/traveldroid/desktop/hyprland.nix

-
+
+

generated/modules/traveldroid/desktop/hyprland.nix

+

Setting up Hyprland

@@ -2309,9 +2309,9 @@ in
-
-

.config/hypr/animations.conf

-
+
+

.config/hypr/animations.conf

+

These are config files for .config/hypr

@@ -2332,9 +2332,9 @@ animations {
-
-

.config/hypr/behaviour.conf

-
+
+

.config/hypr/behaviour.conf

+

These are config files for .config/hypr

@@ -2348,9 +2348,9 @@ These are config files for .config/hypr
-
-

.config/hypr/bindings.conf

-
+
+

.config/hypr/bindings.conf

+

These are config files for .config/hypr

@@ -2513,9 +2513,9 @@ bind = $mainMod, W, exec, zen
-
-

.config/hypr/exec-once.conf

-
+
+

.config/hypr/exec-once.conf

+

These are config files for .config/hypr

@@ -2531,9 +2531,9 @@ exec-once = sh ~/Wallpapers/scripts/wallpaper.sh &
-
-

.config/hypr/hypridle.conf

-
+
+

.config/hypr/hypridle.conf

+

These are config files for .config/hypr

@@ -2558,9 +2558,9 @@ listener {
-
-

.config/hypr/hyprland.conf

-
+
+

.config/hypr/hyprland.conf

+

These are config files for .config/hypr

@@ -2607,9 +2607,9 @@ misc {
-
-

.config/hypr/hyprlock.conf

-
+
+

.config/hypr/hyprlock.conf

+

These are config files for .config/hypr

@@ -2650,9 +2650,9 @@ label {
-
-

.config/hypr/layer-rules.conf

-
+
+

.config/hypr/layer-rules.conf

+

These are config files for .config/hypr

@@ -2667,9 +2667,9 @@ layerrule = blur on, ignore_alpha 1, match:namespace swaync-notification-window
-
-

.config/hypr/layout.conf

-
+
+

.config/hypr/layout.conf

+

These are config files for .config/hypr

@@ -2679,9 +2679,9 @@ These are config files for .config/hypr
-
-

.config/hypr/monitor-rules.conf

-
+
+

.config/hypr/monitor-rules.conf

+

These are config files for .config/hypr

@@ -2692,9 +2692,9 @@ monitor=DP-1,3840x1080@144,1920x0,1
-
-

.config/hypr/scripts/layout-selector.sh

-
+
+

.config/hypr/scripts/layout-selector.sh

+

These are config files for .config/hypr/scripts

@@ -2737,9 +2737,9 @@ hyprctl dispatch oSD "Layout: $LAYOUT_NAME" 2000
-
-

.config/hypr/theming.css

-
+
+

.config/hypr/theming.css

+

These are config files for .config/hypr

@@ -2788,9 +2788,9 @@ decoration {
-
-

.config/hypr/window-rules.conf

-
+
+

.config/hypr/window-rules.conf

+

These are config files for .config/hypr

@@ -2828,9 +2828,9 @@ windowrule {
-
-

.config/hypr/workspace-rules.conf

-
+
+

.config/hypr/workspace-rules.conf

+

These are config files for .config/hypr

@@ -2856,9 +2856,9 @@ workspace = 10
-
-

generated/modules/traveldroid/desktop/wallpaper.nix

-
+
+

generated/modules/traveldroid/desktop/wallpaper.nix

+

Setting up wallpaper engine + wallpaper gui

@@ -2957,9 +2957,9 @@ in
-
-

generated/modules/traveldroid/desktop/stylix.nix

-
+
+

generated/modules/traveldroid/desktop/stylix.nix

+
{ lib, config, pkgs, flakeRoot, stylix, ... }:
 
@@ -3046,9 +3046,9 @@ in
 
-
-

.config/stylix/stylix.conf

-
+
+

.config/stylix/stylix.conf

+

These are config files for .config/stylix

@@ -3085,9 +3085,9 @@ icons = {
-
-

.config/stylix/palette.json

-
+
+

.config/stylix/palette.json

+

These are config files for .config/stylix

@@ -3117,9 +3117,9 @@ These are config files for .config/stylix
-
-

.config/stylix/palette.html

-
+
+

.config/stylix/palette.html

+

These are config files for .config/stylix

@@ -3197,9 +3197,9 @@ These are config files for .config/stylix
-
-

generated/modules/traveldroid/desktop/waybar.nix

-
+
+

generated/modules/traveldroid/desktop/waybar.nix

+

This file installs and configures waybar

@@ -3230,13 +3230,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; }; @@ -3265,9 +3265,9 @@ in
-
-

.config/waybar/config

-
+
+

.config/waybar/config

+

These are config files for waybar

@@ -3278,7 +3278,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", @@ -3293,6 +3296,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, @@ -3378,9 +3390,9 @@ These are config files for waybar
-
-

.config/waybar/style.css

-
+
+

.config/waybar/style.css

+

This file contains all css for waybar #+BEGINSRC css :tangle generated/.config/waybar/config :noweb yes :mkdirp yes :eval never @@ -3403,9 +3415,9 @@ This file contains all css for waybar

-
-

{

-
+
+

{

+

font-family: Aporetic Sans Mono, @@ -3461,6 +3473,34 @@ window#waybar { }

+

+* 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, #idleinhibitor, @@ -3543,9 +3583,9 @@ window#waybar { #+ENDSRC

-
-

.config/waybar/scripts/bluetooth-status.sh

-
+
+

.config/waybar/scripts/bluetooth-status.sh

+

These are config files for waybar

@@ -3571,35 +3611,66 @@ printf '{"text": "%s", "tooltip": "%s"}\n' "$icon" "$tooltip"
-
-

.config/waybar/scripts/workspaceswindows.sh

-
+
+

.config/waybar/scripts/hypr-workspaces.sh

+

These are config files for waybar

-
#!/usr/bin/env bash
+
#!/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"
 
-
-

.config/waybar/scripts/workspaceswindowsmenu.sh

-
+
+

.config/waybar/scripts/hypr-workspacesmenu.sh

+

These are config files for waybar

@@ -3616,9 +3687,9 @@ hyprctl dispatch focuswindow address:$addr
-
-

.config/waypaper/config.ini

-
+
+

.config/waypaper/config.ini

+

These are config files for waypaper

@@ -3655,9 +3726,9 @@ keybindings = ~/.config/waypaper/keybindings.ini
-
-

generated/modules/traveldroid/desktop/wayland.nix

-
+
+

generated/modules/traveldroid/desktop/wayland.nix

+
{ lib, config, pkgs, ... }:
 
@@ -3687,9 +3758,9 @@ keybindings = ~/.config/waypaper/keybindings.ini
 
-
-

generated/modules/traveldroid/desktop/xdg.nix

-
+
+

generated/modules/traveldroid/desktop/xdg.nix

+

This sets the XDG implementation

@@ -3743,13 +3814,13 @@ in
-
-

generated/modules/traveldroid/system

-
+
+

generated/modules/traveldroid/system

+
-
-

generated/modules/traveldroid/system/audio.nix

-
+
+

generated/modules/traveldroid/system/audio.nix

+
{ lib, config, pkgs, ... }:
 
@@ -3767,9 +3838,9 @@ in
 
-
-

generated/modules/traveldroid/system/bluetooth.nix

-
+
+

generated/modules/traveldroid/system/bluetooth.nix

+
{ lib, config, pkgs, home-manager, ... }:
 
@@ -3790,9 +3861,9 @@ in
 
-
-

generated/modules/traveldroid/system/dbus.nix

-
+
+

generated/modules/traveldroid/system/dbus.nix

+

This sets the dbus implementation

@@ -3819,9 +3890,9 @@ This sets the dbus implementation
-
-

generated/modules/traveldroid/system/login-tuigreet.nix

-
+
+

generated/modules/traveldroid/system/login-tuigreet.nix

+

This sets up tuigreeter which is not fancy but imo fits the aesthetic I am aiming for

@@ -3875,9 +3946,9 @@ in
-
-

generated/modules/traveldroid/system/networking.nix

-
+
+

generated/modules/traveldroid/system/networking.nix

+

This sets the networking.

@@ -3940,9 +4011,9 @@ This sets the networking.
-
-

generated/modules/traveldroid/system/nix.nix

-
+
+

generated/modules/traveldroid/system/nix.nix

+
{ lib, config, ... }:
 
@@ -3958,9 +4029,9 @@ This sets the networking.
 
-
-

generated/modules/traveldroid/system/printing.nix

-
+
+

generated/modules/traveldroid/system/printing.nix

+

This sets the dbus implementation

@@ -3985,13 +4056,13 @@ This sets the dbus implementation
-
-

generated/users

-
+
+

generated/users

+
-
-

generated/users/henrov.nix

-
+
+

generated/users/henrov.nix

+

This is the default user, just search and replace henrov another name if you want to change

@@ -4049,9 +4120,9 @@ in

These are all the prepared config files

-
-

.config/waybar/style.css

-
+
+

.config/waybar/style.css

+

These are config files for .config/waybar

@@ -4124,7 +4195,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; @@ -4137,14 +4208,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; @@ -4228,12 +4299,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; @@ -4245,7 +4316,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); @@ -4253,7 +4324,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, @@ -4261,7 +4332,7 @@ window#waybar { } /* Error state: clear but not screaming */ -#custom-workspaceswindows.error { +#custom-hypr-workspaces.error { padding: 0px 1px; min-width: 80px; color: @text; @@ -4273,7 +4344,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; @@ -4285,9 +4356,9 @@ window#waybar {
-
-

.config/waypaper/config.ini

-
+
+

.config/waypaper/config.ini

+

These are config files for .config/waypaper

@@ -4324,9 +4395,9 @@ keybindings = ~/.config/waypaper/keybindings.ini
-
-

.config/zed/settings.json

-
+
+

.config/zed/settings.json

+

These are config files for .config/zed

@@ -4366,7 +4437,7 @@ These are config files for .config/zed

Author: Henro Veijer

-

Created: 2026-04-02 do 22:17

+

Created: 2026-04-02 do 22:25

Validate

diff --git a/Droidnix/README.org b/Droidnix/README.org index c48e89025..8fc774be2 100644 --- a/Droidnix/README.org +++ b/Droidnix/README.org @@ -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; diff --git a/Droidnix/generated/.config/waybar/config b/Droidnix/generated/.config/waybar/config index b77ed13b4..87b27f169 100644 --- a/Droidnix/generated/.config/waybar/config +++ b/Droidnix/generated/.config/waybar/config @@ -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, diff --git a/Droidnix/generated/.config/waybar/scripts/hypr-workspaces.sh b/Droidnix/generated/.config/waybar/scripts/hypr-workspaces.sh new file mode 100644 index 000000000..2cd14262c --- /dev/null +++ b/Droidnix/generated/.config/waybar/scripts/hypr-workspaces.sh @@ -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" diff --git a/Droidnix/generated/.config/waybar/scripts/hypr-workspacesmenu.sh b/Droidnix/generated/.config/waybar/scripts/hypr-workspacesmenu.sh new file mode 100644 index 000000000..9c83db0ba --- /dev/null +++ b/Droidnix/generated/.config/waybar/scripts/hypr-workspacesmenu.sh @@ -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 diff --git a/Droidnix/generated/.config/waybar/style.css b/Droidnix/generated/.config/waybar/style.css index b92eb0063..89b165646 100644 --- a/Droidnix/generated/.config/waybar/style.css +++ b/Droidnix/generated/.config/waybar/style.css @@ -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; diff --git a/Droidnix/generated/modules/traveldroid/desktop/waybar.nix b/Droidnix/generated/modules/traveldroid/desktop/waybar.nix index eb252c4c3..dd44659fd 100644 --- a/Droidnix/generated/modules/traveldroid/desktop/waybar.nix +++ b/Droidnix/generated/modules/traveldroid/desktop/waybar.nix @@ -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; };