diff options
Diffstat (limited to 'scriptlets/thunar_batch_opener.sh')
-rwxr-xr-x | scriptlets/thunar_batch_opener.sh | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/scriptlets/thunar_batch_opener.sh b/scriptlets/thunar_batch_opener.sh new file mode 100755 index 0000000..04fe54d --- /dev/null +++ b/scriptlets/thunar_batch_opener.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +browser="thunar" +winfile="$HOME/stuf/windows.txt" +mapfile -t < "$winfile" + +SAVEIFS=$IFS + +FLAG=0 +IFS=$'\n' +while IFS= read -r tab +do + + [[ -z "$tab" ]] && FLAG=1 && continue + + if [[ $FLAG -eq 1 ]]; then + FLAG=0 + xfconf-query -c thunar -p /misc-open-new-window-as-tab -s false + else + xfconf-query -c thunar -p /misc-open-new-window-as-tab -s true + fi + "$browser" "$( sed -r "s|\\\$HOME|$HOME|g" <<< "$tab" )" + sleep 0.5 + FLAG=0 +done < "$winfile" +IFS=$SAVEIFS +xfconf-query -c thunar -p /misc-open-new-window-as-tab -s true |