aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar remph <lhr@disroot.org>2024-10-31 18:26:08 +0000
committerLibravatar remph <lhr@disroot.org>2024-11-03 02:49:53 +0000
commit075e8ac472403934f4ca383beae2cd9ac555f71a (patch)
tree0b15f8fcbea9017b5d361b6733fd3d594bee751c
parentb07d54a12e7d42228093d0da7365617defd042e6 (diff)
Minor changes:
* Allow changing volume/brightness while locked in Sway * Ensure separate wob instance for each WAYLAND_DISPLAY * Update copyright, mostly for other branches based on this
-rw-r--r--PKGBUILD2
-rw-r--r--README.md22
-rw-r--r--swob-swayconfig11
-rwxr-xr-xswob.sh8
4 files changed, 25 insertions, 18 deletions
diff --git a/PKGBUILD b/PKGBUILD
index b90a172..83e332d 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -5,7 +5,7 @@ pkgdesc='Volume and brightness controls for wayland, using wob'
arch=(any) # limited only by dependencies
depends=(sh coreutils sed wob alsa-utils brightnessctl)
url='https://github.com/el-remph/swob'
-license=(FSFULLRWD)
+license=(GPL-3.0-or-later)
provides=(swob)
source=("git+$url")
b2sums=(SKIP)
diff --git a/README.md b/README.md
index 3825d9c..057c849 100644
--- a/README.md
+++ b/README.md
@@ -5,7 +5,7 @@ This is a simple/stupid helper script and config files to provide volume and
brightness controls under Wayland using [wob]. Sway is *not* mandatory (the
helper script doesn't depend on sway or any wlroots features); the name is
simply because sway was the first compositor I configured this for. Other
-compositor configurations are available; see [Installation](#installation).
+compositor configurations are available; see [&sect;Installation](#installation).
[wob]: https://github.com/francma/wob
@@ -52,10 +52,18 @@ Copying
Copyright &copy; 2024 The Remph <lhr@disroot.org>
-These files are free software; the Remph gives unlimited permission to copy
-and/or distribute them, with or without modification, as long as this notice
-is preserved.
+This program is free software: you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the Free
+Software Foundation, either version 3 of the License, or (at your option)
+any later version.
-This software is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
-implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+more details.
+
+A copy of the full GPL can be found at <https://www.gnu.org/licenses/GPL>.
+
+As an additional permission under GNU GPL version 3 section 7, the section 4
+requirement to distribute a copy of the GPL along with the work is waived,
+provided that the above notices are distributed intact instead.
diff --git a/swob-swayconfig b/swob-swayconfig
index 969326b..b74c114 100644
--- a/swob-swayconfig
+++ b/swob-swayconfig
@@ -1,5 +1,6 @@
-bindsym XF86MonBrightnessDown exec swob.sh brightness 5%-
-bindsym XF86MonBrightnessUp exec swob.sh brightness 5%+
-bindsym XF86AudioLowerVolume exec swob.sh volume 5%-
-bindsym XF86AudioRaiseVolume exec swob.sh volume 5%+
-bindsym XF86AudioMute exec swob.sh volume toggle
+# `exec exec' prevents pointless extra shell process
+bindsym --locked XF86MonBrightnessDown exec exec swob.sh brightness 5%-
+bindsym --locked XF86MonBrightnessUp exec exec swob.sh brightness 5%+
+bindsym --locked XF86AudioLowerVolume exec exec swob.sh volume 5%-
+bindsym --locked XF86AudioRaiseVolume exec exec swob.sh volume 5%+
+bindsym --locked XF86AudioMute exec exec swob.sh volume toggle
diff --git a/swob.sh b/swob.sh
index bdcdf01..77968fa 100755
--- a/swob.sh
+++ b/swob.sh
@@ -1,12 +1,10 @@
#!/bin/sh
# SPDX-FileCopyrightText: 2023-2024 The Remph <lhr@disroot.org>
-# SPDX-License-Identifier: FSFULLRWD
+# SPDX-License-Identifier: GPL-3.0-or-later
-wobfifo=${XDG_RUNTIME_DIR:-${TMPDIR:-/tmp}}/wob
-wobini=
-readonly wobfifo
-# `set -e' comes after readonly, which isn't vital enough to kill the script for
set ${BASH_VERSION:+-o pipefail} -efmu
+wobfifo=$XDG_RUNTIME_DIR/$WAYLAND_DISPLAY.swob
+wobini=
set_wobini() {
for dir in ${XDG_CONFIG_HOME:+"$XDG_CONFIG_HOME"} ~/.config /etc; do