commit 8c88818832988e4625698a76f66e9a25e317250c
parent cf1e797031f05b9e38138c8e9e11a4192bfa42f0
Author: ryukamish <[email protected]>
Date: Sun, 29 Mar 2026 12:12:12 +0530
add: waybar config change
Diffstat:
13 files changed, 695 insertions(+), 0 deletions(-)
diff --git a/waybar/waybar/colors.css b/waybar/waybar/colors.css
@@ -0,0 +1 @@
+@import 'themes/tokyonight.css';
diff --git a/waybar/waybar/config.jsonc b/waybar/waybar/config.jsonc
@@ -0,0 +1,281 @@
+// _*_ mode: jsonc _*_
+{
+ "reload_style_on_change": true,
+ "layer": "top",
+ "position": "top",
+ "modules-left": [
+ "niri/workspaces",
+ // "custom/uptime",
+ // "backlight",
+ // "group/network",
+ "mpris",
+ "custom/screenrecording-indicator"
+ ],
+ "modules-center": [],
+ "modules-right": [
+ "group/expand-tray",
+ "backlight",
+ "custom/brightness",
+ "group/network",
+ // "group/hardware",
+ "group/audio",
+ "group/powerofmachine",
+ "clock"
+ ],
+ "niri/workspaces": {
+ "on-click": "activate",
+ "format": "{icon}",
+ "format-icons": {
+ // "1": "1 ",
+ // "2": "2 ",
+ // "3": "3 ",
+ // "4": "4 ",
+ // "5": "5 פּ",
+ // "6": "6 ",
+ // "7": "7 ",
+ // "8": "8 ",
+ // "9": "9 ",
+ // "10": "10 ",
+ "1": "1",
+ "2": "2",
+ "3": "3",
+ "4": "4",
+ "5": "5",
+ "6": "6",
+ "7": "7",
+ "8": "8",
+ "9": "9",
+ "10": "10",
+ },
+ "all-outputs": true,
+ },
+ // module groups
+ "group/hardware": {
+ "orientation": "horizontal",
+ "modules": [
+ "cpu",
+ "memory",
+ "temperature"
+ ]
+ },
+ "group/audio": {
+ "orientation": "horizontal",
+ "modules": [
+ "bluetooth",
+ "pulseaudio"
+ ]
+ },
+ "group/network": {
+ "orientation": "horizontal",
+ "modules": [
+ "network",
+ "custom/vpn"
+ ]
+ },
+ "group/powerofmachine": {
+ "orientation": "horizontal",
+ "modules": [
+ // "power-profiles-daemon",
+ "battery"
+ ]
+ },
+ "group/expand-tray": {
+ "orientation": "inherit",
+ "drawer": {
+ "transition-duration": 600,
+ "children-class": "tray-group-item"
+ },
+ "modules": [
+ "custom/expand-icon",
+ "tray"
+ ]
+ },
+ // Individual modules
+ "clock": {
+ "interval": 60,
+ "tooltip": true,
+ "format": " {:%R %d/%m}",
+ "tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>",
+ "format-alt": " {:%a, %d, %b %Y}"
+ },
+ "memory": {
+ "interval": 12,
+ "format": " {}%"
+ },
+ "cpu": {
+ "interval": 5,
+ "format": " {usage}%",
+ "on-click": "$TERMINAL -e btop"
+ },
+ "temperature": {
+ // The thermal zone for CPU changes from time to time on MSI Laptops
+ "thermal-zone": 5,
+ "critical-threshold": 80,
+ "format": " {temperatureC}°C"
+ },
+ "mpris": {
+ "format": "{status_icon} {artist} - {title}",
+ "format-paused": "{status_icon} {artist} - {title}",
+ "player-icons": {
+ "default": "▶",
+ "mpv": "🎵"
+ },
+ "status-icons": {
+ "paused": "⏸",
+ "default": "▶",
+ },
+ "ignored-players": ["zen"]
+ },
+ "network": {
+ "interface": "wlan0",
+ "family": "ipv4",
+ "format": "{ifname}",
+ "format-wifi": "{icon} {essid}",
+ "format-ethernet": " {ipaddr}/<span color='#aaaaaa'>{cidr}</span>",
+ "format-disconnected": " DC'D",
+ "format-icons": [
+ "",
+ "",
+ "",
+ "",
+ ""
+ ],
+ "tooltip-format": "{ifname} via {gwaddr}",
+ "tooltip-format-wifi": "{essid} ({frequency} GHz)\n⇣{bandwidthDownBytes} ⇡{bandwidthUpBytes}",
+ "tooltip-format-ethernet": "⇣{bandwidthDownBytes} ⇡{bandwidthUpBytes}",
+ "tooltip-format-disconnected": "Disconnected",
+ "interval": 5,
+ "on-click": "$TERMINAL --class Wifitui -e wifitui",
+ "on-click-right": "rfkill toggle wlan"
+ },
+ "backlight": {
+ "device": "intel_backlight",
+ "format": "{icon} {percent}%",
+ "format-icons": [
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ ""
+ ]
+ },
+ "bluetooth": {
+ "format": " {num_connections}",
+ "format-disabled": "<span color='#aaaaaa'></span>",
+ "format-connected": " {num_connections}",
+ "tooltip-format": "Devices connected: {num_connections}\n{device_alias} at {device_battery_percentage}%",
+ "on-click": "$TERMINAL --title=Bluetui --class=TUI.float -e bluetui",
+ "on-click-right": "rfkill toggle bluetooth"
+ },
+ "pulseaudio": {
+ "format": "{icon} {volume}%",
+ "on-click": "$TERMINAL --title=Wiremix --class=TUI.float -e wiremix",
+ "tooltip-format": "{desc}",
+ "scroll-step": 5,
+ "format-muted": "<span color='#aaaaaa' </span>",
+ "format-icons": {
+ "headphone": "",
+ "default": [
+ "",
+ "",
+ ""
+ ]
+ }
+ },
+ "battery": {
+ "format": "{capacity}% {icon}",
+ "format-discharging": "{icon} {capacity}%",
+ "format-charging": "{icon} {capacity}%",
+ "format-plugged": " {capacity}%",
+ "format-full": " {capacity}%",
+ "format-icons": {
+ "charging": [
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ ""
+ ],
+ "default": [
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ ""
+ ]
+ },
+ "interval": 5,
+ "states": {
+ "warning": 20,
+ "critical": 10
+ }
+ },
+ "power-profiles-daemon": {
+ "format": "{icon}",
+ "tooltip-format": "Power profile: {profile}\nDriver: {driver}",
+ "tooltip": true,
+ "format-icons": {
+ "default": "",
+ "performance": "",
+ "balanced": "",
+ "power-saver": ""
+ }
+ },
+ // Tray
+ "tray": {
+ "icon-size": 10,
+ "spacing": 10
+ },
+ // Custom modules
+ "custom/vpn": {
+ "format": " VPN",
+ "exec": "echo '{\"class\": \"connected\"}'",
+ "exec-if": "test -d /proc/sys/net/ipv4/conf/proton0",
+ "return-type": "json",
+ "interval": 5
+ },
+ "custom/expand-icon": {
+ "format": " ",
+ "tooltip": false
+ },
+ "custom/screenrecording-indicator": {
+ "on-click": "~/.local/bin/screenrecord",
+ "exec": "~/.local/bin/waybar-screenrecord",
+ "signal": 8,
+ "return-type": "json"
+ },
+ "custom/uptime": {
+ "format": "{}",
+ "format-icon": [
+ ""
+ ],
+ "tooltip": false,
+ "interval": 1600,
+ "exec": "~/.config/waybar/scripts/uptime.sh"
+ },
+ "custom/brightness": {
+ "format": "☀ {}%",
+ "tooltip-format": "EXT: ☀ {}%",
+ "interval": "once",
+ "signal": 9,
+ "exec": "~/.config/waybar/scripts/brightness.sh get",
+ "on-scroll-up": "~/.config/waybar/scripts/brightness.sh up",
+ "on-scroll-down": "~/.config/waybar/scripts/brightness.sh down",
+ "on-click": "~/.config/waybar/scripts/brightness.sh left_click",
+ "on-click-right": "~/.config/waybar/scripts/brightness.sh right_click",
+ },
+}
diff --git a/waybar/waybar/scripts/brightness.sh b/waybar/waybar/scripts/brightness.sh
@@ -0,0 +1,69 @@
+#!/usr/bin/env bash
+
+# --- CONFIGURATION ---
+DISPLAY_NUM=1
+STEP=5
+STATE_FILE="/tmp/waybar_brightness.tmp"
+# ---------------------
+
+# Function to send the actual DDC/CI command in the background
+set_brightness_in_background() {
+ pkill -f "ddcutil.*setvcp 10"
+ (ddcutil --display $DISPLAY_NUM setvcp 10 $1) &
+}
+
+# Ensure state file exists, or create it by querying the monitor
+if [ ! -f "$STATE_FILE" ]; then
+ # ddcutil terse output format: "VCP 10 C <current> <max>"
+ initial_brightness=$(ddcutil --display $DISPLAY_NUM getvcp 10 -t 2>/dev/null | awk '{print $4}')
+ # Fallback to 50 if ddcutil fails or returns non-numeric
+ if ! [[ "$initial_brightness" =~ ^[0-9]+$ ]]; then
+ initial_brightness=50
+ fi
+ echo "$initial_brightness" >"$STATE_FILE"
+fi
+
+current=$(cat "$STATE_FILE")
+# Validate current is a number, fallback to 50 if corrupted
+if ! [[ "$current" =~ ^[0-9]+$ ]]; then
+ current=50
+ echo "$current" >"$STATE_FILE"
+fi
+
+case "$1" in
+"get")
+ echo "$current"
+ ;;
+"up")
+ new_brightness=$((current + STEP > 100 ? 100 : current + STEP))
+ if [ "$current" -ne "$new_brightness" ]; then
+ echo "$new_brightness" >"$STATE_FILE"
+ set_brightness_in_background "$new_brightness"
+ fi
+ pkill -RTMIN+9 waybar # Can add whatever RTMIN+n you please, as long as it's an integer. Make sure the signals match between the config and script.
+ ;;
+"down")
+ new_brightness=$((current - STEP < 0 ? 0 : current - STEP))
+ if [ "$current" -ne "$new_brightness" ]; then
+ echo "$new_brightness" >"$STATE_FILE"
+ set_brightness_in_background "$new_brightness"
+ fi
+ pkill -RTMIN+9 waybar
+ ;;
+"right_click")
+ new_brightness=0
+ if [ "$current" -ne "$new_brightness" ]; then
+ echo "$new_brightness" >"$STATE_FILE"
+ set_brightness_in_background "$new_brightness"
+ fi
+ pkill -RTMIN+9 waybar
+ ;;
+"left_click")
+ new_brightness=100
+ if [ "$current" -ne "$new_brightness" ]; then
+ echo "$new_brightness" >"$STATE_FILE"
+ set_brightness_in_background "$new_brightness"
+ fi
+ pkill -RTMIN+9 waybar
+ ;;
+esac
diff --git a/waybar/waybar/scripts/mediaplayer.py b/waybar/waybar/scripts/mediaplayer.py
@@ -0,0 +1,143 @@
+#!/usr/bin/env python3
+import argparse
+import logging
+import sys
+import signal
+import gi
+import json
+
+gi.require_version("Playerctl", "2.0")
+from gi.repository import Playerctl, GLib
+
+logger = logging.getLogger(__name__)
+
+
+def write_output(text, player):
+ logger.info("Writing output")
+
+ output = {
+ "text": text,
+ "class": "custom-" + player.props.player_name,
+ "alt": player.props.player_name,
+ }
+
+ sys.stdout.write(json.dumps(output) + "\n")
+ sys.stdout.flush()
+
+
+def on_play(player, status, manager):
+ logger.info("Received new playback status")
+ on_metadata(player, player.props.metadata, manager)
+
+
+def on_metadata(player, metadata, manager):
+ logger.info("Received new metadata")
+ track_info = ""
+
+ if (
+ player.props.player_name == "spotify"
+ and "mpris:trackid" in metadata.keys()
+ and ":ad:" in player.props.metadata["mpris:trackid"]
+ ):
+ track_info = "AD PLAYING"
+ elif player.get_artist() != "" and player.get_title() != "":
+ track_info = "{artist} - {title}".format(
+ artist=player.get_artist(), title=player.get_title()
+ )
+ else:
+ track_info = player.get_title()
+
+ if player.props.status != "Playing" and track_info:
+ track_info = " " + track_info
+ write_output(track_info, player)
+
+
+def on_player_appeared(manager, player, selected_player=None):
+ if player is not None and (
+ selected_player is None or player.name == selected_player
+ ):
+ init_player(manager, player)
+ else:
+ logger.debug("New player appeared, but it's not the selected player, skipping")
+
+
+def on_player_vanished(manager, player):
+ logger.info("Player has vanished")
+ sys.stdout.write("\n")
+ sys.stdout.flush()
+
+
+def init_player(manager, name):
+ logger.debug("Initialize player: {player}".format(player=name.name))
+ player = Playerctl.Player.new_from_name(name)
+ player.connect("playback-status", on_play, manager)
+ player.connect("metadata", on_metadata, manager)
+ manager.manage_player(player)
+ on_metadata(player, player.props.metadata, manager)
+
+
+def signal_handler(sig, frame):
+ logger.debug("Received signal to stop, exiting")
+ sys.stdout.write("\n")
+ sys.stdout.flush()
+ # loop.quit()
+ sys.exit(0)
+
+
+def parse_arguments():
+ parser = argparse.ArgumentParser()
+
+ # Increase verbosity with every occurrence of -v
+ parser.add_argument("-v", "--verbose", action="count", default=0)
+
+ # Define for which player we're listening
+ parser.add_argument("--player")
+
+ return parser.parse_args()
+
+
+def main():
+ arguments = parse_arguments()
+
+ # Initialize logging
+ logging.basicConfig(
+ stream=sys.stderr,
+ level=logging.DEBUG,
+ format="%(name)s %(levelname)s %(message)s",
+ )
+
+ # Logging is set by default to WARN and higher.
+ # With every occurrence of -v it's lowered by one
+ logger.setLevel(max((3 - arguments.verbose) * 10, 0))
+
+ # Log the sent command line arguments
+ logger.debug("Arguments received {}".format(vars(arguments)))
+
+ manager = Playerctl.PlayerManager()
+ loop = GLib.MainLoop()
+
+ manager.connect(
+ "name-appeared", lambda *args: on_player_appeared(*args, arguments.player)
+ )
+ manager.connect("player-vanished", on_player_vanished)
+
+ signal.signal(signal.SIGINT, signal_handler)
+ signal.signal(signal.SIGTERM, signal_handler)
+ signal.signal(signal.SIGPIPE, signal.SIG_DFL)
+
+ for player in manager.props.player_names:
+ if arguments.player is not None and arguments.player != player.name:
+ logger.debug(
+ "{player} is not the filtered player, skipping it".format(
+ player=player.name
+ )
+ )
+ continue
+
+ init_player(manager, player)
+
+ loop.run()
+
+
+if __name__ == "__main__":
+ main()
diff --git a/waybar/waybar/scripts/uptime.sh b/waybar/waybar/scripts/uptime.sh
@@ -0,0 +1,6 @@
+#!/usr/bin/env bash
+UPTIME_PRETTY=$(uptime -p)
+
+UPTIME_FORMATTED=$(echo "$UPTIME_PRETTY" | sed 's/^up //;s/,*$//;s/minute/m/; s/hour/h/; s/day/d/; s/s//g')
+
+echo " $UPTIME_FORMATTED"
diff --git a/waybar/waybar/style.css b/waybar/waybar/style.css
@@ -0,0 +1,129 @@
+@import "colors.css";
+
+* {
+ border: none;
+ font-family: "JetBrainsMono Nerd Font Propo, sans-serif";
+ /* font-family: "SF Mono"; */
+ font-size: 12px;
+ font-weight: bold;
+ min-height: 0;
+}
+
+/* Keyframe animations */
+@keyframes urgent-blink {
+ 0% {
+ color: #eb4d4b;
+ }
+
+ 50% {
+ color: #ffffff;
+ }
+
+ 100% {
+ color: #eb4d4b;
+ }
+}
+
+window#waybar {
+ background-color: alpha(@background, 0.7);
+ color: @foreground;
+}
+
+/* Workspaces */
+#workspaces {
+ margin-right: 0.75rem;
+ min-width: 30px;
+}
+
+#workspaces button {
+ margin: 0 5px 0 5px;
+}
+
+#workspaces button.active {
+ color: @background;
+ background-color: @color1;
+}
+
+#workspaces button.urgent {
+ color: #ffffff;
+ background-color: rgba(255, 0, 0, 0.5);
+}
+
+/* Modules */
+#battery,
+#clock {
+ margin: 0 0.45rem;
+}
+
+#backlight,
+#bluetooth,
+#cpu,
+#temperature,
+#memory,
+#mpris,
+#pulseaudio {
+ margin: 0 0.45rem;
+}
+
+#tray {
+ margin-left: 0.25rem;
+}
+
+#bluetooth.connected {
+ color: @color1;
+}
+
+#battery:not(.charging).warning {
+ color: #FFA500;
+}
+
+#battery:not(.charging).critical {
+ color: #FF0000;
+}
+
+#network.disconnected {
+ color: #FF0000;
+}
+
+/* Groups */
+#audio,
+#hardware,
+#powerofmachine,
+#network {
+ margin: 0 0.55rem;
+}
+
+#expand-tray {
+ margin-right: 1em;
+}
+
+#power-profiles-daemon.power-saver {
+ color: rgba(0, 250, 0, 1);
+}
+
+#power-profiles-daemon.performance {
+ color: rgba(200, 0, 0, 1);
+}
+
+/* Custom modules */
+#custom-screenrecording-indicator {
+ margin: 0 1em;
+ color: #ff0000;
+ animation-name: urgent-blink;
+ animation-duration: 1s;
+ animation-timing-function: steps(18);
+ animation-iteration-count: infinite;
+ animation-direction: alternate;
+}
+
+#custom-uptime {
+ margin: 0 0.55rem;
+}
+
+#custom-pomodoro {
+ margin: 0 0.55rem;
+}
+
+#custom-brightness {
+ margin: 0 0.55rem;
+}
diff --git a/waybar/waybar/themes/blacklotus.css b/waybar/waybar/themes/blacklotus.css
@@ -0,0 +1,8 @@
+/* BlackLotus Colorscheme */
+@define-color background #0B0A0F;
+@define-color foreground #D7D2E9;
+
+@define-color color1 #A277FF;
+@define-color color3 #E363C9;
+@define-color color2 #6E8CFF;
+@define-color color4 #2EE2D0;
diff --git a/waybar/waybar/themes/catppuccin-mocha.css b/waybar/waybar/themes/catppuccin-mocha.css
@@ -0,0 +1,12 @@
+/*
+* Variant: Catppuccin Mocha
+* Maintainer: https://github.com/catppuccin/waybar.git
+*/
+
+@define-color background #1e1e2e;
+@define-color foreground #cdd6f4;
+
+@define-color color1 #fab387;
+@define-color color2 #f5e0dc;
+@define-color color3 #74c7ec;
+@define-color color4 #f9e2af;
diff --git a/waybar/waybar/themes/dracula.css b/waybar/waybar/themes/dracula.css
@@ -0,0 +1,8 @@
+@define-color background #282a36;
+@define-color selection #44475a;
+@define-color foreground #f8f8f2;
+
+@define-color color1 #bd93f9;
+@define-color color2 #ffb86c;
+@define-color color3 #ff5555;
+@define-color color4 #50fa7b;
diff --git a/waybar/waybar/themes/gruvbox-dark.css b/waybar/waybar/themes/gruvbox-dark.css
@@ -0,0 +1,12 @@
+/* Gruvbox Dark Hard – only 8 colors you’ll ever need */
+@define-color background #1d2021; /* darkest */
+@define-color background0 #282828; /* main background */
+@define-color background1 #3c3836; /* statusbars, selected lines */
+@define-color background2 #504945; /* subtle highlights */
+@define-color foreground #ebdbb2; /* main text */
+@define-color foreground0 #fbf1c7; /* brightest text (rarely used) */
+@define-color accent #fe8019; /* bright orange – main accent */
+@define-color color1 #cc241d; /* dark red */
+@define-color color2 #98971a; /* dark green */
+@define-color color3 #d79921; /* dark yellow */
+@define-color color4 #458588; /* dark blue */
diff --git a/waybar/waybar/themes/kanagawa.css b/waybar/waybar/themes/kanagawa.css
@@ -0,0 +1,7 @@
+@define-color foreground #DCD7BA;
+@define-color background #1F1F28;
+
+@define-color color1 #FF5D62;
+@define-color color2 #7AA89F;
+@define-color color3 #E6C384;
+@define-color color4 #7E9CD8;
diff --git a/waybar/waybar/themes/rose-pine.css b/waybar/waybar/themes/rose-pine.css
@@ -0,0 +1,13 @@
+/*
+* Variant: Rosé Pine
+* Maintainer: DankChoir
+* Modified for few colors
+*/
+
+@define-color background #191724;
+@define-color foreground #1f1d2e;
+
+@define-color color1 #eb6f92;
+@define-color color2 #f6c177;
+@define-color color3 #ebbcba;
+@define-color color4 #31748f;
diff --git a/waybar/waybar/themes/tokyonight.css b/waybar/waybar/themes/tokyonight.css
@@ -0,0 +1,6 @@
+@define-color background #1a1b26;
+@define-color foreground #c0caf5;
+
+@define-color color1 #7dcfff;
+@define-color color2 #f7768e;
+@define-color color3 #7aa2f7;