Skip to content

Commit e78809d

Browse files
committed
keyindicator: customizable ON/OFF strings
1 parent 9a396b1 commit e78809d

6 files changed

+233
-3
lines changed

keyindicator/LICENSE.md

+225
Large diffs are not rendered by default.

keyindicator/README.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22

33
Show the status of capslock or numlock.
44

5-
![](keyindicator-active.png)
6-
7-
![](keyindicator-inactive.png)
5+
![](keyindicator-active-vs-inactive.png)
86

97
# Installation
108

@@ -25,6 +23,8 @@ KEY=CAPS
2523
markup=pango
2624
interval=once
2725
signal=11
26+
#TEXT_ON=CapsLockOn
27+
#TEXT_OFF=CapsLockOff
2828
#COLOR_ON=#00FF00
2929
#COLOR_OFF=#222222
3030
#BG_COLOR_ON=
@@ -36,6 +36,8 @@ KEY=NUM
3636
markup=pango
3737
interval=once
3838
signal=11
39+
#TEXT_ON=NumLockOn
40+
#TEXT_OFF=NumLockOff
3941
#COLOR_ON=#00FF00
4042
HIDE_WHEN_OFF=1
4143
```

keyindicator/keyindicator

+3
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ use File::Basename;
2323

2424
# Default values
2525
my $indicator = $ENV{BLOCK_INSTANCE} || $ENV{KEY} || "CAPS";
26+
my $text_on = $ENV{TEXT_ON} || $indicator;
27+
my $text_off = $ENV{TEXT_OFF} || $indicator;
2628
my $color_on = $ENV{COLOR_ON} || "#00FF00";
2729
my $color_off = $ENV{COLOR_OFF} || "#222222";
2830
my $bg_color_on = $ENV{BG_COLOR_ON};
@@ -77,6 +79,7 @@ if ($hide and !$indicator_status) {
7779
}
7880

7981
# Output
82+
$indicator = $indicator_status ? $text_on : $text_off;
8083
my $fg_color = $indicator_status ? $color_on : $color_off;
8184
my $bg_color = $indicator_status ? $bg_color_on : $bg_color_off;
8285

915 Bytes
Loading

keyindicator/keyindicator-active.png

-769 Bytes
Binary file not shown.
-770 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)