diff --git a/DOC.md b/DOC.md index ecc5e3a..3a52898 100644 --- a/DOC.md +++ b/DOC.md @@ -8,6 +8,7 @@ You can install another programs for your customization. This is for the example ```bash sudo apt install -y pulseaudio pavucontrol pulseaudio-utils # For volume script +sudo apt install -y brightnessctl # For brightness control sudo apt install -y nitrogen # For wallpaper sudo apt install -y lxpolkit # For polkit sudo apt install -y xcompmgr # For transparent supporting diff --git a/aji.sh b/aji.sh index 8625b8e..0be40ab 100644 --- a/aji.sh +++ b/aji.sh @@ -6,9 +6,7 @@ vol=$(awk -F"[][]" '/Left:/ { print $2 }' <(amixer sget Master)) capacity=$(cat /sys/class/power_supply/BAT1/capacity) status=$(cat /sys/class/power_supply/BAT1/status) # Brightness -conn=$(xrandr -q | grep ' connected' | head -n 1 | cut -d ' ' -f1) -a=$(xrandr --verbose --current | grep ^$conn -A5 | tail -n1) -bright="${a##* }" +bright=$(echo $(( 100 * $(brightnessctl get) / $(brightnessctl max) ))%) if [ "$1" == "rofi" ]; then rofi -modi drun,power:~/.config/rofi/power-menu -show drun -show-icons -theme Arc-Dark.rasi -columns 2 -lines 10 -window-thumbnail -opacity -width 80 -sidebar-mode -theme-str 'listview {columns: 2; lines: 10;} window {width: 80%; height: 60%;}' diff --git a/config.h b/config.h index 9842592..7250c7e 100644 --- a/config.h +++ b/config.h @@ -102,11 +102,18 @@ static const char *nmcedit[] = { "nm-connection-editor" , NULL }; static const char *top[] = { "kitty" , "htop" , NULL }; +static const char *briup[] = { "brightnessctl", "set", "+10%" }; +static const char *bridown[] = { "brightnessctl", "set", "10%-" }; + static const char *intip[] = { "bash" , "/home/aji/.dwm/aji.sh", "info"}; + #include "aji.c" +#include static const Key keys[] = { /* modifier key function argument */ + { 0, XF86XK_MonBrightnessDown, spawn, {.v = bridown} }, + { 0, XF86XK_MonBrightnessUp, spawn, {.v = briup} }, { MODKEY, XK_i, spawn, {.v = intip} }, { MODKEY, XK_BackSpace, view, {0} }, { MODKEY, XK_a, view, {.ui = ~0} }, // Select all tags. Cancel it with `MODKEY + [tag key]`.