From 95dc5cd7772487f13134fe25876c1a2cd60dffc4 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Thu, 2 Mar 2017 15:29:38 -0800 Subject: [PATCH] [XMonad] Show current brightness when adjusting with volnoti --- dotfiles/lib/bin/show_brightness.sh | 9 +++++++++ dotfiles/xmonad/xmonad.hs | 3 +++ 2 files changed, 12 insertions(+) create mode 100755 dotfiles/lib/bin/show_brightness.sh diff --git a/dotfiles/lib/bin/show_brightness.sh b/dotfiles/lib/bin/show_brightness.sh new file mode 100755 index 00000000..a10fdd91 --- /dev/null +++ b/dotfiles/lib/bin/show_brightness.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env sh + +actual="$(cat /sys/class/backlight/intel_backlight/actual_brightness)" +max="$(cat /sys/class/backlight/intel_backlight/max_brightness)" + +temp="$(( $actual * 100 ))" +percentage="$(( $temp/$max ))" + +volnoti-show "$percentage" diff --git a/dotfiles/xmonad/xmonad.hs b/dotfiles/xmonad/xmonad.hs index 3877e683..6cc33c54 100644 --- a/dotfiles/xmonad/xmonad.hs +++ b/dotfiles/xmonad/xmonad.hs @@ -740,6 +740,9 @@ addKeys conf@XConfig {modMask = modm} = , ((mod3Mask, xK_w), spawn "set_volume.sh up") , ((mod3Mask, xK_s), spawn "set_volume.sh down") + , ((0, xF86XK_MonBrightnessUp), spawn "show_brightness.sh") + , ((0, xF86XK_MonBrightnessDown), spawn "show_brightness.sh") + ] ++ -- Replace moving bindings