aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorCharles Cabergs <me@cacharle.xyz>2021-02-24 17:07:33 +0100
committerCharles Cabergs <me@cacharle.xyz>2021-02-24 17:07:33 +0100
commit468a789dbc4b1928c035d8590895efc533520a27 (patch)
tree74cb056c37eaa50cd50491a7665608488ed4feb1 /bin
parentf9883d2c3b3699d91e98feeffd7eece546f7c57e (diff)
downloaddotfiles-468a789dbc4b1928c035d8590895efc533520a27.tar.gz
dotfiles-468a789dbc4b1928c035d8590895efc533520a27.tar.bz2
dotfiles-468a789dbc4b1928c035d8590895efc533520a27.zip
Updated file tree to match XDG base directory specification
Diffstat (limited to 'bin')
-rwxr-xr-xbin/backlight-ctl23
-rwxr-xr-xbin/battery-low-check5
-rwxr-xr-xbin/bitwarden-dmenu8
-rwxr-xr-xbin/cacharle-sync28
-rwxr-xr-xbin/project-open53
-rwxr-xr-xbin/repo-client3
-rwxr-xr-xbin/tag-music32
-rwxr-xr-xbin/touchpad-toggle12
8 files changed, 0 insertions, 164 deletions
diff --git a/bin/backlight-ctl b/bin/backlight-ctl
deleted file mode 100755
index 2963d83..0000000
--- a/bin/backlight-ctl
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/sh
-
-[ "$#" -ne 1 ] && exit 1;
-
-
-if [ "$(hostname)" = manjaro ]
-then
- cmd=light
- up_opt=-A
- down_opt=-U
-else
- cmd=xbacklight
- up_opt=-inc
- down_opt=-dec
-fi
-
-case "$1" in
- "up") "$cmd" "$up_opt" 5 ;;
- "down") "$cmd" "$down_opt" 5 ;;
- *) exit 1 ;;
-esac
-
-notify-send "backlight $("$cmd" | cut -d '.' -f 1)"
diff --git a/bin/battery-low-check b/bin/battery-low-check
deleted file mode 100755
index dbbdc6b..0000000
--- a/bin/battery-low-check
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-
-capacity=$(cat /sys/class/power_supply/BAT0/capacity)
-
-[ "$capacity" -lt 10 ] && notify-send -u critical "Battery low $capacity%"
diff --git a/bin/bitwarden-dmenu b/bin/bitwarden-dmenu
deleted file mode 100755
index 68afe04..0000000
--- a/bin/bitwarden-dmenu
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-
-domain="$(echo | dmenu -p 'Enter domain name: ')"
-
-echo | dmenu -P -p 'Enter your master password: ' |
- (bw get password "$domain" ||
- { notify-send -u critical 'Bad password'; exit 1; }) |
- xclip -selection clipboard
diff --git a/bin/cacharle-sync b/bin/cacharle-sync
deleted file mode 100755
index 80f19bb..0000000
--- a/bin/cacharle-sync
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/bin/sh
-
-usage() {
- echo "Usage: $0 push/pull [rsync args...]"
-}
-
-[ -z "$1" ] && usage && exit 1
-
-RSYNC_ARGS="$(echo "$*" | cut -d ' ' -f 2-)"
-RSYNC_CMD="rsync -avh --progress --compress $RSYNC_ARGS"
-
-REMOTE_USER=charles
-REMOTE_HOST=cacharle.xyz
-
-SYNC_DIR="cacharle-sync/"
-SYNC_PATH="$HOME/$SYNC_DIR"
-
-case "$1" in
- push)
- $RSYNC_CMD "$SYNC_PATH" "$REMOTE_USER@$REMOTE_HOST:$SYNC_DIR"
- ;;
- pull)
- $RSYNC_CMD "$REMOTE_USER@$REMOTE_HOST:$SYNC_DIR" "$SYNC_PATH"
- ;;
- *)
- usage && exit 1
- ;;
-esac
diff --git a/bin/project-open b/bin/project-open
deleted file mode 100755
index adb27a4..0000000
--- a/bin/project-open
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/bin/sh
-
-# shellcheck disable=SC2088
-# (tile does not expand in single quote)
-dest=$(
- find ~/git -mindepth 1 -maxdepth 1 -printf '%A@\t%f\n' |
- sort -r |
- cut -f 2 |
- dmenu -l 10 -p '~/git/'
-)
-
-[ -z "$dest" ] && exit 1
-
-dest_path="$HOME/git/$dest"
-
-if cd "$dest_path" 2> /dev/null
-then
- touch "$dest_path"
- exec st
-else
- while [ -z "$choice" ]
- do
- choice=$(printf 'create\nclone\ncancel' | dmenu -p "New repository at ~/git/$dest?")
- done
-
- case "$choice" in
- "create")
- mkdir -p "$dest_path"
- cd "$dest_path" || exit 1
- git init
- exec st
- ;;
-
- "clone")
- while [ -z "$remote_choice" ]
- do
- remote_choice=$(printf 'github.com\ncacharle.xyz\nclipboard\nother' | dmenu -p "Remote location")
- done
- case "$remote_choice" in
- github.com) prefix='git@github.com:cacharle/' ;;
- cacharle.xyz) prefix='git@cacharle.xyz:/srv/git/' ;;
- clipboard) dest="$(xclip -selection clipboard -o)" ;;
- other) ;;
- esac
- url="$prefix$(echo "$dest" | dmenu -p "Enter repository url: $prefix")"
- st -e /bin/sh -c "git clone --recursive '$url' '$dest_path' && cd '$dest_path' && exec $SHELL" ||
- notify-send -u critical "Could not clone $url in $dest_path" && exit 1
- ;;
-
- "cancel") exit ;;
- *) exit 1 ;;
- esac
-fi
diff --git a/bin/repo-client b/bin/repo-client
deleted file mode 100755
index 49049d8..0000000
--- a/bin/repo-client
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-ssh git@cacharle.xyz repo $*
diff --git a/bin/tag-music b/bin/tag-music
deleted file mode 100755
index 826a83a..0000000
--- a/bin/tag-music
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/sh
-
-music_dir="$HOME/Music"
-
-for artist_dir in "$music_dir"/*
-do
- [ ! -d "$artist_dir" ] && continue
- artist="$(basename "$artist_dir")"
- [ "$artist" = backup ] && continue
-
- for album_dir in "$artist_dir"/*
- do
- album="$(basename "$album_dir")"
- [ ! -d "$album_dir" ] && continue
-
- for song_file in "$album_dir"/*
- do
- [ ! -f "$song_file" ] && continue
- song="$(basename "$song_file" | rev | cut -d '.' -f 2- | rev)"
- # echo $song_file
- track=0
- if expr "$song" : "[0-9][0-9]*\-.*" > /dev/null
- then
- track="$(echo "$song" | cut -d '-' -f 1)"
- song="$(echo "$song" | cut -d '-' -f 2-)"
- fi
- # echo $track $song
- # echo $song_file
- taffy --artist "$artist" --album "$album" --title "$song" --track "$track" "$song_file"
- done
- done
-done
diff --git a/bin/touchpad-toggle b/bin/touchpad-toggle
deleted file mode 100755
index e4dc959..0000000
--- a/bin/touchpad-toggle
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/sh
-
-touchpad_name='ETPS/2 Elantech Touchpad'
-
-active="$(xinput list-props "$touchpad_name" | grep 'Device Enabled' | cut -f 3)"
-
-if [ "$active" -eq 1 ]
-then
- xinput disable "$touchpad_name"
-else
- xinput enable "$touchpad_name"
-fi