aboutsummaryrefslogtreecommitdiff
path: root/src/usr
diff options
context:
space:
mode:
authorB Stack <bgstack15@gmail.com>2020-03-17 14:52:46 -0400
committerB Stack <bgstack15@gmail.com>2020-03-17 14:52:46 -0400
commitb690c975dd84c6ee9595dfd667e37622504568a8 (patch)
tree0024ce9ea4e9bee695eb4682cea400a95c7176f0 /src/usr
parentinitial commit (diff)
downloadkeyboard-leds-trayicons-b690c975dd84c6ee9595dfd667e37622504568a8.tar.gz
keyboard-leds-trayicons-b690c975dd84c6ee9595dfd667e37622504568a8.tar.bz2
keyboard-leds-trayicons-b690c975dd84c6ee9595dfd667e37622504568a8.zip
add bunch of things
fix #1 add desktop file and xdg autostart file fix #2 add Makefile use make deplist move readme to src/.../doc add man pages
Diffstat (limited to 'src/usr')
-rwxr-xr-xsrc/usr/bin/keyboard-leds-trayicons (renamed from src/usr/bin/keyboard-leds-trayicons.sh)5
-rw-r--r--src/usr/share/applications/keyboard-leds-trayicons.desktop11
-rw-r--r--src/usr/share/doc/keyboard-leds-trayicons/README.md30
-rw-r--r--src/usr/share/man/man1/keyboard-leds-trayicons.1.md18
-rw-r--r--src/usr/share/man/man5/keyboard-leds-trayicons.conf.5.md38
5 files changed, 100 insertions, 2 deletions
diff --git a/src/usr/bin/keyboard-leds-trayicons.sh b/src/usr/bin/keyboard-leds-trayicons
index 18ce82a..118a0a9 100755
--- a/src/usr/bin/keyboard-leds-trayicons.sh
+++ b/src/usr/bin/keyboard-leds-trayicons
@@ -14,7 +14,8 @@
# Improve:
# provide way to change status of capslock by clicking the icon?
# Dependencies:
-# binaries: mktrayicon, awk, xset
+# raw: mktrayicon, awk, xset
+# devuan: mktrayicon, mawk | gawk, x11-xserver-utils
# little c: https://visualpharm.com/free-icons/c%20letter-595b40b65ba036ed117d1027
# license for icons: Use for free, but link to [icons8](https://icons8.com/license)
@@ -73,7 +74,7 @@ is_numlock_on() {
# LOAD CONFIGS
# order is important! The last one called gets precedence.
# instead of simply dot-sourcing the conf file, pass it to get_conf which only applies new values, so this process's environment is preserved
-for thisconf in "${KLT_GLOBAL_CONF}" "${KLT_USER_CONF}" "${KLT_CONF}" ;
+for thisconf in "${KLT_CONF}" "${KLT_USER_CONF}" "${KLT_GLOBAL_CONF}" ;
do
test -r "${thisconf}" && get_conf "${thisconf}"
done
diff --git a/src/usr/share/applications/keyboard-leds-trayicons.desktop b/src/usr/share/applications/keyboard-leds-trayicons.desktop
new file mode 100644
index 0000000..aa0fb8e
--- /dev/null
+++ b/src/usr/share/applications/keyboard-leds-trayicons.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Categories=Utility;TrayIcon;
+Comment=Show capslock and numlock indicators
+Exec=/usr/bin/keyboard-leds-trayicons
+Icon=capslock-on
+Keywords=trayicon;capslock;numlock;
+Name=Keyboard LEDs trayicons
+NoDisplay=false
+Terminal=false
+Type=Application
+X-GNOME-Autostart-Phase=WindowManager
diff --git a/src/usr/share/doc/keyboard-leds-trayicons/README.md b/src/usr/share/doc/keyboard-leds-trayicons/README.md
new file mode 100644
index 0000000..b1b727e
--- /dev/null
+++ b/src/usr/share/doc/keyboard-leds-trayicons/README.md
@@ -0,0 +1,30 @@
+# Readme for keyboard-leds-trayicons
+
+This tool, written in POSIX shell, places two icons in the notification area (aka system tray), that substitute for the keyboard LEDs for Capslock and Numlock.
+
+## How to configure
+You can set environment variable `KLT_CONF` to point to a config file, which gets loaded in a style similar to dot-sourcing a shell script. Existing environment variables will be preserved. `Keyboard-leds-trayicons` will already load the global values from `/etc/keyboard-leds-trayicons.conf` and from your user settings in `$HOME/.config/keyboard-leds-trayicons.conf`.
+
+Here is example config file.
+
+ KLT_CAPS_ON_ICON=capslock-on
+ KLT_CAPS_OFF_ICON=capslock-off
+ KLT_NUM_ON_ICON=numlock-on
+ KLT_NUM_OFF_ICON=numlock-off
+
+As a side effect of using `mktrayicon`, you can use an icon name that follows the [xdg spec](https://www.freedesktop.org/wiki/Specifications/icon-theme-spec/) or you can point to a specific filename. This project includes some simple letter icons in svg format.
+
+## Project license
+[CC-BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/)
+
+## Dependencies
+Package manager | packages
+--------------- | ------------------------------------------------------------------
+binary name | [mktrayicon](https://gitlab.com/bgstack15/mktrayicon), awk, xset
+deb | [mktrayicon](https://build.opensuse.org/package/show/home:bgstack15/mktrayicon), mawk | gawk, x11-xserver-utils
+rpm | undefined
+
+## Credits
+Bundled icons are used under license from Icon8.
+* little `c`: [https://visualpharm.com/free-icons/c%20letter-595b40b65ba036ed117d1027](https://visualpharm.com/free-icons/c%20letter-595b40b65ba036ed117d1027)
+* License for icons: Use for free, but link to [icons8](https://icons8.com/license)
diff --git a/src/usr/share/man/man1/keyboard-leds-trayicons.1.md b/src/usr/share/man/man1/keyboard-leds-trayicons.1.md
new file mode 100644
index 0000000..7fcc7ba
--- /dev/null
+++ b/src/usr/share/man/man1/keyboard-leds-trayicons.1.md
@@ -0,0 +1,18 @@
+keyboard-leds-trayicons 1 "March 2020" keyboard-leds-trayicons "User Manual"
+================================================================
+# NAME
+keyboard-leds-trayicons - show capslock and numlock indicators in tray
+# SYNOPSIS
+keyboard-leds-trayicons
+# DESCRIPTION
+Show capslock and numlock indicator icons in the panel tray. These can substitute for the keyboard LED icons for keyboards that are missing those features.
+No command-line parameters exist.
+# AUTHOR
+bgstack15
+# REPORTING BUGS
+Bug tracker: `<https://gitlab.com/bgstack15/keyboard-leds-trayicons>`
+# COPYRIGHT
+Copyright (C) 2020 bgstack15. License CC-BY-SA 4.0.
+This is free software: you are free to change it and redistribute it. There is NO WARRANTY, to the extent permitted by law.
+# SEE ALSO
+keyboard-leds-trayicons.conf(5)
diff --git a/src/usr/share/man/man5/keyboard-leds-trayicons.conf.5.md b/src/usr/share/man/man5/keyboard-leds-trayicons.conf.5.md
new file mode 100644
index 0000000..03f56b3
--- /dev/null
+++ b/src/usr/share/man/man5/keyboard-leds-trayicons.conf.5.md
@@ -0,0 +1,38 @@
+keyboard-leds-trayicons.conf 5 "March 2020" keyboard-leds-trayicons "File Formats and Conventions"
+================================================================
+# NAME
+keyboard-leds-trayicons.conf - the configuration file for keyboard-leds-trayicons
+# FILE FORMAT
+The file consists of key-value pairs, and is used primarily for changing what icons are displayed in the system tray. The file will be parsed in a manner similar to shell dot-sourcing the file.
+
+*key*=*value*
+
+Icon names will be resolved according to the xdg specification for icon lookups `[1]` as they will be sent through gtk3.
+
+# FULL EXAMPLE
+
+```
+KLT_CAPS_ON_ICON=capslock-on
+KLT_CAPS_OFF_ICON=capslock-off
+KLT_NUM_ON_ICON=numlock-on
+KLT_NUM_OFF_ICON=numlock-off
+KLT_KILLFILE="/var/run/user/$( id -u )/kill-all-leds-trayicons"
+```
+
+# DEFAULT ORDER
+The various config files, by default, are read in this order. First value defined take precedence, so once a variable is defined, it will not be used by a later file.
+
+1. File named in environment variable *KLT_CONF*
+2. $HOME/.config/keyboad-leds-trayicons.conf
+3. /etc/keyboard-leds-trayicons.conf
+
+# AUTHOR
+bgstack15
+# REPORTING BUGS
+Bug tracker: `<https://gitlab.com/bgstack15/keyboard-leds-trayicons>`
+# COPYRIGHT
+Copyright (C) 2020 bgstack15. License CC-BY-SA 4.0.
+This is free software: you are free to change it and redistribute it. There is NO WARRANTY, to the extent permitted by law.
+# SEE ALSO
+keyboard-leds-trayicons(1)
+[1] `https://specifications.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html#icon_lookup`
bgstack15