diff options
Diffstat (limited to '.local/bin/dmlog')
-rwxr-xr-x | .local/bin/dmlog | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/.local/bin/dmlog b/.local/bin/dmlog index 632f518..756d9b9 100755 --- a/.local/bin/dmlog +++ b/.local/bin/dmlog @@ -29,14 +29,15 @@ use constant CONFIRM => [ sub confirm { - my ($var) = @_; + my ($var, $color) = @_; my $list; my $choice; for (@{+CONFIRM}) { $list .= $_ . "\n"; } - $choice = `printf "%s" "$list" | dmenu -i -p "$var?"`; + $choice = `printf "%s" "$list" | \ + dmenu -i -p "$var?" -sb '$color' -shb '$color'`; chomp $choice; if ($choice eq ${+CONFIRM}[1]) { return (1); @@ -46,7 +47,7 @@ sub confirm sub action { - my ($var) = @_; + my ($var, $color) = @_; my $pid; chomp $var; @@ -77,7 +78,7 @@ sub action } } elsif ($var eq ${+LIST}[2]) { - if (confirm($var) == 1) { + if (confirm($var, $color) == 1) { if (HOSTNAME eq 'mother') { exec(LOGINCTL_PATH, 'terminate-session', 'self'); } @@ -85,7 +86,7 @@ sub action } } elsif ($var eq ${+LIST}[3]) { - if (confirm($var) == 1) { + if (confirm($var, $color) == 1) { if (HOSTNAME eq 'mother') { exec(LOGINCTL_PATH, 'reboot'); } @@ -103,7 +104,7 @@ sub action } } elsif ($var eq ${+LIST}[4]) { - if (confirm($var) == 1) { + if (confirm($var, $color) == 1) { system( NOTIF_PATH, '-u', @@ -128,12 +129,17 @@ sub main { my $list; my $choice; + my $color; + $color = '#cc241d'; + if (@ARGV == 1) { + $color = $ARGV[0]; + } for (@{+LIST}) { $list .= $_ . "\n"; } - $choice = `printf "%s" "$list" | dmenu -i`; - action($choice); + $choice = `printf "%s" "$list" | dmenu -i -sb '$color' -shb '$color'`; + action($choice, $color); return (0); } |