From ae581d7c37d99ddba39c50fe357d2effa8e53c03 Mon Sep 17 00:00:00 2001 From: Kevyn Valladares Date: Mon, 1 Dec 2025 21:04:34 -0700 Subject: [PATCH 1/6] Add hyprosd-mako: Mako OSD scripts for volume/brightness/mic --- .github/workflows/check.yml | 1 + hyprosd-mako/Makefile | 21 +++++++++++++++ hyprosd-mako/README.md | 48 ++++++++++++++++++++++++++++++++++ hyprosd-mako/brightness-notify | 12 +++++++++ hyprosd-mako/mic-notify | 13 +++++++++ hyprosd-mako/volume-notify | 16 ++++++++++++ 6 files changed, 111 insertions(+) create mode 100644 hyprosd-mako/Makefile create mode 100644 hyprosd-mako/README.md create mode 100755 hyprosd-mako/brightness-notify create mode 100755 hyprosd-mako/mic-notify create mode 100755 hyprosd-mako/volume-notify diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 7121bd5..7732574 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -17,6 +17,7 @@ jobs: - hyprprop - try_swap_workspace - hdrop + - hyprosd-mako steps: - uses: actions/checkout@v4 diff --git a/hyprosd-mako/Makefile b/hyprosd-mako/Makefile new file mode 100644 index 0000000..aaf62a7 --- /dev/null +++ b/hyprosd-mako/Makefile @@ -0,0 +1,21 @@ +DESTDIR ?= / +PREFIX ?= $(DESTDIR)usr/local +EXEC_PREFIX ?= $(PREFIX) +DATAROOTDIR ?= $(PREFIX)/share +BINDIR ?= $(EXEC_PREFIX)/bin + +SCRIPTS = brightness-notify mic-notify volume-notify + +all: + @echo "Nothing to build." + +install: + @for s in $(SCRIPTS); do \ + install -v -D -m 0755 $$s "$(BINDIR)/$$s"; \ + done + +uninstall: + @for s in $(SCRIPTS); do \ + rm -v "$(BINDIR)/$$s"; \ + done + diff --git a/hyprosd-mako/README.md b/hyprosd-mako/README.md new file mode 100644 index 0000000..76ac06d --- /dev/null +++ b/hyprosd-mako/README.md @@ -0,0 +1,48 @@ +# hyprosd-mako + +Lightweight OSD (On-Screen Display) notifications for Hyprland using Mako. + +Provides: +- Volume change OSD (`volume-notify`) +- Brightness change OSD (`brightness-notify`) +- Microphone mute/unmute OSD (`mic-notify`) + +## Dependencies +- mako + makoctl +- notify-send +- PipeWire (`wpctl`) +- brightnessctl + +## Installation +``` +make +sudo make install +``` + +## Uninstall +``` +sudo make uninstall +``` + +## Usage (Hyprland binds) +Add these to your Hyprland config: + +``` +# Volume +bindel = ,XF86AudioRaiseVolume, exec, wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+ && volume-notify +bindel = ,XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%- && volume-notify +bindel = ,XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle && volume-notify +# Brightness +bindel = ,XF86MonBrightnessUp, exec, brightnessctl set +5% && brightness-notify +bindel = ,XF86MonBrightnessDown, exec, brightnessctl set 5%- && brightness-notify +# Microphone +bindel = $mainMod, M, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle && mic-notify +``` + +## Why this helps +Hyprland has no built-in OSD with Mako. +This provides a minimal, fast, Wayland-native alternative with almost no dependencies. + +## Notes +Tested on Arch Linux with Hyprland and Mako. +Should work on any distribution with the required dependencies. diff --git a/hyprosd-mako/brightness-notify b/hyprosd-mako/brightness-notify new file mode 100755 index 0000000..90f14ba --- /dev/null +++ b/hyprosd-mako/brightness-notify @@ -0,0 +1,12 @@ +#!/bin/bash + +CUR=$(brightnessctl g) +MAX=$(brightnessctl m) +PCT=$((CUR * 100 / MAX)) + +makoctl list | awk '/Brightness/ {id=$2; sub(":", "", id); system("makoctl dismiss " id)}' + +notify-send -u low -r 91191 "Brightness" "${PCT}%" --hint=int:value:"$PCT" + +# Optional icons (requires a Nerd Font) +# BRIGHTNESS_ICONS=("" "" "") diff --git a/hyprosd-mako/mic-notify b/hyprosd-mako/mic-notify new file mode 100755 index 0000000..155121b --- /dev/null +++ b/hyprosd-mako/mic-notify @@ -0,0 +1,13 @@ +#!/bin/bash +STATE=$(wpctl get-volume @DEFAULT_AUDIO_SOURCE@ | grep -o MUTED) + +makoctl list | awk '/Microphone/ {id=$2; sub(":", "", id); system("makoctl dismiss " id)}' + +if [ "$STATE" ]; then + notify-send -u low -r 91192 "Microphone" "Muted" --hint=int:value:0 +else + notify-send -u low -r 91192 "Microphone" "Unmuted" --hint=int:value:100 +fi + +# Optional icons (requires a Nerd Font) +# MICROPHONE_ICONS=("","") diff --git a/hyprosd-mako/volume-notify b/hyprosd-mako/volume-notify new file mode 100755 index 0000000..72aa4f4 --- /dev/null +++ b/hyprosd-mako/volume-notify @@ -0,0 +1,16 @@ +#!/bin/bash + +VOL_INFO=$(wpctl get-volume @DEFAULT_AUDIO_SINK@) +VOL=$(echo "$VOL_INFO" | awk '{print int($2*100)}') +MUTED=$(echo "$VOL_INFO" | grep -o MUTED) + +makoctl list | awk '/Volume/ {id=$2; sub(":", "", id); system("makoctl dismiss " id)}' + +if [ "$MUTED" ]; then + notify-send -u low -r 91190 "Volume" "Muted" --hint=int:value:0 +else + notify-send -u low -r 91190 "Volume" "${VOL}%" --hint=int:value:"$VOL" +fi + +# Optional icons (requires a Nerd Font) +# VOLUME_ICONS=("" "" "") From 8259f168bdab1a14837c6ab37f3fb3adce7918ef Mon Sep 17 00:00:00 2001 From: Kevyn Valladares Date: Mon, 1 Dec 2025 21:36:15 -0700 Subject: [PATCH 2/6] Add hyprosd-mako entry to project README --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index ac09aaa..a0259dd 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ Community scripts and utilities for Hypr projects | [try_swap_workspace](./try_swap_workspace) | Binding to mimic the 'arbitrary workspace on arbitrary monitor' behavior | @schievel1 | | [scratchpad](./scratchpad) | A Bash script that instantly sends focused window to a special workspace named `scratchpad` and makes it easier to retrieve the window back to the current workspace | @niksingh710 | | [hdrop](./hdrop) | Run, show and hide programs via keybind. Emulates [tdrop](https://github.com/noctuid/tdrop) in Hyprland | @Schweber | +| [hyprosd-mako](./hyprosd-mako) | Lightweight Mako-based OSD scripts for volume, brightness, and microphone state | @KevynValladares21 | # Installing From 21ce1eb8862d89ee74024b3a3a034023db5fe2ae Mon Sep 17 00:00:00 2001 From: Kevyn Valladares Date: Sat, 6 Dec 2025 23:46:08 -0700 Subject: [PATCH 3/6] Update hyprosd-mako/brightness-notify Co-authored-by: Mihai Fufezan --- hyprosd-mako/brightness-notify | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hyprosd-mako/brightness-notify b/hyprosd-mako/brightness-notify index 90f14ba..7d9d0dc 100755 --- a/hyprosd-mako/brightness-notify +++ b/hyprosd-mako/brightness-notify @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash CUR=$(brightnessctl g) MAX=$(brightnessctl m) From bf5f6796222ca71f35402e842df3763e64a86825 Mon Sep 17 00:00:00 2001 From: Kevyn Valladares Date: Sat, 6 Dec 2025 23:55:49 -0700 Subject: [PATCH 4/6] Update shebangs and remove unused notify-send replacement IDs --- hyprosd-mako/brightness-notify | 2 +- hyprosd-mako/mic-notify | 7 ++++--- hyprosd-mako/volume-notify | 6 +++--- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/hyprosd-mako/brightness-notify b/hyprosd-mako/brightness-notify index 7d9d0dc..5b59287 100755 --- a/hyprosd-mako/brightness-notify +++ b/hyprosd-mako/brightness-notify @@ -6,7 +6,7 @@ PCT=$((CUR * 100 / MAX)) makoctl list | awk '/Brightness/ {id=$2; sub(":", "", id); system("makoctl dismiss " id)}' -notify-send -u low -r 91191 "Brightness" "${PCT}%" --hint=int:value:"$PCT" +notify-send -u low "Brightness" "${PCT}%" --hint=int:value:"$PCT" # Optional icons (requires a Nerd Font) # BRIGHTNESS_ICONS=("" "" "") diff --git a/hyprosd-mako/mic-notify b/hyprosd-mako/mic-notify index 155121b..9a20fe1 100755 --- a/hyprosd-mako/mic-notify +++ b/hyprosd-mako/mic-notify @@ -1,12 +1,13 @@ -#!/bin/bash +#!/usr/bin/env bash + STATE=$(wpctl get-volume @DEFAULT_AUDIO_SOURCE@ | grep -o MUTED) makoctl list | awk '/Microphone/ {id=$2; sub(":", "", id); system("makoctl dismiss " id)}' if [ "$STATE" ]; then - notify-send -u low -r 91192 "Microphone" "Muted" --hint=int:value:0 + notify-send -u low "Microphone" "Muted" --hint=int:value:0 else - notify-send -u low -r 91192 "Microphone" "Unmuted" --hint=int:value:100 + notify-send -u low "Microphone" "Unmuted" --hint=int:value:100 fi # Optional icons (requires a Nerd Font) diff --git a/hyprosd-mako/volume-notify b/hyprosd-mako/volume-notify index 72aa4f4..127e485 100755 --- a/hyprosd-mako/volume-notify +++ b/hyprosd-mako/volume-notify @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash VOL_INFO=$(wpctl get-volume @DEFAULT_AUDIO_SINK@) VOL=$(echo "$VOL_INFO" | awk '{print int($2*100)}') @@ -7,9 +7,9 @@ MUTED=$(echo "$VOL_INFO" | grep -o MUTED) makoctl list | awk '/Volume/ {id=$2; sub(":", "", id); system("makoctl dismiss " id)}' if [ "$MUTED" ]; then - notify-send -u low -r 91190 "Volume" "Muted" --hint=int:value:0 + notify-send -u low "Volume" "Muted" --hint=int:value:0 else - notify-send -u low -r 91190 "Volume" "${VOL}%" --hint=int:value:"$VOL" + notify-send -u low "Volume" "${VOL}%" --hint=int:value:"$VOL" fi # Optional icons (requires a Nerd Font) From 95c2149d9f5ae5ab624caebb359d57edc42cd7ee Mon Sep 17 00:00:00 2001 From: Kevyn Valladares Date: Sun, 7 Dec 2025 00:08:46 -0700 Subject: [PATCH 5/6] Add changelog entry for hyprosd-mako --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d6b6c0c..3ff43c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +### 2025-12-07 +hyprosd-mako: add OSD scripts for volume, brightness, and microphone + ### 2025-11-29 grimblast: remove superfluous use of external commands on test setup From 38757a37a0090a4d536cfa28a0cdb1743542492f Mon Sep 17 00:00:00 2001 From: Mihai Fufezan Date: Sun, 7 Dec 2025 15:18:00 +0200 Subject: [PATCH 6/6] hyprosd-mako: init Nix --- flake.nix | 1 + hyprosd-mako/default.nix | 45 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 hyprosd-mako/default.nix diff --git a/flake.nix b/flake.nix index f49795e..533d70c 100644 --- a/flake.nix +++ b/flake.nix @@ -16,6 +16,7 @@ overlays.default = _: prev: { grimblast = prev.callPackage ./grimblast {hyprland = null;}; hdrop = prev.callPackage ./hdrop {hyprland = null;}; + hyprosd-mako = prev.callPackage ./hyprosd-mako {}; hyprprop = prev.callPackage ./hyprprop {}; scratchpad = prev.callPackage ./scratchpad {hyprland = null;}; shellevents = prev.callPackage ./shellevents {hyprland = null;}; diff --git a/hyprosd-mako/default.nix b/hyprosd-mako/default.nix new file mode 100644 index 0000000..262e57e --- /dev/null +++ b/hyprosd-mako/default.nix @@ -0,0 +1,45 @@ +{ + lib, + stdenvNoCC, + makeWrapper, + brightnessctl, + coreutils, + libnotify, + mako, + wireplumber, +}: +stdenvNoCC.mkDerivation { + pname = "hyprosd-mako"; + version = "0.1"; + + src = ./.; + + nativeBuildInputs = [ + makeWrapper + ]; + + makeFlags = [ "PREFIX=$(out)" ]; + + postInstall = '' + for i in {volume,brightness,mic}; do + wrapProgram "$out/bin/$i-notify" --prefix PATH ':' \ + "${ + lib.makeBinPath ([ + coreutils + mako + wireplumber + brightnessctl + libnotify + ]) + }" + done + ''; + + meta = with lib; { + description = "Lightweight OSD notifications for Hyprland using Mako"; + license = licenses.mit; + platforms = platforms.unix; + maintainers = with maintainers; [ ]; + mainProgram = "volume-notify"; + }; +}