aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorGravatar Matheus R <matheusrbarros03@gmail.com> 2021-03-29 15:30:57 +0000
committerGravatar Matheus R <matheusrbarros03@gmail.com> 2021-03-29 15:30:57 +0000
commitfb6c60c4aa5f2fb1bae1d49b114861cea8f285d4 (patch)
tree854c7970645d78d98e1e4a930222ca369676b8f0 /bin
parent0eef5b283eb5dbcff4d006513fdd38bacd8a5732 (diff)
Atualizadas configurações do hwlm e do sxhkd, além de adição da pasta bin
Diffstat (limited to 'bin')
-rwxr-xr-xbin/batt18
-rwxr-xr-xbin/battery_check17
-rwxr-xr-xbin/bspHide13
-rwxr-xr-xbin/bspswallow53
-rwxr-xr-xbin/chardetect8
-rwxr-xr-xbin/cpu11
-rwxr-xr-xbin/customwiki2html.sh62
-rwxr-xr-xbin/easy_install8
-rwxr-xr-xbin/easy_install-3.88
-rwxr-xr-xbin/f2py8
-rwxr-xr-xbin/f2py38
-rwxr-xr-xbin/f2py3.98
-rwxr-xr-xbin/frame_spawn18
-rwxr-xr-xbin/kbd13
-rwxr-xr-xbin/kbd_udev3
-rwxr-xr-xbin/launch_dwm18
-rwxr-xr-xbin/markdown_py8
-rwxr-xr-xbin/mem10
-rwxr-xr-xbin/mic_check12
-rwxr-xr-xbin/mpd_scroll12
-rwxr-xr-xbin/pip3.88
-rwxr-xr-xbin/pkgs10
-rwxr-xr-xbin/print_tags29
-rwxr-xr-xbin/temp10
-rwxr-xr-xbin/title10
-rwxr-xr-xbin/transcode9
-rwxr-xr-xbin/urlImage12
-rwxr-xr-xbin/vimwiki_markdown8
-rwxr-xr-xbin/vol16
-rwxr-xr-xbin/wallpaper14
-rwxr-xr-xbin/wheel8
-rwxr-xr-xbin/wlan10
-rwxr-xr-xbin/wmMove32
-rwxr-xr-xbin/xev_keys3
-rwxr-xr-xbin/youtube-dl8
35 files changed, 503 insertions, 0 deletions
diff --git a/bin/batt b/bin/batt
new file mode 100755
index 0000000..c99c3a3
--- /dev/null
+++ b/bin/batt
@@ -0,0 +1,18 @@
+#!/bin/env bash
+
+batt() {
+ batt="$(acpi | awk '{print $4}' | sed -e 's/%,//g')"
+ icon=""
+
+ [ "$batt" -ge 90 ] && icon=""
+
+ [ "$batt" -le 50 ] && icon=""
+
+ [ "$batt" -le 20 ] && icon=""
+
+ [ "$batt" -le 5 ] && icon=""
+
+ printf "%s %d%%" "$icon" "$batt"
+}
+
+batt
diff --git a/bin/battery_check b/bin/battery_check
new file mode 100755
index 0000000..af44108
--- /dev/null
+++ b/bin/battery_check
@@ -0,0 +1,17 @@
+#!/usr/bin/env bash
+
+# Simple script to monitor the battery's status
+
+# calls batt_status script
+batt=$(acpi | awk '{print $4}' | sed -e 's/\%,//g')
+state=$(acpi | awk '{print }' | sed -e 's/\,//g')
+
+if [[ $batt -ge 99 ]]; then
+ notify-send "Bateria" "Completamente carregada! (100%)"
+elif [[ $batt -eq 20 ]] ; then
+ notify-send "Bateria descarregando" "Nível de bateria alcançou 20%"
+elif [[ $batt -eq 10 ]] ; then
+ notify-send "Bateria descarregando" "Nível de bateria alcançou 10%"
+elif [[ $batt -le 5 ]]; then
+ notify-send "Bateria crítica!" "Nível de bateria alcançou 5%"
+fi
diff --git a/bin/bspHide b/bin/bspHide
new file mode 100755
index 0000000..c69182d
--- /dev/null
+++ b/bin/bspHide
@@ -0,0 +1,13 @@
+#!/bin/env bash
+
+# hides focused window
+# if there are any hidden windows in the current desktop, \
+# unhide them
+
+hidden=$(bspc query -N -n .hidden -d focused)
+
+if [ -z "$hidden" ]; then
+ bspc node focused -g hidden=on
+else
+ bspc node "$hidden" -g hidden=off
+fi
diff --git a/bin/bspswallow b/bin/bspswallow
new file mode 100755
index 0000000..35784a2
--- /dev/null
+++ b/bin/bspswallow
@@ -0,0 +1,53 @@
+#!/bin/sh
+
+# Get class of a wid
+get_class() {
+ id=$1
+ if [ -z "$id" ]; then
+ echo ""
+ else
+ xprop -id "$id" | sed -n '/WM_CLASS\|WM_COMMAND/s/.*"\(.*\)".*/\1/p'
+ fi
+}
+
+swallow() {
+ addedtodesktop=$2
+ lasttermdesktop=$(bspc query -D -n last)
+
+ swallowerid=$1
+ swallowingid=$(bspc query -N -n last)
+
+ if [ "$addedtodesktop" = "$lasttermdesktop" ]; then
+ cat ~/.config/bspwm/noswallow ~/.config/bspwm/terminals | grep "^$(get_class "$swallowerid")$" && return
+ grep "^$(get_class "$swallowingid")$" ~/.config/bspwm/terminals || return
+ echo "$swallowerid $swallowingid" >> /tmp/swallowids
+ bspc node "$swallowingid" --flag hidden=on
+ fi
+}
+
+spit() {
+ spitterid=$1
+ spitterdesktop=$2
+ grep "^$spitterid" /tmp/swallowids || return
+ spittingid=$(grep "^$spitterid" /tmp/swallowids | head -n1 | awk '{print $2}')
+
+ bspc node "$spittingid" --flag hidden=off
+
+ termdesktop=$(bspc query -D -n "$spittingid")
+ [ "$termdesktop" = "$spitterdesktop" ] || bspc node "$spittingid" -d "$spitterdesktop"
+
+ bspc node "$spittingid" -f
+ sed -i "/^$spitterid/d" /tmp/swallowids
+}
+
+bspc subscribe node_add node_remove | while read -r event
+do
+ case $(echo "$event" | awk '{ print $1 }') in
+ node_add)
+ swallow $(echo "$event" | awk '{print $5 " " $3}')
+ ;;
+ node_remove)
+ spit $(echo "$event" | awk '{print $4 " " $3}')
+ ;;
+ esac
+done
diff --git a/bin/chardetect b/bin/chardetect
new file mode 100755
index 0000000..09f9ed1
--- /dev/null
+++ b/bin/chardetect
@@ -0,0 +1,8 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+import re
+import sys
+from chardet.cli.chardetect import main
+if __name__ == '__main__':
+ sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
+ sys.exit(main())
diff --git a/bin/cpu b/bin/cpu
new file mode 100755
index 0000000..33c797e
--- /dev/null
+++ b/bin/cpu
@@ -0,0 +1,11 @@
+#!/bin/env bash
+# checks the amount of CPU being used
+
+cpu() {
+ cpu="$(awk '{u=$2+$4; t=$2+$4+$5; if (NR==1){u1=u; t1=t;} else print ($2+$4-u1) * 100 / (t-t1); }' \
+ <(grep 'cpu ' /proc/stat) <(sleep 1;grep 'cpu ' /proc/stat))"
+
+ printf "﬙ %.0f%%" "$cpu"
+}
+
+cpu
diff --git a/bin/customwiki2html.sh b/bin/customwiki2html.sh
new file mode 100755
index 0000000..4818d02
--- /dev/null
+++ b/bin/customwiki2html.sh
@@ -0,0 +1,62 @@
+#!/bin/bash
+
+#
+# This script converts markdown into html, to be used with vimwiki's
+# "customwiki2html" option. Experiment with the two proposed methods by
+# commenting / uncommenting the relevant lines below.
+#
+# NEW! An alternative converter was developed by Jason6Anderson, and can
+# be located at https://github.com/vimwiki-backup/vimwiki/issues/384
+#
+#
+# To use this script, you must have the Discount converter installed.
+#
+# http://www.pell.portland.or.us/~orc/Code/discount/
+#
+# To verify your installation, check that the commands markdown and mkd2text,
+# are on your path.
+#
+# Also verify that this file is executable.
+#
+# Then, in your .vimrc file, set:
+#
+# g:vimwiki_customwiki2html=$HOME.'/.vim/autoload/vimwiki/customwiki2html.sh'
+#
+# On your next restart, Vimwiki will run this script instead of using the
+# internal wiki2html converter.
+#
+
+MARKDOWN=markdown
+MKD2HTML=mkd2html
+
+
+FORCE="$1"
+SYNTAX="$2"
+EXTENSION="$3"
+OUTPUTDIR="$4"
+INPUT="$5"
+CSSFILE="$6"
+
+FORCEFLAG=
+
+[ $FORCE -eq 0 ] || { FORCEFLAG="-f"; };
+[ $SYNTAX = "markdown" ] || { echo "Error: Unsupported syntax"; exit -2; };
+
+OUTPUT="$OUTPUTDIR"/$(basename "$INPUT" .$EXTENSION).html
+
+# # Method 1:
+# # markdown [-d] [-T] [-V] [-b url-base] [-C prefix] [-F bitmap] [-f flags] [-o file] [-s text] [-t text] [textfile]
+#
+# URLBASE=http://example.com
+# $MARKDOWN -T -b $URLBASE -o $OUTPUT $INPUT
+
+
+# Method 2:
+# mkd2html [-css file] [-header string] [-footer string] [file]
+
+$MKD2HTML -css "$CSSFILE" "$INPUT"
+OUTPUTTMP=$(dirname "$INPUT")/$(basename "$INPUT" ."$EXTENSION").html
+mv -f "$OUTPUTTMP" "$OUTPUT"
+
+
+
diff --git a/bin/easy_install b/bin/easy_install
new file mode 100755
index 0000000..bb83ac1
--- /dev/null
+++ b/bin/easy_install
@@ -0,0 +1,8 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+import re
+import sys
+from setuptools.command.easy_install import main
+if __name__ == '__main__':
+ sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
+ sys.exit(main())
diff --git a/bin/easy_install-3.8 b/bin/easy_install-3.8
new file mode 100755
index 0000000..bb83ac1
--- /dev/null
+++ b/bin/easy_install-3.8
@@ -0,0 +1,8 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+import re
+import sys
+from setuptools.command.easy_install import main
+if __name__ == '__main__':
+ sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
+ sys.exit(main())
diff --git a/bin/f2py b/bin/f2py
new file mode 100755
index 0000000..40ce6f8
--- /dev/null
+++ b/bin/f2py
@@ -0,0 +1,8 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+import re
+import sys
+from numpy.f2py.f2py2e import main
+if __name__ == '__main__':
+ sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
+ sys.exit(main())
diff --git a/bin/f2py3 b/bin/f2py3
new file mode 100755
index 0000000..40ce6f8
--- /dev/null
+++ b/bin/f2py3
@@ -0,0 +1,8 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+import re
+import sys
+from numpy.f2py.f2py2e import main
+if __name__ == '__main__':
+ sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
+ sys.exit(main())
diff --git a/bin/f2py3.9 b/bin/f2py3.9
new file mode 100755
index 0000000..40ce6f8
--- /dev/null
+++ b/bin/f2py3.9
@@ -0,0 +1,8 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+import re
+import sys
+from numpy.f2py.f2py2e import main
+if __name__ == '__main__':
+ sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
+ sys.exit(main())
diff --git a/bin/frame_spawn b/bin/frame_spawn
new file mode 100755
index 0000000..5e6dfd3
--- /dev/null
+++ b/bin/frame_spawn
@@ -0,0 +1,18 @@
+#!/bin/env bash
+
+# Based on:
+# https://github.com/herbstluftwm/herbstluftwm/issues/1164
+
+
+# The script compares the number of opened windows in the focused tiling frame, and then compares:
+# 1) If the frame is not empty (!= 0), then it wll be split vertically by a ratio of 0.5 \
+# and the application will be opened in the new, empty frame
+# 2) If the frame is empty, then the application will simply be spawned on it.
+
+herbstclient \
+ chain \
+ , and \
+ : compare tags.focus.tiling.focused_frame.client_count != 0 \
+ : split auto \
+ , rule once index=e focus=on \
+ , spawn "$1"
diff --git a/bin/kbd b/bin/kbd
new file mode 100755
index 0000000..20a4e0e
--- /dev/null
+++ b/bin/kbd
@@ -0,0 +1,13 @@
+#!/bin/env bash
+
+sleep 1
+DISPLAY=":0.0"
+HOME=/home/math/
+XAUTHORITY=$HOME/.Xauthority
+export DISPLAY XAUTHORITY HOME
+
+kb_id=`xinput -list | grep -i 'sino wealth' | grep -o id=[0-9]. | grep -o [0-9]. | head -1`
+
+xset r rate 250 40
+setxkbmap -model abnt2 -layout br -variant abnt2
+xmodmap "/home/math/.Xmodmap"
diff --git a/bin/kbd_udev b/bin/kbd_udev
new file mode 100755
index 0000000..7c51dfa
--- /dev/null
+++ b/bin/kbd_udev
@@ -0,0 +1,3 @@
+#!/bin/env bash
+
+/home/math/.local/bin/kbd &
diff --git a/bin/launch_dwm b/bin/launch_dwm
new file mode 100755
index 0000000..9868f00
--- /dev/null
+++ b/bin/launch_dwm
@@ -0,0 +1,18 @@
+#!/bin/env sh
+
+# relaunch DWM if the binary changes, otherwise bail
+csum=""
+new_csum=$(sha1sum $(which dwm))
+while true
+do
+ if [ "$csum" != "$new_csum" ]
+ then
+ csum=$new_csum
+ dwm
+ else
+ exit 0
+ fi
+ new_csum=$(sha1sum $(which dwm))
+ sleep 0.5
+done
+
diff --git a/bin/markdown_py b/bin/markdown_py
new file mode 100755
index 0000000..ca0b785
--- /dev/null
+++ b/bin/markdown_py
@@ -0,0 +1,8 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+import re
+import sys
+from markdown.__main__ import run
+if __name__ == '__main__':
+ sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
+ sys.exit(run())
diff --git a/bin/mem b/bin/mem
new file mode 100755
index 0000000..dab317d
--- /dev/null
+++ b/bin/mem
@@ -0,0 +1,10 @@
+#!/bin/env bash
+
+# sends used memory to stdout
+mem() {
+ mem="$(free | grep Mem | awk ' { print $3/$2 * 100 } ')"
+
+ printf "%s %.0f%%" "" "$mem"
+}
+
+mem
diff --git a/bin/mic_check b/bin/mic_check
new file mode 100755
index 0000000..19ce263
--- /dev/null
+++ b/bin/mic_check
@@ -0,0 +1,12 @@
+#!/bin/env bash
+
+# mutes the microphone and send a notification
+
+# microphone mute state
+mute="$(pulsemixer --list-sources | grep -i default | awk '{print $10}' | sed -e 's/,//g')"
+
+[ "$mute" -eq 0 ] && notify-send "Microfone" "Mudo"
+
+[ "$mute" -eq 1 ] && notify-send "Microfone" "Reativado"
+
+pactl set-source-mute @DEFAULT_SOURCE@ toggle
diff --git a/bin/mpd_scroll b/bin/mpd_scroll
new file mode 100755
index 0000000..bbb6872
--- /dev/null
+++ b/bin/mpd_scroll
@@ -0,0 +1,12 @@
+#!/usr/bin/env bash
+
+zscroll --before-text "ﱘ No current song playing" --delay 0.3 \
+ --match-command "mpc status" \
+ --match-text "playing" "--before-text 'ﱘ '" \
+ --match-text "paused" "--before-text ' ' --scroll 0" \
+ --newline=true \
+ --length=30 \
+ --scroll=true \
+ --update-check true "mpc current" &
+
+wait
diff --git a/bin/pip3.8 b/bin/pip3.8
new file mode 100755
index 0000000..b0625ed
--- /dev/null
+++ b/bin/pip3.8
@@ -0,0 +1,8 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+import re
+import sys
+from pip._internal.cli.main import main
+if __name__ == '__main__':
+ sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
+ sys.exit(main())
diff --git a/bin/pkgs b/bin/pkgs
new file mode 100755
index 0000000..bb7e807
--- /dev/null
+++ b/bin/pkgs
@@ -0,0 +1,10 @@
+#!/bin/env bash
+
+# prints the number of current installed packages (pacman-based)
+pkgs() {
+ pkgs="$(pacman -Q | wc -l)"
+
+ printf "%s %d" "" "$pkgs"
+}
+
+pkgs
diff --git a/bin/print_tags b/bin/print_tags
new file mode 100755
index 0000000..a5cd811
--- /dev/null
+++ b/bin/print_tags
@@ -0,0 +1,29 @@
+#!/bin/env bash
+
+# prints hlwm's tag names
+print_tags() {
+ for tag in $(herbstclient tag_status); do
+ name=${tag#?}
+ state=${tag%$name}
+
+ case "$state" in
+ '#')
+ printf '%%{B#656565}%%{F#ffffff}%%{U#e60053} %s %%{U-}%%{F-}%%{B-}' "$name"
+ ;;
+ '+')
+ printf '%%{U#101112}%%{F#ffffff}%%{R} %s %%{R-}%%{U-}%%{F-}' "$name"
+ ;;
+ '!')
+ printf '%%{R} %s! %%{R-}' "$name"
+ ;;
+ '.')
+ printf '%%{U#101112}%%{F#8b8b8b} %s %%{F-}%%{U-}' "$name"
+ ;;
+ *)
+ printf '%%{U#101112} %s %%{U-}' "$name"
+ esac
+ done
+ printf '\n'
+}
+
+print_tags
diff --git a/bin/temp b/bin/temp
new file mode 100755
index 0000000..1270297
--- /dev/null
+++ b/bin/temp
@@ -0,0 +1,10 @@
+#!/bin/env bash
+
+# prints temperature
+temp() {
+ temp="$(sensors | grep -i package | awk '{print $4}' | sed -e 's/+//g')"
+
+ printf "%s %dºC" "" "$temp"
+}
+
+temp
diff --git a/bin/title b/bin/title
new file mode 100755
index 0000000..137272c
--- /dev/null
+++ b/bin/title
@@ -0,0 +1,10 @@
+#!/bin/env bash
+
+# prints window title
+title(){
+ title="$(xdotool getwindowfocus getwindowname)"
+
+ printf "%.10s" "$title"
+}
+
+title
diff --git a/bin/transcode b/bin/transcode
new file mode 100755
index 0000000..094c36e
--- /dev/null
+++ b/bin/transcode
@@ -0,0 +1,9 @@
+#!/bin/env bash
+
+# Este script faz a transcodagem de um vídeo de um codec para outro, feito para reduzir em até 80% o tamanho do arquivo original.
+
+ORIG="$1"
+NOME=$(basename "$ORIG" .mp4)
+NOVO="${2:-"$NOME-trans.mp4"}"
+
+ffmpeg -i "$ORIG" -vf mpdecimate -vsync vfr -c:v libx265 -x265-params crf=32 -preset veryslow "$NOVO"
diff --git a/bin/urlImage b/bin/urlImage
new file mode 100755
index 0000000..21ff6f5
--- /dev/null
+++ b/bin/urlImage
@@ -0,0 +1,12 @@
+#!/usr/bin/env bash
+
+# Pipe images from URLs into sxiv
+
+# get image extension
+EXT="${1##*.}"
+
+# download it into a tmp file
+wget "$1" -O /tmp/img.$EXT
+
+# open in sxiv
+sxiv /tmp/img.$EXT
diff --git a/bin/vimwiki_markdown b/bin/vimwiki_markdown
new file mode 100755
index 0000000..9b22d1a
--- /dev/null
+++ b/bin/vimwiki_markdown
@@ -0,0 +1,8 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+import re
+import sys
+from vimwiki_markdown import main
+if __name__ == '__main__':
+ sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
+ sys.exit(main())
diff --git a/bin/vol b/bin/vol
new file mode 100755
index 0000000..9bfbd2a
--- /dev/null
+++ b/bin/vol
@@ -0,0 +1,16 @@
+#!/bin/env bash
+
+# prints volume from pulseaudio
+vol() {
+ vol="$(pulsemixer --get-volume | awk ' { print $2 } ')"
+ mute="$(pulsemixer --get-mute)"
+
+ icon=""
+
+ # if muted
+ [ "$mute" -eq 1 ] || [ "$vol" -eq 0 ] && icon="" && vol=0
+
+ printf "%s %d%%" "$icon" "$vol"
+}
+
+vol
diff --git a/bin/wallpaper b/bin/wallpaper
new file mode 100755
index 0000000..0ae3e93
--- /dev/null
+++ b/bin/wallpaper
@@ -0,0 +1,14 @@
+#!/usr/bin/env bash
+
+# Baseado no script do Luke Smith
+
+DIR="$HOME/Imagens/Wallpapers"
+WAL="~/Imagens/Wallpapers/wall.png"
+
+# se o diretório existir, pegue um arquivo aleatoriamente
+[[ -d "$DIR" ]] && IMG=$(find "$DIR"/* | shuf -n 1)
+
+# se a imagem for diferente do wallpaper atual, copie-a
+[[ "$IMG" != "$WAL" ]] && cp $IMG ~/Imagens/Wallpapers/wall.png
+
+xwallpaper --stretch "$DIR"/wall.png && notify-send -i '"$DIR"/wall.png' 'Wallpaper alterado'
diff --git a/bin/wheel b/bin/wheel
new file mode 100755
index 0000000..90af11d
--- /dev/null
+++ b/bin/wheel
@@ -0,0 +1,8 @@
+#!/sbin/python3
+# -*- coding: utf-8 -*-
+import re
+import sys
+from wheel.cli import main
+if __name__ == '__main__':
+ sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
+ sys.exit(main())
diff --git a/bin/wlan b/bin/wlan
new file mode 100755
index 0000000..fcd35e4
--- /dev/null
+++ b/bin/wlan
@@ -0,0 +1,10 @@
+#!/bin/env bash
+
+# prints connected SSID name
+wlan() {
+ wlan="$(iwgetid | awk ' {print $2, $3, $4, $5, $6} ' | sed -e 's/ESSID://g' -e 's/"//g')"
+
+ printf "%s %s" "" "$wlan"
+}
+
+wlan
diff --git a/bin/wmMove b/bin/wmMove
new file mode 100755
index 0000000..6ee32a5
--- /dev/null
+++ b/bin/wmMove
@@ -0,0 +1,32 @@
+#!/bin/env sh
+
+# copied from:
+# https://www.reddit.com/r/herbstluftwm/comments/j4oq4k/does_anyone_know_how_i_could_allign_a_frame_to/gaejwks/?utm_source=reddit&utm_medium=web2x&context=3
+
+# get current window id, width and height
+WID="$(pfw)"
+WW="$(wattr w "$WID")"
+WH="$(wattr h "$WID")"
+
+# get screen width and height
+ROOT="$(lsw -r)"
+SW="$(wattr w "$ROOT")"
+SH="$(wattr h "$ROOT")"
+
+case $1 in
+ center)
+ xdotool getactivewindow windowmove "$(((SW - WW)/2))" "$(((SH - WH)/2))"
+ ;;
+ all-top)
+ xdotool getactivewindow windowmove x 0
+ ;;
+ half-top)
+ xdotool getactivewindow windowmove x "$((SH - WH))"
+ ;;
+ all-left)
+ xdotool getactivewindow windowmove 0 y
+ ;;
+ half-left)
+ xdotool getactivewindow windowmove "$((SW - WW))" y
+ ;;
+esac
diff --git a/bin/xev_keys b/bin/xev_keys
new file mode 100755
index 0000000..d370c49
--- /dev/null
+++ b/bin/xev_keys
@@ -0,0 +1,3 @@
+#!/usr/bin/env bash
+
+xev | awk -F'[ )]+' '/^KeyPress/ { a[NR+2] } NR in a { printf "%-3s %s\n", $5, $8 }'
diff --git a/bin/youtube-dl b/bin/youtube-dl
new file mode 100755
index 0000000..569d3d0
--- /dev/null
+++ b/bin/youtube-dl
@@ -0,0 +1,8 @@
+#!/sbin/python3
+# -*- coding: utf-8 -*-
+import re
+import sys
+from youtube_dl import main
+if __name__ == '__main__':
+ sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
+ sys.exit(main())