[i3] Add better rofi tools to I3
This commit is contained in:
@ -269,7 +269,7 @@ bindsym XF86Search exec ~/.config/i3/bright.sh 1 # decrease screen brightness
|
|||||||
bindsym $mod+space exec rofi -show combi -display-window "W"
|
bindsym $mod+space exec rofi -show combi -display-window "W"
|
||||||
|
|
||||||
# Lock with
|
# Lock with
|
||||||
bindsym $mod+F12 exec --no-startup-id i3lock -i ~/var/media/backgrounds/astrobin/`ls -Ar ~/var/media/backgrounds/astrobin/ | tail -n 1` -t
|
bindsym $mod+Shift+F12 exec --no-startup-id i3lock -i ~/var/media/backgrounds/astrobin/`ls -Ar ~/var/media/backgrounds/astrobin/ | tail -n 1` -t
|
||||||
|
|
||||||
# BACKGROUND
|
# BACKGROUND
|
||||||
exec hsetroot -cover ~/var/media/backgrounds/bing/`ls -A ~/var/media/backgrounds/bing | tail -n 1`
|
exec hsetroot -cover ~/var/media/backgrounds/bing/`ls -A ~/var/media/backgrounds/bing | tail -n 1`
|
||||||
@ -277,11 +277,11 @@ exec hsetroot -cover ~/var/media/backgrounds/bing/`ls -A ~/var/media/backgrounds
|
|||||||
##### APP BINDS ###################################
|
##### APP BINDS ###################################
|
||||||
|
|
||||||
bindsym $mod+n exec $browser
|
bindsym $mod+n exec $browser
|
||||||
bindsym $mod+Shift+n exec ~/.config/rofi/searx-search.sh
|
bindsym $mod+Shift+o exec --no-startup-id ~/.config/rofi/www.sh
|
||||||
bindsym $mod+Ctrl+n exec ~/.config/rofi/web-search.sh
|
bindsym $mod+O exec ~/.config/rofi/web-search.sh
|
||||||
bindsym $mod+Shift+b exec ~/.config/rofi/books-search.sh
|
bindsym $mod+Shift+b exec ~/.config/rofi/books-search.sh
|
||||||
bindsym $mod+Shift+c exec org-capture
|
|
||||||
bindsym $mod+Shift+s exec ~/.config/rofi/slack.sh
|
bindsym $mod+Shift+s exec ~/.config/rofi/slack.sh
|
||||||
|
bindsym $mod+Shift+c exec org-capture
|
||||||
|
|
||||||
bindsym $mod+Shift+y exec xfreerdp /u:powellc /p:mainroot /v:telesto.local /w:1200 /h:700
|
bindsym $mod+Shift+y exec xfreerdp /u:powellc /p:mainroot /v:telesto.local /w:1200 /h:700
|
||||||
bindsym $mod+Ctrl+y exec pkill xfreerdp
|
bindsym $mod+Ctrl+y exec pkill xfreerdp
|
||||||
@ -302,10 +302,6 @@ bindsym $mod+e exec emacsclient -cnq
|
|||||||
bindsym $mod+Shift+e exec emacs --daemon
|
bindsym $mod+Shift+e exec emacs --daemon
|
||||||
bindsym $mod+Ctrl+e exec pkill emacs
|
bindsym $mod+Ctrl+e exec pkill emacs
|
||||||
|
|
||||||
bindsym $mod+o exec rofi-now
|
|
||||||
bindsym $mod+Ctrl+o exec rofi-vol
|
|
||||||
bindsym $mod+Shift+o exec rofi-bat
|
|
||||||
|
|
||||||
##### LAUNCH ######################################
|
##### LAUNCH ######################################
|
||||||
|
|
||||||
# STARTUP
|
# STARTUP
|
||||||
|
|||||||
@ -7,4 +7,4 @@ configuration {
|
|||||||
show-icons: true;
|
show-icons: true;
|
||||||
combi-modi: "ssh,window,drun";
|
combi-modi: "ssh,window,drun";
|
||||||
}
|
}
|
||||||
@import "/usr/share/rofi/themes/gruvbox-dark-soft.rasi"
|
@import "/usr/share/rofi/themes/gruvbox-dark-hard.rasi"
|
||||||
|
|||||||
@ -16,7 +16,7 @@ main() {
|
|||||||
query=$( rofi -dmenu -matching fuzzy -location 0 -p "Query > " )
|
query=$( rofi -dmenu -matching fuzzy -location 0 -p "Query > " )
|
||||||
if [[ -n "$query" ]]; then
|
if [[ -n "$query" ]]; then
|
||||||
url=$URL$query
|
url=$URL$query
|
||||||
xdg-open "$url"
|
/home/powellc/.asdf/shims/qutebrowser ":open -w $url"
|
||||||
else
|
else
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|||||||
@ -22,51 +22,43 @@ declare -A URLS
|
|||||||
# https://b-ok.cc/s/?q="
|
# https://b-ok.cc/s/?q="
|
||||||
#
|
#
|
||||||
URLS=(
|
URLS=(
|
||||||
["search"]="https://search.unbl.ink/?q="
|
["books"]="http://b-ok.cc/s/"
|
||||||
["google"]="https://www.google.com/search?q="
|
["amazon"]="https://www.amazon.com/s?k="
|
||||||
["ddg"]="https://www.duckduckgo.com/?q="
|
["stackoverflow"]="http://stackoverflow.com/search?q="
|
||||||
["amazon"]="https://www.amazon.com/s?k="
|
["code"]="https://searchcode.com/?q="
|
||||||
["github"]="https://github.com/search?q="
|
["invidous"]="https://invidio.us/search?q="
|
||||||
["goodreads"]="https://www.goodreads.com/search?q="
|
["beer"]="https://www.beeradvocate.com/search/?qt=beer&q="
|
||||||
["stackoverflow"]="http://stackoverflow.com/search?q="
|
["jira"]="https://15five-dev.atlassian.net/browse/ENG-"
|
||||||
["symbolhound"]="http://symbolhound.com/?q="
|
["maps"]="https://www.openstreetmap.com/search?query="
|
||||||
["searchcode"]="https://searchcode.com/?q="
|
["pirate"]="https://thepiratebay.zone/search/"
|
||||||
["imdb"]="http://www.imdb.com/find?ref_=nv_sr_fn&q="
|
["search"]="https://search.unbl.ink/?q="
|
||||||
["rottentomatoes"]="https://www.rottentomatoes.com/search/?search="
|
|
||||||
["invidous"]="https://invidio.us/search?q="
|
|
||||||
["vimawesome"]="http://vimawesome.com/?q="
|
|
||||||
["beer"]="https://www.beeradvocate.com/search/?qt=beer&q="
|
|
||||||
["jira"]="https://15five-dev.atlassian.net/plugins/servlet/mobile#issue/ENG-"
|
|
||||||
["books"]="http://zlibraryexau2g3p.onion/s/"
|
|
||||||
["maps"]="https://www.openstreetmap.com/search?query="
|
|
||||||
["pirate"]="https://proxahoy.link/s/?q="
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# List for rofi
|
# List for rofi
|
||||||
gen_list() {
|
gen_list() {
|
||||||
for i in "${!URLS[@]}"
|
for i in "${!URLS[@]}"; do
|
||||||
do
|
|
||||||
echo "$i"
|
echo "$i"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
# Pass the list to rofi
|
# Pass the list to rofi
|
||||||
platform=$( (gen_list) | rofi -dmenu -matching fuzzy -no-custom -location 0 -p "Search > " )
|
platform=$( (gen_list) | rofi -dmenu -matching fuzzy -no-custom -location 0 -p "Search > ")
|
||||||
|
|
||||||
if [[ -n "$platform" ]]; then
|
if [[ -n "$platform" ]]; then
|
||||||
query=$( (echo ) | rofi -dmenu -matching fuzzy -location 0 -p "Query > " )
|
query=$( (echo) | rofi -dmenu -matching fuzzy -location 0 -p "Query > ")
|
||||||
|
|
||||||
if [[ -n "$query" ]]; then
|
if [[ -n "$query" ]]; then
|
||||||
url=${URLS[$platform]}$query
|
url=${URLS[$platform]}$query
|
||||||
xdg-open "$url"
|
/home/powellc/.asdf/shims/qutebrowser ":open -w $url"
|
||||||
else
|
else
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
else
|
else
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
main
|
main
|
||||||
|
|||||||
27
rofi/.config/rofi/www.sh
Executable file
27
rofi/.config/rofi/www.sh
Executable file
@ -0,0 +1,27 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
AGENT="Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3"
|
||||||
|
OPTS=-u "$AGENT" -z 1.1
|
||||||
|
#OPTS="-z 1.5"
|
||||||
|
HISTORY=~/var/rofi-www-history
|
||||||
|
|
||||||
|
if [ "$1" = "" ]
|
||||||
|
then
|
||||||
|
URL=`cat $HISTORY | rofi -hide-scrollbar -dmenu -p "URL: "`
|
||||||
|
echo "$URL" | grep -e ^http || CLIP=https://$CLIP
|
||||||
|
echo "$URL" >> $HISTORY
|
||||||
|
else
|
||||||
|
URL=$@
|
||||||
|
echo "$@" | grep -e ^http && CLIP=https://$CLIP
|
||||||
|
echo "$@" >> $HISTORY
|
||||||
|
fi
|
||||||
|
TMP=`tempfile`
|
||||||
|
cat $HISTORY | sort | uniq >> $TMP && mv $TMP $HISTORY
|
||||||
|
rm -f $TMP
|
||||||
|
|
||||||
|
if [ "$URL" = "" ]
|
||||||
|
then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
/home/powellc/.asdf/shims/qutebrowser ":open -w $URL"
|
||||||
Reference in New Issue
Block a user