Skip to content

Commit

Permalink
keyindicator: customizable ON/OFF strings
Browse files Browse the repository at this point in the history
  • Loading branch information
Aster89 committed Feb 5, 2020
1 parent 9a396b1 commit e78809d
Show file tree
Hide file tree
Showing 6 changed files with 233 additions and 3 deletions.
225 changes: 225 additions & 0 deletions keyindicator/LICENSE.md

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions keyindicator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

Show the status of capslock or numlock.

![](keyindicator-active.png)

![](keyindicator-inactive.png)
![](keyindicator-active-vs-inactive.png)

# Installation

Expand All @@ -25,6 +23,8 @@ KEY=CAPS
markup=pango
interval=once
signal=11
#TEXT_ON=CapsLockOn
#TEXT_OFF=CapsLockOff
#COLOR_ON=#00FF00
#COLOR_OFF=#222222
#BG_COLOR_ON=
Expand All @@ -36,6 +36,8 @@ KEY=NUM
markup=pango
interval=once
signal=11
#TEXT_ON=NumLockOn
#TEXT_OFF=NumLockOff
#COLOR_ON=#00FF00
HIDE_WHEN_OFF=1
```
Expand Down
3 changes: 3 additions & 0 deletions keyindicator/keyindicator
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ use File::Basename;

# Default values
my $indicator = $ENV{BLOCK_INSTANCE} || $ENV{KEY} || "CAPS";
my $text_on = $ENV{TEXT_ON} || $indicator;
my $text_off = $ENV{TEXT_OFF} || $indicator;
my $color_on = $ENV{COLOR_ON} || "#00FF00";
my $color_off = $ENV{COLOR_OFF} || "#222222";
my $bg_color_on = $ENV{BG_COLOR_ON};
Expand Down Expand Up @@ -77,6 +79,7 @@ if ($hide and !$indicator_status) {
}

# Output
$indicator = $indicator_status ? $text_on : $text_off;
my $fg_color = $indicator_status ? $color_on : $color_off;
my $bg_color = $indicator_status ? $bg_color_on : $bg_color_off;

Expand Down
Binary file added keyindicator/keyindicator-active-vs-inactive.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed keyindicator/keyindicator-active.png
Binary file not shown.
Binary file removed keyindicator/keyindicator-inactive.png
Binary file not shown.

0 comments on commit e78809d

Please sign in to comment.