sites

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 7245a6cb53c4b1acd2e741b1d443cd95d8ed3c14
parent 1fdaa0e6fdfc34ff3b300da91d67127d4a4ec841
Author: efe <efe@efe.kim>
Date:   Thu, 13 Dec 2018 09:44:26 -0500

dmenu/scripts: remove my script since I now host it on my website

Diffstat:
Dtools.suckless.org/dmenu/scripts/dmenu_websearch | 71-----------------------------------------------------------------------
Mtools.suckless.org/dmenu/scripts/index.md | 2+-
2 files changed, 1 insertion(+), 72 deletions(-)

diff --git a/tools.suckless.org/dmenu/scripts/dmenu_websearch b/tools.suckless.org/dmenu/scripts/dmenu_websearch @@ -1,71 +0,0 @@ -#!/bin/sh - -# title: dmenu_websearch -# license: CC0 -# author: Sunur Efe Vural <efe@efe.kim> -# version: 28/11/2018 -# some dependencies: dmenu, xdotool, hexdump, xprop, pstree, setxkbmap - -# dmenu_websearch is a browser-independent address bar with bookmark -# support. If the cursor is focused on a web browser it acts as the -# address bar of that browser. - -browser="$TERMINAL -e $BROWSERCLI" -homepage=$WWW_HOME -bookmarks_file=$HOME/.bookmarks #url per line -search_engine="https://duckduckgo.com/lite/?q=%s" - -openchoice() { - if [ "$windowid" != "notabrowser" ] - then - #change layout to us cuz xdotool spasms with non-latin layouts - layout=`setxkbmap -query | awk '/^layout:/{ print $2 }'` - setxkbmap -layout us - xdotool key --clearmodifiers $shortcut\ - type --clearmodifiers --delay 2 "$choice" - xdotool key --clearmodifiers Return - setxkbmap -layout $layout - else $browser $choice - fi -} - -searchweb() { - #convert search term to percent encoding - choice=`echo $choice | hexdump -v -e '/1 " %02x"' | sed 's/ 0a$//'` - #insert search term into the search engine url - choice=`echo $search_engine | sed "s/%s/$choice/;y/ /%/"` - openchoice -} - -#get termprocess for text browsers and windowclass for gui browsers. -windowid=`xprop -root _NET_ACTIVE_WINDOW | awk '{print $5}'` -if [ "$windowid" != "" ] -then - processid=`xprop -id "$windowid" _NET_WM_PID | awk '{print $3}'` - termprocess=`pstree -Al "$processid" | awk -F "---" '{print $NF}'` - windowclass=`xprop -id "$windowid" WM_CLASS | grep -o '".*"'` -fi - -#get the shortcut to open address bar for each browser -if echo "$windowclass" | grep -i \ -"firefox\|chromium\|vivaldi\|opera\|chrome\|netsurf\|arora\|epiphany\ -\|midori\|dillo\|konqueror\|brave\|palemoon\|iceweasel\|icecat" -then shortcut="ctrl+l" -elif echo "$windowclass" | grep -i "luakit\|qutebrowser\|uzbl" -then shortcut="o" -elif echo "$windowclass $termprocess" | grep -i "links\|lynx\|conkeror" -then shortcut="g" -elif echo "$termprocess" | grep -i "w3m" -then shortcut="U" -else windowid=notabrowser -fi - -choice=`grep -v "^#" $bookmarks_file\ - | dmenu -i -w $windowid -p "Enter URL or search term:"` || exit 1 - -if echo "$choice" | grep -EZ\ - "^(ht|f)tp(s?)\:\/\/[0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*" -then choice=`echo $choice | awk -F" " '{ print $1 }'` - openchoice -else searchweb -fi diff --git a/tools.suckless.org/dmenu/scripts/index.md b/tools.suckless.org/dmenu/scripts/index.md @@ -26,4 +26,4 @@ Download dmenu_run alternative with command history * [dbdb.sh](dbdb.sh): dmenu-based directory browser * [via](https://github.com/xalexalex/via): simple dmenu-based launcher for apps, files, folders and shell commands -* [dmenu_websearch](dmenu_websearch): browser independent address bar +* [dmenu_websearch](http://efe.kim/files/scripts/dmenu_websearch): browser independent address bar