[i3+sway] Setup brightness controll for ddc monitors
This commit is contained in:
@@ -343,7 +343,7 @@ in {
|
|||||||
|
|
||||||
modules-left = [ "sway/workspaces" "sway/mode" ];
|
modules-left = [ "sway/workspaces" "sway/mode" ];
|
||||||
modules-center = [ ];
|
modules-center = [ ];
|
||||||
modules-right = [ "disk" "cpu" "memory" "pulseaudio" "backlight" "network" "battery" "tray" "clock" ];
|
modules-right = [ "disk" "cpu" "memory" "pulseaudio" "custom/backlight-ddc" "backlight" "network" "battery" "tray" "clock" ];
|
||||||
|
|
||||||
"sway/workspaces" = {
|
"sway/workspaces" = {
|
||||||
disable-scroll = true;
|
disable-scroll = true;
|
||||||
@@ -400,6 +400,23 @@ in {
|
|||||||
tooltip = false;
|
tooltip = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
"custom/backlight-ddc" = {
|
||||||
|
exec = pkgs.writeShellScript "waybar-backlight-ddc" ''
|
||||||
|
if command -v ddcutil &>/dev/null; then
|
||||||
|
# Display current brightness
|
||||||
|
brightness=$(ddcutil getvcp 10 --brief 2>/dev/null | awk '{print $4}')
|
||||||
|
if [ -n "$brightness" ]; then
|
||||||
|
echo "☀️ $brightness%"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
interval = 5;
|
||||||
|
format = "{}";
|
||||||
|
on-scroll-up = "ddcutil setvcp 10 + 5 2>/dev/null &";
|
||||||
|
on-scroll-down = "ddcutil setvcp 10 - 5 2>/dev/null &";
|
||||||
|
tooltip = false;
|
||||||
|
};
|
||||||
|
|
||||||
"network" = {
|
"network" = {
|
||||||
format-wifi = "📶 {essid} ({signalStrength}%)";
|
format-wifi = "📶 {essid} ({signalStrength}%)";
|
||||||
format-ethernet = "🔌 {ipaddr}";
|
format-ethernet = "🔌 {ipaddr}";
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ in
|
|||||||
users.users.johno = {
|
users.users.johno = {
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
description = "John Ogle";
|
description = "John Ogle";
|
||||||
extraGroups = [ "wheel" "networkmanager" "audio" "video" ] ++ cfg.extraGroups;
|
extraGroups = [ "wheel" "networkmanager" "audio" "video" "i2c" ] ++ cfg.extraGroups;
|
||||||
};
|
};
|
||||||
|
|
||||||
users.users.eli = mkIf cfg.kids {
|
users.users.eli = mkIf cfg.kids {
|
||||||
|
|||||||
Reference in New Issue
Block a user