diff --git a/Droidnix/README.html b/Droidnix/README.html index 09d36345e..89b7a3b76 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,133 +204,133 @@

Table of Contents

-
-

Shortcuts

-
+
+

Shortcuts

+

Introduction The Assets Folder @@ -346,25 +346,25 @@

Introduction   intro

-
-

What is Droidnix

-
+
+

What is Droidnix

+

Droidnix is a modular, declarative NixOS + Home Manager configuration system. with 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
  • +
  • Core
  • +
  • Hyprland
-
-

Goals, project Structure, import hierarchy

-
+
+

Goals, project Structure, import hierarchy

+

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

-
-

Root Level

-
+
+

Root Level

+
  • flake.nix is the entry point and imports:
      @@ -390,16 +390,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. @@ -420,9 +420,9 @@ The generated/ directory contains all generated configurations, div The .assets/ folder contains all static files, such as configs, scripts, and themes. These files are not generated and can be edited directly.

-
-

generated/assets/2_b_installed.conf

-
+
+

generated/assets/2_b_installed.conf

+

This is a list of additional apps to install

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

generated/assets/aliases.conf

-
+
+

generated/assets/aliases.conf

+

This is a list of additional apps to install

@@ -546,9 +546,9 @@ alias keys='hyprctl binds' This section contains the Org blocks for tangling Nix code into the generated folders.

-
-

generated/flake.nix

-
+
+

generated/flake.nix

+

The Nix flake definition for Droidnix.

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

generated/modules/traveldroid/system/colors.nix

-
+
+

generated/modules/traveldroid/system/colors.nix

+

Setting the colors for Droidnix.

@@ -708,9 +708,9 @@ in
-
-

generated/hosts/traveldroid/boot.nix

-
+
+

generated/hosts/traveldroid/boot.nix

+
{ config, pkgs, lib, flakeRoot, ... }:
 
@@ -756,9 +756,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. @@ -816,9 +816,9 @@ in
-
-

generated/hosts/traveldroid/host.nix

-
+
+

generated/hosts/traveldroid/host.nix

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

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

@@ -991,9 +991,9 @@ in {
-
-

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

-
+
+

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

+

This installs emacs

@@ -1089,9 +1089,9 @@ in
-
-

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

@@ -1130,9 +1130,9 @@ in
-
-

generated/modules/traveldroid/apps/kitty.nix

-
+
+

generated/modules/traveldroid/apps/kitty.nix

+

This file sets up Kitty terminal

@@ -1190,9 +1190,9 @@ in
-
-

generated/modules/traveldroid/apps/starship.nix

-
+
+

generated/modules/traveldroid/apps/starship.nix

+

This file sets up starship prompt

@@ -1231,9 +1231,9 @@ in
-
-

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

@@ -1274,9 +1274,9 @@ in
-
-

generated/modules/traveldroid/apps/wofi.nix

-
+
+

generated/modules/traveldroid/apps/wofi.nix

+

This is the install for Wofi, the launcher

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

generated/modules/traveldroid/apps/zenbrowser.nix

-
+
+

generated/modules/traveldroid/apps/zenbrowser.nix

+

This installs zen browser

@@ -1331,9 +1331,9 @@ in
-
-

generated/modules/traveldroid/apps/zsh.nix

-
+
+

generated/modules/traveldroid/apps/zsh.nix

+

This sets up the zsh in the terminal

@@ -1396,13 +1396,13 @@ in
-
-

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

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

generated/modules/traveldroid/desktop/gtk.nix

-
+
+

generated/modules/traveldroid/desktop/gtk.nix

+

Setting up GTK

@@ -1448,9 +1448,9 @@ in
-
-

generated/modules/traveldroid/desktop/hyprland.nix

-
+
+

generated/modules/traveldroid/desktop/hyprland.nix

+

Setting up Hyprland

@@ -1496,9 +1496,9 @@ in
-
-

generated/modules/traveldroid/desktop/stylix.nix

-
+
+

generated/modules/traveldroid/desktop/stylix.nix

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

generated/modules/traveldroid/desktop/wallpaper.nix

-
+
+

generated/modules/traveldroid/desktop/wallpaper.nix

+

Setting up wallpaper engine + wallpaper gui

@@ -1686,9 +1686,9 @@ in
-
-

generated/modules/traveldroid/desktop/waybar.nix

-
+
+

generated/modules/traveldroid/desktop/waybar.nix

+

This file installs and configures waybar

@@ -1755,9 +1755,9 @@ in
-
-

generated/modules/traveldroid/desktop/wayland.nix

-
+
+

generated/modules/traveldroid/desktop/wayland.nix

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

generated/modules/traveldroid/desktop/xdg.nix

-
+
+

generated/modules/traveldroid/desktop/xdg.nix

+

This sets the XDG implementation

@@ -1843,13 +1843,13 @@ in
-
-

generated/modules/traveldroid/system

-
+
+

generated/modules/traveldroid/system

+
-
-

generated/modules/traveldroid/system/aliases.nix

-
+
+

generated/modules/traveldroid/system/aliases.nix

+

This file makes aliases in ./generated/assets/aliases.conf system-wide available

@@ -1895,9 +1895,9 @@ in
-
-

generated/modules/traveldroid/system/audio.nix

-
+
+

generated/modules/traveldroid/system/audio.nix

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

generated/modules/traveldroid/system/avahi.nix

-
+
+

generated/modules/traveldroid/system/avahi.nix

+

Avahi helps discovering services

@@ -1938,9 +1938,9 @@ Avahi helps discovering services
-
-

generated/modules/traveldroid/system/bluetooth.nix

-
+
+

generated/modules/traveldroid/system/bluetooth.nix

+

Installing Bluetooth services and supporting aps

@@ -1964,9 +1964,9 @@ in
-
-

generated/modules/traveldroid/system/copy_scripts.nix

-
+
+

generated/modules/traveldroid/system/copy_scripts.nix

+

This copies any scripts from generated.config/scripts to ~/.config/scripts and makes any .sh files executable.

@@ -2007,9 +2007,9 @@ in
-
-

generated/modules/traveldroid/system/dbus.nix

-
+
+

generated/modules/traveldroid/system/dbus.nix

+

This sets the dbus implementation

@@ -2036,9 +2036,9 @@ This sets the dbus implementation
-
-

generated/modules/traveldroid/system/firewall.nix

-
+
+

generated/modules/traveldroid/system/firewall.nix

+

This sets the firewall.

@@ -2113,9 +2113,9 @@ This sets the firewall.
-
-

generated/modules/traveldroid/system/gnome-keyring.nix

-
+
+

generated/modules/traveldroid/system/gnome-keyring.nix

+

This sets the dbus implementation

@@ -2163,9 +2163,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

@@ -2219,9 +2219,9 @@ in
-
-

generated/modules/traveldroid/system/networking.nix

-
+
+

generated/modules/traveldroid/system/networking.nix

+

This sets the networking.

@@ -2270,9 +2270,9 @@ This sets the networking.
-
-

generated/modules/traveldroid/system/nix.nix

-
+
+

generated/modules/traveldroid/system/nix.nix

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

generated/modules/traveldroid/system/printing.nix

-
+
+

generated/modules/traveldroid/system/printing.nix

+

This sets the dbus implementation

@@ -2314,9 +2314,9 @@ This sets the dbus implementation
-
-

generated/modules/traveldroid/system/quickshell.nix

-
+
+

generated/modules/traveldroid/system/quickshell.nix

+

This sets the dbus implementation

@@ -2369,13 +2369,13 @@ in
-
-

generated/users

-
+
+

generated/users

+
-
-

generated/users/

-
+
+

generated/users/

+

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

@@ -2437,9 +2437,9 @@ in

These are all the prepared config files

-
-

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

-
+
+

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

+

This contaions emacs

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

generated/.config/emacs/init.el

-
+
+

generated/.config/emacs/init.el

+

This contaions emacs

@@ -2952,9 +2952,9 @@ the top of the file."
-
-

generated/.config/hypr/animations.conf

-
+
+

generated/.config/hypr/animations.conf

+

These are config files for .config/hypr

@@ -2975,9 +2975,9 @@ animations {
-
-

generated/.config/hypr/behaviour.conf

-
+
+

generated/.config/hypr/behaviour.conf

+

These are config files for .config/hypr

@@ -2999,9 +2999,9 @@ input {
-
-

generated/.config/hypr/bindings.conf

-
+
+

generated/.config/hypr/bindings.conf

+

These are config files for .config/hypr

@@ -3167,9 +3167,9 @@ bind = $mainMod, U, exec, kitty -e bash -lc "$HOME/.config/scripts/update.sh"
-
-

generated/.config/hypr/exec-once.conf

-
+
+

generated/.config/hypr/exec-once.conf

+

These are config files for .config/hypr

@@ -3189,9 +3189,9 @@ exec-once = ~/.config/scripts/hypr-autocolwidth.sh
-
-

generated/.config/hypr/hypridle.conf

-
+
+

generated/.config/hypr/hypridle.conf

+

These are config files for .config/hypr

@@ -3216,9 +3216,9 @@ listener {
-
-

generated/.config/hypr/hyprland.conf

-
+
+

generated/.config/hypr/hyprland.conf

+

These are config files for .config/hypr

@@ -3237,9 +3237,9 @@ source = ./workspace-rules.conf
-
-

generated/.config/hypr/layer-rules.conf

-
+
+

generated/.config/hypr/layer-rules.conf

+

These are config files for .config/hypr

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

generated/.config/hypr/layout.conf

-
+
+

generated/.config/hypr/layout.conf

+

These are config files for .config/hypr

@@ -3271,9 +3271,9 @@ scrolling {
-
-

generated/.config/hypr/monitor-rules.conf

-
+
+

generated/.config/hypr/monitor-rules.conf

+

These are config files for .config/hypr

@@ -3284,9 +3284,9 @@ monitor = eDP-1, preferred, auto-left, 1.5
-
-

generated/.config/hypr/theming.conf

-
+
+

generated/.config/hypr/theming.conf

+

These are config files for .config/hypr

@@ -3353,9 +3353,9 @@ misc {
-
-

generated/.config/hypr/window-rules.conf

-
+
+

generated/.config/hypr/window-rules.conf

+

These are config files for .config/hypr

@@ -3419,9 +3419,9 @@ windowrule {
-
-

generated/.config/hypr/workspace-rules.conf

-
+
+

generated/.config/hypr/workspace-rules.conf

+

These are config files for .config/hypr

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

generated/.config/quickshell/media/shell.qml

-
+
+

generated/.config/quickshell/media/shell.qml

+

offers a adio widget

@@ -3841,9 +3841,9 @@ ShellRoot {
-
-

generated/.config/quickshell/powermenu/shell.qml

-
+
+

generated/.config/quickshell/powermenu/shell.qml

+

Provides a powermenu

@@ -3991,111 +3991,22 @@ ShellRoot {
-
-

generated/.config/scripts/media.sh

-
+
+

generated/.config/scripts/media.sh

+

Providing an media

-
#!/usr/bin/env bash
-
-# Player selection — prefer actively playing player
-player=$(playerctl -l 2>/dev/null | while read -r p; do
-    st=$(playerctl --player="$p" status 2>/dev/null)
-    [ "$st" = "Playing" ] && echo "$p" && break
-done)
-[ -z "$player" ] && player=$(playerctl -l 2>/dev/null | head -n1)
-
-if [ -z "$player" ]; then
-    jq -c -n '{text: "", tooltip: "", class: "inactive"}'
-    exit 0
-fi
-
-status=$(playerctl --player="$player" status 2>/dev/null)
-if [ "$status" != "Playing" ] && [ "$status" != "Paused" ]; then
-    jq -c -n '{text: "", tooltip: "", class: "inactive"}'
-    exit 0
-fi
-
-artist=$(playerctl --player="$player" metadata artist 2>/dev/null)
-title=$(playerctl --player="$player" metadata title 2>/dev/null)
-album=$(playerctl --player="$player" metadata album 2>/dev/null)
-art=$(playerctl --player="$player" metadata mpris:artUrl 2>/dev/null)
-length=$(playerctl --player="$player" metadata mpris:length 2>/dev/null)
-position=$(playerctl --player="$player" position 2>/dev/null)
-
-# Progress percentage — pure bash, no bc needed
-if [ -n "$length" ] && [ -n "$position" ] && [ "$length" -gt 0 ] 2>/dev/null; then
-    pos_us=$(echo "$position" | awk '{printf "%d", $1 * 1000000}')
-    progress=$(( pos_us * 100 / length ))
-else
-    progress=0
-fi
-
-# Spotify device
-device=""
-if [[ "$player" == *"spotify"* ]]; then
-    device=$(playerctl --player="$player" metadata xesam:url 2>/dev/null | grep -o 'device=[^&]*' | cut -d= -f2)
-fi
-
-# Icon
-if [ "$status" = "Paused" ]; then
-    icon="⏸ "
-else
-    icon="▶ "
-fi
-
-# Scrolling ticker
-CACHE_FILE="/tmp/waybar_media_scroll_${player//\//_}"
-full_text="${artist} — ${title}"
-text_len=${#full_text}
-display_len=30
-
-# Reset scroll offset when track changes
-TRACK_FILE="/tmp/waybar_media_track_${player//\//_}"
-last_track=""
-[ -f "$TRACK_FILE" ] && last_track=$(cat "$TRACK_FILE")
-if [ "$full_text" != "$last_track" ]; then
-    echo "0" > "$CACHE_FILE"
-    echo "$full_text" > "$TRACK_FILE"
-fi
-
-if [ "$text_len" -le "$display_len" ]; then
-    text="$full_text"
-else
-    offset=0
-    [ -f "$CACHE_FILE" ] && offset=$(cat "$CACHE_FILE")
-
-    padded="${full_text}    ${full_text}"
-    text="${padded:$offset:$display_len}"
-
-    next_offset=$(( (offset + 1) % (text_len + 4) ))
-    echo "$next_offset" > "$CACHE_FILE"
-fi
-
-# Build tooltip
-tooltip="Artist: ${artist}
-Title: ${title}
-Album: ${album}"
-if [ -n "$device" ]; then
-    tooltip="${tooltip}
-󰓻 ${device}"
-fi
-tooltip="${tooltip}"
-jq -c -n \
-    --arg text "${icon}${text}" \
-    --arg tooltip "$tooltip" \
-    --arg class "$player" \
-    --arg art "$art" \
-    '{text: $text, tooltip: $tooltip, class: $class, alt: $art}'
+
./media.sh
+{"text":"","tooltip":"","class":"inactive"}
 
-
-

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

-
+
+

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

+

Choose your layout

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

generated/.config/scripts/hypr-autocolwidth.sh

-
+
+

generated/.config/scripts/hypr-autocolwidth.sh

+

These are config files for .config/scripts

@@ -4193,9 +4104,9 @@ done
-
-

generated/.config/scripts/power.sh

-
+
+

generated/.config/scripts/power.sh

+

Enables a terminal power menu

@@ -4250,9 +4161,9 @@ main
-
-

generated/.config/scripts/update.sh

-
+
+

generated/.config/scripts/update.sh

+

A file containing color variables

@@ -4271,9 +4182,9 @@ flatpak update -y
-
-

generated/.config/scripts/wofi-launcher.sh

-
+
+

generated/.config/scripts/wofi-launcher.sh

+

Providing an media

@@ -4288,9 +4199,9 @@ Providing an media
-
-

generated/.config/shared/Colors.css

-
+
+

generated/.config/shared/Colors.css

+

A file containing color variables

@@ -4330,9 +4241,9 @@ A file containing color variables
-
-

generated/.config/starship.toml

-
+
+

generated/.config/starship.toml

+

These are config files for Starship

@@ -4620,9 +4531,9 @@ crust = "#181926"
-
-

generated/.config/stylix/stylix.conf

-
+
+

generated/.config/stylix/stylix.conf

+

These are config files for .config/stylix

@@ -4659,9 +4570,9 @@ icons = {
-
-

generated/.config/stylix/palette.json

-
+
+

generated/.config/stylix/palette.json

+

These are config files for .config/stylix

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

generated/.config/stylix/palette.html

-
+
+

generated/.config/stylix/palette.html

+

These are config files for .config/stylix

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

generated/.config/waybar/config

-
+
+

generated/.config/waybar/config

+

These are config files for waybar

@@ -5012,9 +4923,9 @@ These are config files for waybar
-
-

generated/.config/waybar/style-dark.css

-
+
+

generated/.config/waybar/style-dark.css

+

This file contains all css for waybar

@@ -5145,6 +5056,19 @@ label#custom-windows:not(.active) { label#custom-media:not(.active) { background: transparent; color: transparent; + opacity: 0; + padding: 0; + margin: 0; + min-width: 0; +} + +label#custom-media.inactive { + background: transparent; + color: transparent; + opacity: 0; + padding: 0; + margin: 0; + min-width: 0; } label#custom-media.module { @@ -5239,9 +5163,9 @@ label#custom-media.module {
-
-

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

-
+
+

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

+

These are config files for waybar

@@ -5266,9 +5190,9 @@ printf '{"text": "%s", "tooltip": "%s"}\n' "$icon" "$tooltip"
-
-

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

-
+
+

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

+

These are config files for waybar

@@ -5310,9 +5234,9 @@ jq -c -n \
-
-

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

-
+
+

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

+

These are config files for waybar

@@ -5334,9 +5258,9 @@ hyprctl dispatch focuswindow address:"$addr"
-
-

generated/.config/waypaper/config.ini

-
+
+

generated/.config/waypaper/config.ini

+

These are config files for waypaper

@@ -5373,9 +5297,9 @@ keybindings = ~/.config/waypaper/keybindings.ini
-
-

generated/.config/waypaper/config.ini

-
+
+

generated/.config/waypaper/config.ini

+

These are config files for .config/waypaper

@@ -5411,9 +5335,9 @@ keybindings = ~/.config/waypaper/keybindings.ini
-
-

generated/.config/wofi/config

-
+
+

generated/.config/wofi/config

+

These are config files for .config/wofi

@@ -5440,9 +5364,9 @@ prompt = > ...
-
-

generated/.config/wofi/style.css

-
+
+

generated/.config/wofi/style.css

+

This is the default layout for wofi

@@ -5538,9 +5462,9 @@ This is the default layout for wofi
-
-

generated/.config/zed/settings.json

-
+
+

generated/.config/zed/settings.json

+

These are config files for Zed editor

@@ -5576,9 +5500,9 @@ These are config files for Zed editor
-
-

generated/.config/zsh/.zshrc

-
+
+

generated/.config/zsh/.zshrc

+

This sets up the zsh in the terminal

@@ -5603,7 +5527,7 @@ fi

Author: Henro Veijer

-

Created: 2026-04-14 di 15:15

+

Created: 2026-04-14 di 15:22

Validate

diff --git a/Droidnix/README.org b/Droidnix/README.org index 872bb808d..db464d660 100644 --- a/Droidnix/README.org +++ b/Droidnix/README.org @@ -3323,97 +3323,8 @@ ShellRoot { ** =generated/.config/scripts/media.sh= Providing an media #+BEGIN_SRC sh :tangle generated/.config/scripts/media.sh :shebang "#!/usr/bin/env bash" :noweb yes :mkdirp yes :eval never -#!/usr/bin/env bash - -# Player selection — prefer actively playing player -player=$(playerctl -l 2>/dev/null | while read -r p; do - st=$(playerctl --player="$p" status 2>/dev/null) - [ "$st" = "Playing" ] && echo "$p" && break -done) -[ -z "$player" ] && player=$(playerctl -l 2>/dev/null | head -n1) - -if [ -z "$player" ]; then - jq -c -n '{text: "", tooltip: "", class: "inactive"}' - exit 0 -fi - -status=$(playerctl --player="$player" status 2>/dev/null) -if [ "$status" != "Playing" ] && [ "$status" != "Paused" ]; then - jq -c -n '{text: "", tooltip: "", class: "inactive"}' - exit 0 -fi - -artist=$(playerctl --player="$player" metadata artist 2>/dev/null) -title=$(playerctl --player="$player" metadata title 2>/dev/null) -album=$(playerctl --player="$player" metadata album 2>/dev/null) -art=$(playerctl --player="$player" metadata mpris:artUrl 2>/dev/null) -length=$(playerctl --player="$player" metadata mpris:length 2>/dev/null) -position=$(playerctl --player="$player" position 2>/dev/null) - -# Progress percentage — pure bash, no bc needed -if [ -n "$length" ] && [ -n "$position" ] && [ "$length" -gt 0 ] 2>/dev/null; then - pos_us=$(echo "$position" | awk '{printf "%d", $1 * 1000000}') - progress=$(( pos_us * 100 / length )) -else - progress=0 -fi - -# Spotify device -device="" -if [[ "$player" == *"spotify"* ]]; then - device=$(playerctl --player="$player" metadata xesam:url 2>/dev/null | grep -o 'device=[^&]*' | cut -d= -f2) -fi - -# Icon -if [ "$status" = "Paused" ]; then - icon="⏸ " -else - icon="▶ " -fi - -# Scrolling ticker -CACHE_FILE="/tmp/waybar_media_scroll_${player//\//_}" -full_text="${artist} — ${title}" -text_len=${#full_text} -display_len=30 - -# Reset scroll offset when track changes -TRACK_FILE="/tmp/waybar_media_track_${player//\//_}" -last_track="" -[ -f "$TRACK_FILE" ] && last_track=$(cat "$TRACK_FILE") -if [ "$full_text" != "$last_track" ]; then - echo "0" > "$CACHE_FILE" - echo "$full_text" > "$TRACK_FILE" -fi - -if [ "$text_len" -le "$display_len" ]; then - text="$full_text" -else - offset=0 - [ -f "$CACHE_FILE" ] && offset=$(cat "$CACHE_FILE") - - padded="${full_text} ${full_text}" - text="${padded:$offset:$display_len}" - - next_offset=$(( (offset + 1) % (text_len + 4) )) - echo "$next_offset" > "$CACHE_FILE" -fi - -# Build tooltip -tooltip="Artist: ${artist} -Title: ${title} -Album: ${album}" -if [ -n "$device" ]; then - tooltip="${tooltip} -󰓻 ${device}" -fi -tooltip="${tooltip}" -jq -c -n \ - --arg text "${icon}${text}" \ - --arg tooltip "$tooltip" \ - --arg class "$player" \ - --arg art "$art" \ - '{text: $text, tooltip: $tooltip, class: $class, alt: $art}' +./media.sh +{"text":"","tooltip":"","class":"inactive"} #+END_SRC ** =generated/.config/scripts/layout-selector.sh= @@ -4398,6 +4309,19 @@ label#custom-windows:not(.active) { label#custom-media:not(.active) { background: transparent; color: transparent; + opacity: 0; + padding: 0; + margin: 0; + min-width: 0; +} + +label#custom-media.inactive { + background: transparent; + color: transparent; + opacity: 0; + padding: 0; + margin: 0; + min-width: 0; } label#custom-media.module { diff --git a/Droidnix/generated/.config/scripts/media.sh b/Droidnix/generated/.config/scripts/media.sh index 0c300eaab..12213ac6e 100755 --- a/Droidnix/generated/.config/scripts/media.sh +++ b/Droidnix/generated/.config/scripts/media.sh @@ -1,93 +1,4 @@ #!/usr/bin/env bash # --- This file has been auto-generated. For permanent changes alter the appropriate block in the README.org. --- -#!/usr/bin/env bash - -# Player selection — prefer actively playing player -player=$(playerctl -l 2>/dev/null | while read -r p; do - st=$(playerctl --player="$p" status 2>/dev/null) - [ "$st" = "Playing" ] && echo "$p" && break -done) -[ -z "$player" ] && player=$(playerctl -l 2>/dev/null | head -n1) - -if [ -z "$player" ]; then - jq -c -n '{text: "", tooltip: "", class: "inactive"}' - exit 0 -fi - -status=$(playerctl --player="$player" status 2>/dev/null) -if [ "$status" != "Playing" ] && [ "$status" != "Paused" ]; then - jq -c -n '{text: "", tooltip: "", class: "inactive"}' - exit 0 -fi - -artist=$(playerctl --player="$player" metadata artist 2>/dev/null) -title=$(playerctl --player="$player" metadata title 2>/dev/null) -album=$(playerctl --player="$player" metadata album 2>/dev/null) -art=$(playerctl --player="$player" metadata mpris:artUrl 2>/dev/null) -length=$(playerctl --player="$player" metadata mpris:length 2>/dev/null) -position=$(playerctl --player="$player" position 2>/dev/null) - -# Progress percentage — pure bash, no bc needed -if [ -n "$length" ] && [ -n "$position" ] && [ "$length" -gt 0 ] 2>/dev/null; then - pos_us=$(echo "$position" | awk '{printf "%d", $1 * 1000000}') - progress=$(( pos_us * 100 / length )) -else - progress=0 -fi - -# Spotify device -device="" -if [[ "$player" == *"spotify"* ]]; then - device=$(playerctl --player="$player" metadata xesam:url 2>/dev/null | grep -o 'device=[^&]*' | cut -d= -f2) -fi - -# Icon -if [ "$status" = "Paused" ]; then - icon="⏸ " -else - icon="▶ " -fi - -# Scrolling ticker -CACHE_FILE="/tmp/waybar_media_scroll_${player//\//_}" -full_text="${artist} — ${title}" -text_len=${#full_text} -display_len=30 - -# Reset scroll offset when track changes -TRACK_FILE="/tmp/waybar_media_track_${player//\//_}" -last_track="" -[ -f "$TRACK_FILE" ] && last_track=$(cat "$TRACK_FILE") -if [ "$full_text" != "$last_track" ]; then - echo "0" > "$CACHE_FILE" - echo "$full_text" > "$TRACK_FILE" -fi - -if [ "$text_len" -le "$display_len" ]; then - text="$full_text" -else - offset=0 - [ -f "$CACHE_FILE" ] && offset=$(cat "$CACHE_FILE") - - padded="${full_text} ${full_text}" - text="${padded:$offset:$display_len}" - - next_offset=$(( (offset + 1) % (text_len + 4) )) - echo "$next_offset" > "$CACHE_FILE" -fi - -# Build tooltip -tooltip="Artist: ${artist} -Title: ${title} -Album: ${album}" -if [ -n "$device" ]; then - tooltip="${tooltip} -󰓻 ${device}" -fi -tooltip="${tooltip}" -jq -c -n \ - --arg text "${icon}${text}" \ - --arg tooltip "$tooltip" \ - --arg class "$player" \ - --arg art "$art" \ - '{text: $text, tooltip: $tooltip, class: $class, alt: $art}' +./media.sh +{"text":"","tooltip":"","class":"inactive"} diff --git a/Droidnix/generated/.config/waybar/style-dark.css b/Droidnix/generated/.config/waybar/style-dark.css index 2a2d2bb8c..2bccdb554 100644 --- a/Droidnix/generated/.config/waybar/style-dark.css +++ b/Droidnix/generated/.config/waybar/style-dark.css @@ -125,6 +125,19 @@ label#custom-windows:not(.active) { label#custom-media:not(.active) { background: transparent; color: transparent; + opacity: 0; + padding: 0; + margin: 0; + min-width: 0; +} + +label#custom-media.inactive { + background: transparent; + color: transparent; + opacity: 0; + padding: 0; + margin: 0; + min-width: 0; } label#custom-media.module {