diff --git a/bin/default-open b/bin/default-open new file mode 100755 index 0000000..4ef2534 --- /dev/null +++ b/bin/default-open @@ -0,0 +1,10 @@ +#!/bin/sh + +mimetype=$1 +original=$2 +ext=$(grep "$mimetype" /etc/mime.types | awk '{print $2}') + +destination=$(mktemp --suffix=".$ext") +cp $original $destination +xdg-open $destination &> /dev/null +cat $destination diff --git a/bin/email b/bin/email new file mode 100755 index 0000000..b9d6af9 --- /dev/null +++ b/bin/email @@ -0,0 +1,3 @@ +#!/bin/sh + +mutt -F ~/.mutt/$1 diff --git a/bin/passget b/bin/passget new file mode 100755 index 0000000..e2c6ea3 --- /dev/null +++ b/bin/passget @@ -0,0 +1,13 @@ +#!/bin/sh + +if [[ -z "$1" ]]; then + echo 'Nothing to get' + exit 1 +fi + +contents=$(gopass show $1) || exit 1 +echo "$contents" | grep '^user:' | cut -d' ' -f2 | xsel -b +echo 'Username clipped' +read + +gopass show --clip $1 diff --git a/bin/pipe b/bin/pipe new file mode 100755 index 0000000..9047342 --- /dev/null +++ b/bin/pipe @@ -0,0 +1,6 @@ +#!/bin/sh + +command=$1 +file=$(mktemp --suffix=$2) +cat < /dev/stdin > $file +$command $file diff --git a/bin/qutebrowser b/bin/qutebrowser new file mode 100755 index 0000000..2a1fbe1 --- /dev/null +++ b/bin/qutebrowser @@ -0,0 +1,6 @@ +#!/bin/sh + +QT_SCALE_FACTOR='' +QT_AUTO_SCREEN_SCALE_FACTOR='' + +/usr/bin/qutebrowser --backend webengine "$@" diff --git a/bin/wallpaper-rotate b/bin/wallpaper-rotate new file mode 100755 index 0000000..41484a9 --- /dev/null +++ b/bin/wallpaper-rotate @@ -0,0 +1,11 @@ +#!/usr/bin/env tako + +from datetime import datetime + +image_dir = $HOME + '/images/wallpapers/BitDay/' +hour = datetime.now().hour +image_number = int(hour / 2) +image_file = image_dir + '{}.png'.format(image_number) + +ln -s -f @(image_file) @($HOME + '/images/wallpaper.png') +nitrogen --restore diff --git a/bin/xsel-clear b/bin/xsel-clear new file mode 100755 index 0000000..867b1bd --- /dev/null +++ b/bin/xsel-clear @@ -0,0 +1,3 @@ +#!/bin/sh + +xsel -c && xsel -sc && xsel -bc diff --git a/bin/xsel-swap b/bin/xsel-swap new file mode 100755 index 0000000..8af8d1a --- /dev/null +++ b/bin/xsel-swap @@ -0,0 +1,5 @@ +#!/usr/bin/env tako + +tmp = ?(xsel) # primary -> tmp +xsel -b | xsel -i # clipboard -> primary +echo @(tmp) | xsel -bi # tmp -> clipboard diff --git a/default.conf.yaml b/default.conf.yaml index ed07699..b2199e2 100644 --- a/default.conf.yaml +++ b/default.conf.yaml @@ -17,3 +17,4 @@ ~/.zshrc: zsh/.zshrc ~/.zshenv: zsh/.zshenv ~/.zprofile: zsh/.zprofile + ~/bin: bin/