Skip to content

Instantly share code, notes, and snippets.

@pkillnine
pkillnine / qutebrowser.SlackBuild
Last active October 6, 2017 08:02
qutebrowser slackbuild
#!/bin/sh -e
# Slackware build script for qutebrowser (git-master)
APP=qutebrowser
VERSION=git
PKG_VERSION=$VERSION
ARCH=noarch
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
@pkillnine
pkillnine / gist:f1aa4e1d24cecf5f08666fa8b0879db1
Created October 4, 2017 21:23
insert mode readline bindings
config.bind('<ctrl-h>', 'fake-key <backspace>', mode='insert')
config.bind('<ctrl-f>', 'fake-key <right>', mode='insert')
config.bind('<ctrl-b>', 'fake-key <left>', mode='insert')
config.bind('<ctrl-w>', 'fake-key <ctrl-backspace>', mode='insert')
@pkillnine
pkillnine / config.py
Last active December 28, 2017 17:36
Qutebrowser config file
# ____ _ ___ _ _ ___
# | _ \| |/ (_) | | / _ \
# | |_) | ' /| | | | ____| (_) |
# | __/| . \| | | | |_____\__, |
# |_| |_|\_\_|_|_| /_/
#
# My Qutebrowser config file :D
#
import re
#!/bin/bash
eval "$@"
if [ -f $QUTE_FIFO ]; then
if [[ $? == 0 ]] ; then
echo "message-info 'Command exited with status $?'" >> $QUTE_FIFO
else
echo "message-error 'Command exited with status $?'" >> $QUTE_FIFO
#!/usr/bin/env python
import re
import urllib.parse
from os import environ
from sys import argv
url = environ['QUTE_URL']
fifo_path = environ['QUTE_FIFO']
#!/bin/bash
QBDATA_HISTORY_FILE="$HOME"/.local/share/qutebrowser/history
QBHISTORYLIST_TMP_FILE=/tmp/qbhistorylist
HISTORY_PAGE_HTML_FILE=/tmp/qbhistory.html
function produce_list_body() {
sort -r $QBDATA_HISTORY_FILE |#sort by most recent
cut -d " " -f 2- |#remove first column (times)
grep -v "^data:" |#remove urls with "data:"
#!/usr/bin/env python
#Ale Zuvic (AirieFenix)
#Thanks to macvendors.com for their incredibly simple API
import requests
import sys
BASE_URL = 'http://api.macvendors.com' # I removed the trailing '/' as I would add that when creating the url
#!/bin/bash
if (( $# < 1 )); then
BASECMD="qutebrowser --backend webengine"
elif (( $# >= 1 )); then
BASECMD="$@"
fi
TMPBASEDIR=`mktemp -dt qutebrowser-tmp-session-XXX`
QBCONFIGDIR="$HOME/.config/qutebrowser"
def extract_tag_words(self, elem):
"""Extract tag words form the given element."""
attr_extractors = {
"alt": lambda elem: elem["alt"],
"name": lambda elem: elem["name"],
"title": lambda elem: elem["title"],
"placeholder": lambda elem: elem["placeholder"],
"src": lambda elem: elem["src"].split('/')[-1],
"href": lambda elem: elem["href"].split('/')[-1],
"text": str,
#!/bin/bash
if (( $# < 1 )); then
BASECMD="qutebrowser --backend webengine"
elif (( $# >= 1 )); then
BASECMD="$@"
fi
TMPBASEDIR=/tmp/qutebrowser_tmp_basedir_`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 6 | head -n 1`
QBCONFIGDIR="$HOME/.config/qutebrowser"