commit 0eec9e1064f078bc2b8e86d4930cac7cb864651e Author: ray Date: Tue Apr 21 16:50:59 2020 +0100 initial commit diff --git a/GIT_README.txt b/GIT_README.txt new file mode 100644 index 0000000..068bf6d --- /dev/null +++ b/GIT_README.txt @@ -0,0 +1,5 @@ +Tracks files in /usr/local/bin + +Initialised with: + +git --git-dir=/home/ray/.config/bin --work-tree=/usr/local/bin init diff --git a/bm b/bm new file mode 120000 index 0000000..cfaa96b --- /dev/null +++ b/bm @@ -0,0 +1 @@ +/home/ray/Projects-Sync/universal-bookmarks/bookmark-menu \ No newline at end of file diff --git a/broot b/broot new file mode 100755 index 0000000..baaab34 Binary files /dev/null and b/broot differ diff --git a/deb-audio b/deb-audio new file mode 100755 index 0000000..5db7047 --- /dev/null +++ b/deb-audio @@ -0,0 +1,3 @@ +#!/bin/sh + +PULSE_SERVER=192.168.0.90 pavucontrol diff --git a/dwm b/dwm new file mode 100755 index 0000000..47b35c4 Binary files /dev/null and b/dwm differ diff --git a/dwmc b/dwmc new file mode 100755 index 0000000..5ff8dbc --- /dev/null +++ b/dwmc @@ -0,0 +1,40 @@ +#!/usr/bin/env sh + +signal() { + xsetroot -name "fsignal:$*" +} + +case $# in +1) + case $1 in + setlayout | view | viewall | togglebar | togglefloating | zoom | killclient | quit) + signal $1 + ;; + *) + echo "Unknown command or missing one argument." + exit 1 + ;; + esac + ;; +2) + case $1 in + view) + signal $1 ui $2 + ;; + viewex | toggleviewex | tagex | toggletagex | setlayoutex | focusstack | incnmaster | focusmon | tagmon) + signal $1 i $2 + ;; + setmfact) + signal $1 f $2 + ;; + *) + echo "Unknown command or one too many arguments." + exit 1 + ;; + esac + ;; +*) + echo "Too many arguments." + exit 1 + ;; +esac diff --git a/ff-fullscreen b/ff-fullscreen new file mode 100755 index 0000000..98e921c --- /dev/null +++ b/ff-fullscreen @@ -0,0 +1,3 @@ +#!/bin/sh + +/usr/bin/bspc rule -a firefox -o state=fullscreen && /usr/bin/firefox -url $@ diff --git a/figma b/figma new file mode 100755 index 0000000..bb53b1e --- /dev/null +++ b/figma @@ -0,0 +1,4 @@ +!/bin/sh + +/usr/local/bin/ff-fullscreen https://www.figma.com/files + diff --git a/lf b/lf new file mode 100755 index 0000000..914b467 Binary files /dev/null and b/lf differ diff --git a/newbash b/newbash new file mode 100755 index 0000000..6b8568a --- /dev/null +++ b/newbash @@ -0,0 +1,14 @@ +#!/bin/sh + +set -e + +if [ -f "$1" ] ; then + echo "Error: file exists: $1" + exit 1 +fi + +echo "#!/bin/bash" > "$1" +echo "" >> "$1" +echo "$2" >> "$1" + +chmod +x "$1" diff --git a/newsh b/newsh new file mode 100755 index 0000000..2231967 --- /dev/null +++ b/newsh @@ -0,0 +1,14 @@ +#!/bin/sh + +set -e + +if [ -f "$1" ] ; then + echo "Error: file exists: $1" + exit 1 +fi + +echo "#!/bin/sh" > "$1" +echo "" >> "$1" +echo "$2" >> "$1" + +chmod +x "$1" diff --git a/notify-updates b/notify-updates new file mode 100755 index 0000000..7b88b02 --- /dev/null +++ b/notify-updates @@ -0,0 +1,67 @@ +#!/bin/sh + +_target_file="/tmp/pacman-update-count" +# if set to 1 then also notify if no updates available +_notify_none=0 +_error_code=0 +_show_help=0 +_hostname=$(hostname) +_config_file="$HOME/.config/notify-updates/notify-updates.config" + +if ! [ -f "$_target_file" ] ; +then + echo "notify-updates: cannot access '$_target_file': File not found" + echo "notify-updates: try executing 'pacman-update-count.sh'" + exit 1 +fi + +for _arg in "$@" ; do + if [ "$_arg" = "-h" ] || [ "$_arg" = "--help" ] ; then + _show_help=1 + elif [ "$_arg" = "-n" ] || [ "$_arg" = "--notify-none" ] ; then + _notify_none=1 + else + _error_code="5" + _show_help=1 + echo "notify-updates: invalid option -- $_arg" + fi +done + +if [ "$_show_help" -eq 1 ] ; then + echo "Options:" + echo " -h, --help show this message and exit" + echo " -n, --notify-none notify if no updates available" + exit "$_error_code" +fi + +if [ "$_error_code" -gt 0 ] ; then + exit "$_error_code" +fi + +# TODO use $XDG_CONFIG_HOME +if [ -f "$_config_file" ] ; then + # shellcheck source=notify-updates.config + . "$_config_file" +else + echo "notify-updates: warning - config file not found: $_config_file" +fi + +if [ "$notify_if_none" = "true" ] ; then + _notify_none=1 +elif [ "$notify_if_none" = "false" ] ; then + _notify_none=0 +fi + +_updates_available=$(cat $_target_file) + +if [ "$_updates_available" -gt 0 ] ; then + _plural="s" + if [ "$_updates_available" -lt 2 ] ; then + _plural="" + fi + echo "Attention please: Update required for $_hostname: $_updates_available package$_plural" | festival --tts + notify-send "Update Notifier" "Update required: $_updates_available package$_plural" +elif [ "$_notify_none" -eq 1 ] ; then + echo "Attention please: No package updates required for $_hostname" | festival --tts + notify-send -u low "Update Notifier" "No updates required" +fi diff --git a/omv b/omv new file mode 100755 index 0000000..394b4f4 --- /dev/null +++ b/omv @@ -0,0 +1,4 @@ +#!/bin/sh + +/usr/local/bin/ff-fullscreen ovm.home + diff --git a/pacman-update-count b/pacman-update-count new file mode 100755 index 0000000..183dd10 --- /dev/null +++ b/pacman-update-count @@ -0,0 +1,24 @@ +#!/bin/sh + +set -e + +_updates_available="-1" +_target_file="/tmp/pacman-update-count" +_user="ray" +_user_id=$(id -u) + +if ! [ "$_user_id" -eq 0 ] ; then + echo "pacman-update-count.sh: insufficient priviliges: must be run as root" + exit 1 +fi + +touch "$_target_file" +chown root: "$_target_file" +echo "$_updates_available" > "$_target_file" + +pacman -Sy +_updates_available=$(pacman -Qu | wc -l) + +echo "Adding $_updates_available available updates to $_target_file" +echo "$_updates_available" > "$_target_file" +chown "$_user": "$_target_file" diff --git a/pam-say b/pam-say new file mode 100755 index 0000000..3848265 --- /dev/null +++ b/pam-say @@ -0,0 +1,6 @@ +#!/bin/sh + +_command="echo ""$*"" | festival --tts" +ssh pamela "$_command" + + diff --git a/pihole b/pihole new file mode 100755 index 0000000..226db42 --- /dev/null +++ b/pihole @@ -0,0 +1,4 @@ +#!/bin/sh + +/usr/bin/firefox http://omv.home:8080/admin/ http://pihole.home/admin/ + diff --git a/pve b/pve new file mode 100755 index 0000000..db74c9b --- /dev/null +++ b/pve @@ -0,0 +1,3 @@ +#!/bin/sh + +/usr/local/bin/ff-fullscreen pve.home diff --git a/qutesesh b/qutesesh new file mode 100755 index 0000000..dbee8f8 --- /dev/null +++ b/qutesesh @@ -0,0 +1,19 @@ +#!/bin/sh + +_session_dir="$HOME/.local/share/qutebrowser/sessions" +_dmenu_config="$HOME/.config/dmenu/dmenurc" + +if [ -f "$_dmenu_config" ] ; then + # dmenu options will now be stored in $DMENU_OPTIONS + . "$_dmenu_config" +fi + +_session_list=$(ls -t "$_session_dir" | sed 's/\.yml//') +_session=$(printf "NONE\n%s" "$_session_list" | dmenu $DMENU_OPTIONS -i -p "Session :") +[ -z "$_session" ] && exit 5; + +if [ "$_session" = 'NONE' ] ; then + qutebrowser -R +else + qutebrowser -r "$_session_dir/$_session.yml" +fi diff --git a/slock b/slock new file mode 100755 index 0000000..7e9e11b Binary files /dev/null and b/slock differ diff --git a/st b/st new file mode 100755 index 0000000..e625119 Binary files /dev/null and b/st differ diff --git a/surf b/surf new file mode 100755 index 0000000..1cc0cc0 Binary files /dev/null and b/surf differ diff --git a/terminal b/terminal new file mode 100755 index 0000000..fd04983 --- /dev/null +++ b/terminal @@ -0,0 +1,3 @@ +#!/bin/sh + +st "$@" diff --git a/terminal-dev b/terminal-dev new file mode 100755 index 0000000..58f62f1 --- /dev/null +++ b/terminal-dev @@ -0,0 +1,3 @@ +#!/bin/sh + +alacritty -e "$@" diff --git a/tmux-select b/tmux-select new file mode 100755 index 0000000..525ac83 --- /dev/null +++ b/tmux-select @@ -0,0 +1,13 @@ +#!/bin/sh + +_dmenu_config="$HOME/.config/dmenu/dmenurc" +_sessions="$(tmux ls | cut -d: -f1)" + +if [ -f "$_dmenu_config" ] ; then + # dmenu options will now be stored in $DMENU_OPTIONS + . "$_dmenu_config" +fi + +_session=$(echo "$_sessions" | dmenu $DMENU_OPTIONS -i -p "Tmux session:") + +[ -z "$_session" ] || terminal-dev tmux attach -t $_session diff --git a/wiki b/wiki new file mode 100755 index 0000000..a5e4770 --- /dev/null +++ b/wiki @@ -0,0 +1,3 @@ +#!/bin/sh + +/usr/local/bin/ff-fullscreen gollum.docker.home diff --git a/window-select b/window-select new file mode 100755 index 0000000..cb56952 --- /dev/null +++ b/window-select @@ -0,0 +1,32 @@ +#!/bin/bash + +# dependency - xtitle + +# arguments: +# none - select from windows on current desktop +# 'monitor' - select from all windows. +# 'all' - select from all windows. + +. "$HOME/.config/dmenu/dmenurc" + +if command -v bspc ; then + # adapted from: https://www.reddit.com/r/bspwm/comments/er2olp/dmenu_window_picker/ff16ff0/ + # NOTE: query can be '.window', '.local.window', '.local.tiled' (to only have tiled windows + # as options) or '.local.window.!fullscreen.!floating' (to only have tiled and pseudo_tiled windows as options). + if [ "$1" = all ] ; then + ids=($(bspc query -N -n ".window")) + elif [ "$1" = monitor ] ; then + ids=($(bspc query -N -m "focused")) + else + # current desktop + ids=($(bspc query -N -n ".local.window")) + fi + options="$(xtitle "${ids[@]}" | awk '{ print ++i": "$0 }')" + + [[ -n "$options" ]] || exit + + id_index="$(<<< "$options" dmenu $DMENU_OPTIONS -l 20 | cut -d: -f1)" + [[ -n "$id_index" ]] || exit + bspc node "${ids[$((id_index - 1))]}" -f + +fi diff --git a/wp b/wp new file mode 100755 index 0000000..cee0c03 Binary files /dev/null and b/wp differ diff --git a/xrestrict b/xrestrict new file mode 100755 index 0000000..f621670 Binary files /dev/null and b/xrestrict differ diff --git a/youtube-dl b/youtube-dl new file mode 100755 index 0000000..d2f33c7 Binary files /dev/null and b/youtube-dl differ