From ea10292e2c04efff760b2a55db00d0f03fd59a72 Mon Sep 17 00:00:00 2001 From: ryukamish Date: Sat, 11 Apr 2026 18:26:09 +0530 Subject: add: module indicator for screen recording --- waybar/config.jsonc | 10 ++++++++-- waybar/style.css | 5 +++++ waybar/waybar-screenrecord | 7 +++++++ 3 files changed, 20 insertions(+), 2 deletions(-) create mode 100755 waybar/waybar-screenrecord (limited to 'waybar') diff --git a/waybar/config.jsonc b/waybar/config.jsonc index 4345162..25616c3 100644 --- a/waybar/config.jsonc +++ b/waybar/config.jsonc @@ -3,6 +3,7 @@ "position": "top", "modules-left": [ "clock", + "custom/screenrecording-indicator", "niri/window" ], "modules-center": [ @@ -26,8 +27,7 @@ "format": "{app_id}" }, "clock": { - "format": "{:%a, %b %d %H:%M}", - "format-alt": "{:%Y-%m-%d}" + "format": "{:%a, %b %d %H:%M}" }, "memory": { "format": " {used}GiB" @@ -112,5 +112,11 @@ "on-scroll-down": "~/.config/waybar/brightness down", "on-click": "~/.config/waybar/brightness left_click", "on-click-right": "~/.config/waybar/brightness right_click" + }, + "custom/screenrecording-indicator": { + "on-click": "~/.config/waybar/screenrecord", + "exec": "~/.config/waybar/waybar-screenrecord", + "signal": 8, + "return-type": "json" } } diff --git a/waybar/style.css b/waybar/style.css index f6734ca..3e0f04a 100644 --- a/waybar/style.css +++ b/waybar/style.css @@ -27,3 +27,8 @@ window#waybar { #tray { padding: 0 8px; } + +/* custom modules */ +#custom-screenrecording-indicator { + color: #ff0000; +} diff --git a/waybar/waybar-screenrecord b/waybar/waybar-screenrecord new file mode 100755 index 0000000..ea7b046 --- /dev/null +++ b/waybar/waybar-screenrecord @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +if pgrep gpu-screen-reco >/dev/null; then + echo '{"text": "Recording 󰻂", "tooltip": "Stop recording", "class": "active"}' +else + echo '{"text": ""}' +fi -- cgit v1.3