initial commit

This commit is contained in:
Ray Elliott 2020-04-21 16:50:59 +01:00
commit 0eec9e1064
29 changed files with 265 additions and 0 deletions

5
GIT_README.txt Normal file
View File

@ -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

1
bm Symbolic link
View File

@ -0,0 +1 @@
/home/ray/Projects-Sync/universal-bookmarks/bookmark-menu

BIN
broot Executable file

Binary file not shown.

3
deb-audio Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
PULSE_SERVER=192.168.0.90 pavucontrol

BIN
dwm Executable file

Binary file not shown.

40
dwmc Executable file
View File

@ -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

3
ff-fullscreen Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
/usr/bin/bspc rule -a firefox -o state=fullscreen && /usr/bin/firefox -url $@

4
figma Executable file
View File

@ -0,0 +1,4 @@
!/bin/sh
/usr/local/bin/ff-fullscreen https://www.figma.com/files

BIN
lf Executable file

Binary file not shown.

14
newbash Executable file
View File

@ -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"

14
newsh Executable file
View File

@ -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"

67
notify-updates Executable file
View File

@ -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

4
omv Executable file
View File

@ -0,0 +1,4 @@
#!/bin/sh
/usr/local/bin/ff-fullscreen ovm.home

24
pacman-update-count Executable file
View File

@ -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"

6
pam-say Executable file
View File

@ -0,0 +1,6 @@
#!/bin/sh
_command="echo ""$*"" | festival --tts"
ssh pamela "$_command"

4
pihole Executable file
View File

@ -0,0 +1,4 @@
#!/bin/sh
/usr/bin/firefox http://omv.home:8080/admin/ http://pihole.home/admin/

3
pve Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
/usr/local/bin/ff-fullscreen pve.home

19
qutesesh Executable file
View File

@ -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

BIN
slock Executable file

Binary file not shown.

BIN
st Executable file

Binary file not shown.

BIN
surf Executable file

Binary file not shown.

3
terminal Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
st "$@"

3
terminal-dev Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
alacritty -e "$@"

13
tmux-select Executable file
View File

@ -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

3
wiki Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
/usr/local/bin/ff-fullscreen gollum.docker.home

32
window-select Executable file
View File

@ -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

BIN
wp Executable file

Binary file not shown.

BIN
xrestrict Executable file

Binary file not shown.

BIN
youtube-dl Executable file

Binary file not shown.