spikespaz / hyprland-osd

A GTK based on screen display for keyboard shortcuts like caps-lock and volume

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SwayOSD

A OSD window for common actions like volume and capslock.

This is my first time coding in Rust so fixes and improvements are appreciated :)

Features:

  • Input and output volume change indicator
  • Input and output mute change indicator
  • Capslock change (Note: doesn't change the caps lock state)
  • Brightness change indicator

Usage:

# OSD window
exec swayosd

# Sink volume raise
bindsym XF86AudioRaiseVolume exec swayosd --output-volume raise
# Sink volume lower
bindsym XF86AudioLowerVolume exec  swayosd --output-volume lower
# Sink volume toggle mute
bindsym XF86AudioMute exec swayosd --output-volume mute-toggle
# Source volume toggle mute
bindsym XF86AudioMicMute exec swayosd --input-volume mute-toggle

# Capslock
bindsym --release Caps_Lock exec swayosd --caps-lock

# Capslock but specific LED name (/sys/class/leds/)
bindsym --release Caps_Lock exec swayosd --caps-lock-led input19::capslock

# Brightness raise
bindsym XF86MonBrightnessUp exec swayosd --brightness raise
# Brightness lower
bindsym XF86MonBrightnessDown exec swayosd --brightness lower

Brightness Control

Some devices may not have permission to write /sys/class/backlight/*/brightness.

Workaround will be adding a rule inside udev:

  1. Add udev rules:

/etc/udev/rules.d/99-swayosd.rules

ACTION=="add", SUBSYSTEM=="backlight", RUN+="/bin/chgrp video /sys/class/backlight/%k/brightness"
ACTION=="add", SUBSYSTEM=="backlight", RUN+="/bin/chmod g+w /sys/class/backlight/%k/brightness"
  1. Add user to video group by running sudo usermod -a -G video $USER
  2. Reboot system for udev rules to take effect

Install

Available on the AUR thanks to @jgmdev!

Images

image

image

About

A GTK based on screen display for keyboard shortcuts like caps-lock and volume

License:GNU General Public License v3.0


Languages

Language:Rust 100.0%