diff options
author | Raymaekers Luca <raymaekers.luca@gmail.com> | 2024-06-20 12:04:39 +0200 |
---|---|---|
committer | Raymaekers Luca <raymaekers.luca@gmail.com> | 2024-06-20 12:04:39 +0200 |
commit | e5eb7f627f4632dab17e0cc0f727cb9b1f70d8a1 (patch) | |
tree | 75c7f8560539303e4a5c1f93241a1e8912bad4cc /bin/guiscripts/osurftxts | |
parent | 05e1216b45340702f82a4946002015a05cebe9b1 (diff) | |
parent | 947f7df73f16981f170265a64a964142fc617023 (diff) |
Merge branch 'main' of db:dotfiles
Diffstat (limited to 'bin/guiscripts/osurftxts')
-rwxr-xr-x | bin/guiscripts/osurftxts | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/bin/guiscripts/osurftxts b/bin/guiscripts/osurftxts new file mode 100755 index 0000000..ef60166 --- /dev/null +++ b/bin/guiscripts/osurftxts @@ -0,0 +1,22 @@ +#!/bin/sh + +# open all links in txt file into one tabbed surf + +# dependencies: surf, osurf, dmenu + +# $1: file path for non interactive use +if [ -z "$1" ] +then + d="$HOME/dl/txtabs" + f="$(find "$d" -type f -printf '%f\n' | dmenu)" + [ "$f" ] || exit 1 + f="$d"/"$f" +else + [ -f "$1" ] || exit 1 + f="$1" +fi + +winid="$(osurf "$(head -n 1 "$f")")" +tail -n +2 "$f" | while read -r url; + do surf -e "$winid" "$url" & + done |