diff options
Diffstat (limited to '.local/bin/linkview')
-rwxr-xr-x | .local/bin/linkview | 15 |
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; } |