commit 9b03dfcc4f851058f52a39f85498d2a6f4c77864 parent 3e342a4f318455bd5b8cabdcccd1acc7d70b0e1b Author: Yuval Langer <yuval.langer@gmail.com> Date: Sat, 30 Mar 2024 20:03:12 +0300 Use plain shell. Diffstat:
D | bin/brightness | | | 54 | ------------------------------------------------------ |
A | bin/brightness-down | | | 7 | +++++++ |
A | bin/brightness-up | | | 7 | +++++++ |
3 files changed, 14 insertions(+), 54 deletions(-)
diff --git a/bin/brightness b/bin/brightness @@ -1,54 +0,0 @@ -#!/usr/bin/env -S guile -e main -s -!# - -(use-modules (ice-9 match)) - -(define* (display-help-message #:key (self #f)) - (define (make-help-message self) - (format #t "Usage: - ~a up - ~a down -" - self - self)) - (if self - (make-help-message self) - (make-help-message "brightness"))) - -(define (main args) - (match args - ((self "get") - (system* "gdbus" - "call" - "--session" - "--dest" - "org.gnome.SettingsDaemon.Power" - "--object-path" - "/org/gnome/SettingsDaemon/Power" - "--method" - "org.gnome.SettingsDaemon.Power.Screen.StepUp" - )) - ((self "up") - (system* "gdbus" - "call" - "--session" - "--dest" - "org.gnome.SettingsDaemon.Power" - "--object-path" - "/org/gnome/SettingsDaemon/Power" - "--method" - "org.gnome.SettingsDaemon.Power.Screen.StepUp" - )) - ((self "down") - (system* "gdbus" - "call" - "--session" - "--dest" - "org.gnome.SettingsDaemon.Power" - "--object-path" - "/org/gnome/SettingsDaemon/Power" - "--method" - "org.gnome.SettingsDaemon.Power.Screen.StepDown" - )) - ((self . rest) - (display-help-message #:self self)))) diff --git a/bin/brightness-down b/bin/brightness-down @@ -0,0 +1,7 @@ +#!/bin/sh + +gdbus call \ + --session \ + --dest org.gnome.SettingsDaemon.Power \ + --object-path /org/gnome/SettingsDaemon/Power \ + --method org.gnome.SettingsDaemon.Power.Screen.StepDown diff --git a/bin/brightness-up b/bin/brightness-up @@ -0,0 +1,7 @@ +#!/bin/sh + +gdbus call \ + --session \ + --dest org.gnome.SettingsDaemon.Power \ + --object-path /org/gnome/SettingsDaemon/Power \ + --method org.gnome.SettingsDaemon.Power.Screen.StepUp