torrent wrap and other changes

This commit is contained in:
Luke Smith 2019-01-26 18:13:36 -05:00
parent 151e47c629
commit 9ddf765a03
3 changed files with 11 additions and 10 deletions

View file

@ -286,7 +286,7 @@ bindsym $mod+F2 restart
bindsym $mod+F3 exec --no-startup-id displayselect bindsym $mod+F3 exec --no-startup-id displayselect
bindsym $mod+F4 exec --no-startup-id prompt "Hibernate computer?" "$hibernate" bindsym $mod+F4 exec --no-startup-id prompt "Hibernate computer?" "$hibernate"
bindsym $mod+F5 exec --no-startup-id $netrefresh bindsym $mod+F5 exec --no-startup-id $netrefresh
bindsym $mod+F6 exec --no-startup-id $term -e transmission-remote-cli bindsym $mod+F6 exec --no-startup-id torwrap
bindsym $mod+F7 exec --no-startup-id td-toggle bindsym $mod+F7 exec --no-startup-id td-toggle
bindsym $mod+F8 exec --no-startup-id ~/.config/mutt/etc/mailsync.sh bindsym $mod+F8 exec --no-startup-id ~/.config/mutt/etc/mailsync.sh
bindsym $mod+F9 exec --no-startup-id dmenumount bindsym $mod+F9 exec --no-startup-id dmenumount

View file

@ -1,15 +1,10 @@
#!/bin/sh #!/bin/sh
# If transmission-daemon is running, will ask to kill, else will ask to start. # If transmission-daemon is running, will ask to kill, else will ask to start.
if pgrep -x transmission-da >/dev/null ;
[ ! -f /usr/bin/transmission-daemon ] && notify-send "Transmission daemon not installed." && exit
if pgrep -x transmission-da >/dev/null ;
then then
yn=$(printf "No\\nYes" | dmenu -i -p "Kill transmission-daemon?") [ "$(printf "No\\nYes" | dmenu -i -p "Kill transmission-daemon?")" = "Yes" ] && killall transmission-da && notify-send -i "$PIX/torrent.svg" "transmission-daemon killed."
[ "$yn" = "Yes" ] && killall transmission-da
else else
yn=$(printf "No\\nYes" | dmenu -i -p "Start transmission daemon?") ifinstalled transmission-cli || exit
[ "$yn" = "Yes" ] && transmission-daemon [ "$(printf "No\\nYes" | dmenu -i -p "Start transmission daemon?")" = "Yes" ] && transmission-daemon && notify-send -i "$PIX/torrent.svg" "tranmission-daemon started."
fi fi
sleep 3 && pkill -RTMIN+7 i3blocks sleep 3 && pkill -RTMIN+7 i3blocks

6
.scripts/i3cmds/torwrap Executable file
View file

@ -0,0 +1,6 @@
#!/bin/sh
ifinstalled transmission-remote-cli transmission-cli || exit
! pgrep -x transmission-da >/dev/null && transmission-daemon && notify-send -i "$PIX/torrent.svg" "Starting torrent daemon..." && sleep 3 && pkill -RTMIN+7 i3blocks
$TERMINAL -e transmission-remote-cli