summaryrefslogtreecommitdiff
path: root/scriptlets/transmission_dirchooser.sh
blob: d7614abe0fe8df8b5f04b92cbd8a9440ed8a3b64 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/bash

START_DIR="$HOME/Downloads"
ROFI_THEME="ErikaScythe"
# CHANGE THEME

DIR="$START_DIR"
FULL_DIR="$DIR"
while [[ -n $DIR && $DIR != "." ]]; do
    DIR="$( { echo -e ".\n.."; find "${FULL_DIR}" -mindepth 1 -maxdepth 1 -type d | sed -r "s|^.*\/||g" | sort -V ; } | rofi -dmenu -i -no-custom -p "" -theme "$ROFI_THEME" -async-pre-read 3 -no-click-to-exit )"
    FULL_DIR="${FULL_DIR}/${DIR}"
done

[[ -z "$DIR" ]] && exit -1


for file in "$@"; do
    transmission-remote -a "$file" -w "$FULL_DIR"
done