Skip to content

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

License

Notifications You must be signed in to change notification settings

hodgesds/SwayOSD

This branch is 1 commit ahead of, 50 commits behind ErikReider/SwayOSD:main.

Repository files navigation

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
  • Customizable maximum Volume
  • Capslock change (Note: doesn't change the caps lock state)
  • Brightness change indicator

Usage:

# OSD window
exec swayosd

or start with a max-volume set (default is 100)

exec swayosd --max-volume 120
# 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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 92.8%
  • Meson 6.1%
  • JavaScript 1.1%