dotfiles

Luke's GNU/Linux dotfiles for i3, vim, ranger, bash, mpd, etc.
git clone git@git.lukesmith.xyz:dotfiles
Log | Files | Refs | README | LICENSE

commit fdc161b3fffda21a3bbe04963d4490bb13a805fd
parent de034ec9821d3e308e88833c8101e47b5cf69e1c
Author: Luke Smith <luke@lukesmith.xyz>
Date:   Sat,  7 Apr 2018 09:25:57 -0700

dmenuhandler script added

Diffstat:
M.config/i3/i3_guide.rmd | 7+------
M.newsboat/config | 2++
A.scripts/dmenuhandler | 23+++++++++++++++++++++++
3 files changed, 26 insertions(+), 6 deletions(-)

diff --git a/.config/i3/i3_guide.rmd b/.config/i3/i3_guide.rmd @@ -96,13 +96,8 @@ Be sure you play around with these. Be flexible with the basic commands and the + Mod+F2 -- Refresh i3 + Mod+F3 -- Select screen/display to use + Mod+F4 -- Hibernate -+ Mod+F6 -- transmission torrent client (cli) + Mod+F5 -- Reset Network Manager, search for new networks -+ Mod+F7 -- (No mapping) -+ Mod+F8 -- (No mapping) -+ Mod+F10 -- Switch to laptop screen -+ Mod+F11 -- Switch to VGA display (if available) -+ Mod+F12 -- Switch to dual VGA/laptop display (if available) ++ Mod+F6 -- transmission torrent client (cli) ## Audio diff --git a/.newsboat/config b/.newsboat/config @@ -19,6 +19,7 @@ bind-key n next-unread bind-key N prev-unread bind-key D pb-download bind-key U show-urls +bind-key x pb-delete color listnormal cyan default color listfocus black yellow standout bold @@ -32,6 +33,7 @@ macro , open-in-browser macro v set browser "i3 exec mpv"; open-in-browser ; set browser linkhandler macro y set browser "spawndl"; open-in-browser ; set browser linkhandler macro w set browser "w3m"; open-in-browser ; set browser linkhandler +macro p set browser "dmenuhandler"; open-in-browser ; set browser linkhandler # c copies the link to the clipboard. # The line below is probably the skiddiest line I've ever written. macro c set browser "copy(){ echo $1 | xclip ;}; copy "; open-in-browser ; set browser linkhandler diff --git a/.scripts/dmenuhandler b/.scripts/dmenuhandler @@ -0,0 +1,23 @@ +#!/bin/bash +# Feed this script a link and it will give dmenu +# some choice programs to use to open it. + +# The URL will be shown visually in 30 characters or less. +if [[ "${#1}" -gt 30 ]]; +then +visual="${1:0:20}"..."${1: -7}" +else +visual="$1" +fi +echo $visual + +x=$(echo -e "mpv\nmpv (loop)\nwget\nfeh\nbrowser\nw3m\nmpv (float)" | dmenu -i -p "How should I open '$visual'?") +case "$x" in + mpv) mpv -quiet "$1" 2&>/dev/null & disown ;; + "mpv (loop)") mpv -quiet --loop "$1" 2&>/dev/null & disown ;; + wget) wget "$1" 2&>/dev/null & disown ;; + browser) $BROWSER "$1" 2&>/dev/null & disown ;; + feh) feh "$1" 2&>/dev/null & disown ;; + w3m) w3m "$1" 2&>/dev/null & disown ;; + "mpv (float)") mpv --geometry=+0-0 --autofit=30% --title="mpvfloat" /dev/video0 "$1" 2&>/dev/null & disown ;; +esac