From a5be58007cb5639d9060ae4dbb54327d1e8dc0d5 Mon Sep 17 00:00:00 2001 From: Joe Date: Fri, 27 Dec 2024 12:00:06 +0100 Subject: good --- .local/bin/dmapps | 7 ++++++- .local/bin/dmbookm | 7 ++++++- .local/bin/dmkill | 17 +++++++++++------ .local/bin/dmpass | 4 ++++ 4 files changed, 27 insertions(+), 8 deletions(-) diff --git a/.local/bin/dmapps b/.local/bin/dmapps index 881be19..ec7a11a 100755 --- a/.local/bin/dmapps +++ b/.local/bin/dmapps @@ -239,12 +239,17 @@ sub main { my $action; my $prompt; + my $color; + $color = '#cc241d'; + if (@ARGV == 1) { + $color = $ARGV[0]; + } $prompt = PROG_LIST; if (hostname() eq "po-rbo.ln.ysosecure.com") { $prompt .= WORK_LIST; } - $action = `dmenu -i -l 100 < [ sub confirm { - my ($pid, $proc) = @_; + my ($pid, $proc, $color) = @_; my $list; my $choice; for (@{+CONFIRM}) { $list .= $_ . "\n"; } - $choice = `printf "%s" "$list" | dmenu -i -p "kill $proc ($pid)?"`; + $choice = `printf "%s" "$list" | dmenu -i -p "kill $proc ($pid)?" -sb '$color' -shb '$color'`; chomp $choice; if ($choice eq ${+CONFIRM}[1]) { return (1); @@ -28,7 +28,7 @@ sub confirm sub action { - my ($var, $user) = @_; + my ($var, $user, $color) = @_; my $pid; my $proc; @@ -42,7 +42,7 @@ sub action if ($var =~ /^\s*\S+\s+\S+\s+(\S+)/) { $proc = $1; } - if (confirm($pid, $proc) == 1) { + if (confirm($pid, $proc, $color) == 1) { exec(KILL_PATH, '-9', $pid); } return; @@ -53,10 +53,15 @@ sub main my $choice; my $ps; my $user; + my $color; + $color = '#cc241d'; + if (@ARGV == 1) { + $color = $ARGV[0]; + } $user = getpwuid($<); - $choice = `ps -U "$user" -o pid,user,comm,time,%cpu,%mem | dmenu -i -l 100`; - action($choice, $user); + $choice = `ps -U "$user" -o pid,user,comm,time,%cpu,%mem | dmenu -i -l 100 -sb '$color' -shb '$color'`; + action($choice, $user, $color); return (0); } diff --git a/.local/bin/dmpass b/.local/bin/dmpass index 060cf08..c0a10ba 100755 --- a/.local/bin/dmpass +++ b/.local/bin/dmpass @@ -3,8 +3,12 @@ full=0 if [ "$1" = "--full" ]; then full=1 + if [ "$2" ]; then + fi +elif [ "$1"]; then fi + if [ -n "$WAYLAND_DISPLAY" ]; then dmenu=dmenu-wl xdotool="ydotool type --file -" -- cgit v1.2.3