summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoe <rbo@gmx.us>2024-07-09 21:28:23 +0200
committerJoe <rbo@gmx.us>2024-07-09 21:28:23 +0200
commit965d2b52a2846500f14080d0cec19efca9c5c474 (patch)
treebd64f8b3dcce79802b7e4f6886b186d33b81ff25
parentup (diff)
downloaddotfiles-bsd-965d2b52a2846500f14080d0cec19efca9c5c474.tar.gz
dotfiles-bsd-965d2b52a2846500f14080d0cec19efca9c5c474.tar.bz2
dotfiles-bsd-965d2b52a2846500f14080d0cec19efca9c5c474.tar.xz
dotfiles-bsd-965d2b52a2846500f14080d0cec19efca9c5c474.tar.zst
dotfiles-bsd-965d2b52a2846500f14080d0cec19efca9c5c474.zip
added copyq
-rwxr-xr-x.local/bin/linkview15
1 files changed, 13 insertions, 2 deletions
diff --git a/.local/bin/linkview b/.local/bin/linkview
index 8874f08..6d08dc3 100755
--- a/.local/bin/linkview
+++ b/.local/bin/linkview
@@ -25,6 +25,7 @@ use constant {
W3M_PATH => 'w3m',
BROWSER_PATH => $BROWSER,
NOTIFYSEND_PATH => 'notify-send',
+ COPYQ_PATH => 'copyq',
HOSTNAME => (split /\./, hostname())
};
use constant PROG_LIST => "" .
@@ -36,7 +37,8 @@ use constant PROG_LIST => "" .
"nsxiv" . "\n" .
"zathura" . "\n" .
"w3m" . "\n" .
-"browser" . "\n";
+"browser" . "\n" .
+"clip" . "\n";
use constant QUAL_LIST => "" .
"1440" . "\n" .
"1080" . "\n" .
@@ -373,6 +375,15 @@ sub open_link
};
}
}
+ elsif ($a eq "clip") {
+ $pid = fork();
+ if (not $pid) {
+ setsid();
+ capture {
+ exec(COPYQ_PATH, "copy", $url);
+ };
+ }
+ }
return;
}
@@ -382,7 +393,7 @@ sub dmenu_prompt
my $answer;
my $list = PROG_LIST;
- $answer = `printf "$list\nURL: $url\n" | dmenu -i -l 11 -m 0`;
+ $answer = `printf "$list\nURL: $url\n" | dmenu -i -l 12 -m 0`;
chomp $answer;
return $answer;
}