dotfiles

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

commit fe0a13194bba08ec13858fc7f25127a286b7a1d8
parent 56463e570e8912c84e9c12198aff1298fa6cfbb4
Author: Janis Pagel <janis.pagel@ims.uni-stuttgart.de>
Date:   Mon, 30 Dec 2019 01:59:04 +0100

Add surf bookmark scripts

Diffstat:
Ascripts/surf_bookmarkurl | 7+++++++
Ascripts/surf_loadbookmark | 3+++
Msuckless/surf/config.h | 10+++++-----
3 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/scripts/surf_bookmarkurl b/scripts/surf_bookmarkurl @@ -0,0 +1,7 @@ +#!/bin/sh +file=~/.surf/bookmarks +tmp_file=~/.surf/bookmarks_new +url=`xprop -id $1 | grep URI | awk '{print $3}' | sed 's/\"//g'` +title=`xprop -id $1 | grep WM_ICON_NAME\(STRING\) | cut -c 40- | sed 's/.$//g'` +echo $url $title | dmenu -c -p 'Add Bookmark' -l 50 -w $1 -fn 'Sans:size=11' >> $file +cat $file | sort -u > $tmp_file && mv $tmp_file $file diff --git a/scripts/surf_loadbookmark b/scripts/surf_loadbookmark @@ -0,0 +1,3 @@ +#!/bin/sh +file=~/.surf/bookmarks +cat $file | dmenu -c -p 'Load Bookmark' -i -l 50 -w $1 -fn 'Sans:size=11' | awk '{print $1}' diff --git a/suckless/surf/config.h b/suckless/surf/config.h @@ -32,11 +32,11 @@ static Parameter defconfig[ParameterLast] = { SETV(SpellLanguages, ((char *[]){ "en_US", NULL })), SETB(StrictSSL, 0), SETB(Style, 1), - SETF(ZoomLevel, 1.0), + SETF(ZoomLevel, 1.2), }; static UriParameters uriparams[] = { - { "(://|\\.)suckless\\.org(/|$)", { + { "", { FSETB(JavaScript, 0), FSETB(Plugins, 0), }, }, @@ -49,7 +49,7 @@ static WebKitFindOptions findopts = WEBKIT_FIND_OPTIONS_CASE_INSENSITIVE | .v = (const char *[]){ "/bin/sh", "-c", \ "prop=\"`xprop -id $2 $0 " \ "| sed \"s/^$0(STRING) = \\(\\\\\"\\?\\)\\(.*\\)\\1$/\\2/\" " \ - "| xargs -0 printf %b | dmenu -p 'Open URL:' -l 1 -fn 'Sans:size=14:weight=bold'`\" &&" \ + "| xargs -0 printf %b | dmenu -p 'Open URL:' -l 1 -fn 'Sans:size=12:weight=bold'`\" &&" \ "xprop -id $2 -f $1 8s -set $1 \"$prop\"", \ p, q, winid, NULL \ } \ @@ -96,13 +96,13 @@ static SiteStyle styles[] = { #define ADDBMK { \ .v = (char *[]){ "/bin/sh", "-c", \ - "bookmarkurl $0", winid, NULL \ + "surf_bookmarkurl $0", winid, NULL \ } \ } #define LOADBMK(r, s, p) { \ .v = (const char *[]){ "/bin/sh", "-c", \ - "prop=\"$(loadbookmark $1)\" && xprop -id $1 -f $3 8s -set $3 \"$prop\"", \ + "prop=\"$(surf_loadbookmark $1)\" && xprop -id $1 -f $3 8s -set $3 \"$prop\"", \ "surf-setprop", winid, r, s, p, NULL \ } \ }