Use brightnessctl for brightness control
This commit is contained in:
parent
1eb96573ee
commit
e5ffa98b80
1
DOC.md
1
DOC.md
@ -8,6 +8,7 @@ You can install another programs for your customization. This is for the example
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
sudo apt install -y pulseaudio pavucontrol pulseaudio-utils # For volume script
|
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 nitrogen # For wallpaper
|
||||||
sudo apt install -y lxpolkit # For polkit
|
sudo apt install -y lxpolkit # For polkit
|
||||||
sudo apt install -y xcompmgr # For transparent supporting
|
sudo apt install -y xcompmgr # For transparent supporting
|
||||||
|
4
aji.sh
4
aji.sh
@ -6,9 +6,7 @@ vol=$(awk -F"[][]" '/Left:/ { print $2 }' <(amixer sget Master))
|
|||||||
capacity=$(cat /sys/class/power_supply/BAT1/capacity)
|
capacity=$(cat /sys/class/power_supply/BAT1/capacity)
|
||||||
status=$(cat /sys/class/power_supply/BAT1/status)
|
status=$(cat /sys/class/power_supply/BAT1/status)
|
||||||
# Brightness
|
# Brightness
|
||||||
conn=$(xrandr -q | grep ' connected' | head -n 1 | cut -d ' ' -f1)
|
bright=$(echo $(( 100 * $(brightnessctl get) / $(brightnessctl max) ))%)
|
||||||
a=$(xrandr --verbose --current | grep ^$conn -A5 | tail -n1)
|
|
||||||
bright="${a##* }"
|
|
||||||
|
|
||||||
if [ "$1" == "rofi" ]; then
|
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%;}'
|
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%;}'
|
||||||
|
7
config.h
7
config.h
@ -102,11 +102,18 @@ static const char *nmcedit[] = { "nm-connection-editor" , NULL };
|
|||||||
|
|
||||||
static const char *top[] = { "kitty" , "htop" , 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"};
|
static const char *intip[] = { "bash" , "/home/aji/.dwm/aji.sh", "info"};
|
||||||
|
|
||||||
#include "aji.c"
|
#include "aji.c"
|
||||||
|
#include <X11/XF86keysym.h>
|
||||||
|
|
||||||
static const Key keys[] = {
|
static const Key keys[] = {
|
||||||
/* modifier key function argument */
|
/* modifier key function argument */
|
||||||
|
{ 0, XF86XK_MonBrightnessDown, spawn, {.v = bridown} },
|
||||||
|
{ 0, XF86XK_MonBrightnessUp, spawn, {.v = briup} },
|
||||||
{ MODKEY, XK_i, spawn, {.v = intip} },
|
{ MODKEY, XK_i, spawn, {.v = intip} },
|
||||||
{ MODKEY, XK_BackSpace, view, {0} },
|
{ MODKEY, XK_BackSpace, view, {0} },
|
||||||
{ MODKEY, XK_a, view, {.ui = ~0} }, // Select all tags. Cancel it with `MODKEY + [tag key]`.
|
{ MODKEY, XK_a, view, {.ui = ~0} }, // Select all tags. Cancel it with `MODKEY + [tag key]`.
|
||||||
|
Loading…
Reference in New Issue
Block a user