diff --git a/system/.local/bin/clean b/system/.local/bin/clean index 2146cff..55a283e 100755 --- a/system/.local/bin/clean +++ b/system/.local/bin/clean @@ -1,16 +1,5 @@ #!/usr/bin/env bash -# -# SCRIPT NAME: -# clean -# -# AUTHOR: -# Severin Kaderli -# -# DESCRIPTION: -# This script cleans the system. -# -# USAGE: -# ./clean + . utils print_section "Remove unneeded dependencies" diff --git a/system/.local/bin/cmus-cover b/system/.local/bin/cmus-cover deleted file mode 100755 index 1c274ca..0000000 --- a/system/.local/bin/cmus-cover +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env bash -# -# SCRIPT NAME: -# cmus-cover -# -# AUTHOR: -# Severin Kaderli -# -# DESCRIPTION: -# Saves the current cmus cover to a file. -# -# USAGE: -# ./cmus-cover -FILE="$(cmus-remote -Q | grep -e "file " | cut -d " " -f 2-)" -ffmpeg -y -i "${FILE}" -f image2 /home/severin/.local/share/cmus/.cover \ No newline at end of file diff --git a/system/.local/bin/code b/system/.local/bin/code index 19a7f4d..16baab4 100755 --- a/system/.local/bin/code +++ b/system/.local/bin/code @@ -1,14 +1,3 @@ -#!/usr/bin/env bash -# -# SCRIPT NAME: -# code -# -# AUTHOR: -# Severin Kaderli -# -# DESCRIPTION: -# Wrapper script for code to use XDG directories -# -# USAGE: -# ./code +#!/usr/bin/env sh + "/usr/bin/code" --extensions-dir "${XDG_DATA_HOME}/vscode/extensions" "${@}" diff --git a/system/.local/bin/dodge-jump b/system/.local/bin/dodge-jump index 8e20435..26d3452 100755 --- a/system/.local/bin/dodge-jump +++ b/system/.local/bin/dodge-jump @@ -1,2 +1,3 @@ -#!/usr/bin/env bash +#!/usr/bin/env sh + xdotool keydown 65 && xdotool mousedown 2 && xdotool keyup 65 && xdotool mouseup 2 diff --git a/system/.local/bin/fuzzel b/system/.local/bin/fuzzel index 1620bc5..a031d2f 100755 --- a/system/.local/bin/fuzzel +++ b/system/.local/bin/fuzzel @@ -1,4 +1,5 @@ -#!/usr/bin/env bash +#!/usr/bin/env sh + /usr/bin/fuzzel \ -x 10 -y 10 -p 10 \ -r 0 \ diff --git a/system/.local/bin/games b/system/.local/bin/games deleted file mode 100755 index 9647222..0000000 --- a/system/.local/bin/games +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env bash -# -# SCRIPT NAME: -# games -# -# AUTHOR: -# Severin Kaderli -# -# DESCRIPTION: -# Displays a game menu using rofi. -# -# USAGE: -# ./games - -# The rofi prompt -PROMPT="Games" - -# Actions for the menu -ACTIONS=( - "1: Steam" - "2: Lutris" - "3: Minecraft" - "4: Pegasus" -) - -SELECTION=$(printf '%s\n' "${ACTIONS[@]}" | rofi -dmenu -i -p "${PROMPT}" | cut -d ":" -f1) -case "${SELECTION}" in - "1") - steam - ;; - "2") - lutris - ;; - "3") - minecraft-launcher - ;; - "4") - pegasus-fe - ;; -esac diff --git a/system/.local/bin/gpg2 b/system/.local/bin/gpg2 index d20bc38..e0a90ec 100755 --- a/system/.local/bin/gpg2 +++ b/system/.local/bin/gpg2 @@ -1,14 +1,3 @@ -#!/usr/bin/env bash -# -# SCRIPT NAME: -# gpg2 -# -# AUTHOR: -# Severin Kaderli -# -# DESCRIPTION: -# Wrapper script for gpg2 to use XDG directories -# -# USAGE: -# ./gpg2 -"/usr/bin/gpg2" --homedir "${XDG_DATA_HOME}/gnupg" "${@}" \ No newline at end of file +#!/usr/bin/env sh + +"/usr/bin/gpg2" --homedir "${XDG_DATA_HOME}/gnupg" "${@}" diff --git a/system/.local/bin/increase-volume b/system/.local/bin/increase-volume deleted file mode 100755 index e25e86b..0000000 --- a/system/.local/bin/increase-volume +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env bash -# -# SCRIPT NAME: -# increase-volume -# -# AUTHOR: -# Severin Kaderli -# -# DESCRIPTION: -# This script uses pamixer to increase the volume by 5% as long -# as the current volume is less than 150%. I call this script -# using custom i3 keybindings. -# -# USAGE: -# ./increase-volume -if [[ $(pamixer --get-volume) -lt 150 ]]; then - pamixer -i 5 --allow-boost -fi diff --git a/system/.local/bin/is-connected b/system/.local/bin/is-connected deleted file mode 100755 index 8632546..0000000 --- a/system/.local/bin/is-connected +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env bash -# -# SCRIPT NAME: -# is-connected -# -# AUTHOR: -# Severin Kaderli -# -# DESCRIPTION: -# Checks if the output is connected -# -# USAGE: -# ./is-connected OUTPUT - -if [ -z "${1}" ]; then - echo "No output given" - exit 1 -fi - -if xrandr --query | grep -q "${1} connected" -then - exit 0 -else - exit 1 -fi diff --git a/system/.local/bin/monitor-setup b/system/.local/bin/monitor-setup deleted file mode 100755 index bc461f5..0000000 --- a/system/.local/bin/monitor-setup +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env bash -# -# SCRIPT NAME: -# monitor-setup -# -# AUTHOR: -# Severin Kaderli -# -# DESCRIPTION: -# Setups the resolution, wallpaper and polybar -# -# USAGE: -# ./monitor-setup -resolution -polybar-launch -wallpaper \ No newline at end of file diff --git a/system/.local/bin/mvn b/system/.local/bin/mvn index 64e4a32..261291d 100755 --- a/system/.local/bin/mvn +++ b/system/.local/bin/mvn @@ -1,14 +1,3 @@ -#!/usr/bin/env bash -# -# SCRIPT NAME: -# mvn -# -# AUTHOR: -# Severin Kaderli -# -# DESCRIPTION: -# Wrapper script for mvn to use XDG directories -# -# USAGE: -# ./mvn -"/usr/bin/mvn" -gs "${XDG_CONFIG_HOME}/maven/settings.xml" "${@}" \ No newline at end of file +#!/usr/bin/env sh + +"/usr/bin/mvn" -gs "${XDG_CONFIG_HOME}/maven/settings.xml" "${@}" diff --git a/system/.local/bin/nvidia-settings b/system/.local/bin/nvidia-settings index 32dfb60..5b6f181 100755 --- a/system/.local/bin/nvidia-settings +++ b/system/.local/bin/nvidia-settings @@ -1,14 +1,3 @@ -#!/usr/bin/env bash -# -# SCRIPT NAME: -# nvidia-settings -# -# AUTHOR: -# Severin Kaderli -# -# DESCRIPTION: -# Wrapper script for nvidia-settings to use XDG directories -# -# USAGE: -# ./nvidia-settings -"/usr/bin/nvidia-settings" --config="${XDG_CONFIG_HOME}/nvidia/settings" "${@}" \ No newline at end of file +#!/usr/bin/env sh + +"/usr/bin/nvidia-settings" --config="${XDG_CONFIG_HOME}/nvidia/settings" "${@}" diff --git a/system/.local/bin/polybar-launch b/system/.local/bin/polybar-launch deleted file mode 100755 index 341ab27..0000000 --- a/system/.local/bin/polybar-launch +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/env bash -# -# SCRIPT NAME: -# polybar-launch -# -# AUTHOR: -# Severin Kaderli -# -# DESCRIPTION: -# This script kills existing polybar processes and then launches the bars. -# -# USAGE: -# ./polybar-launch - -# Terminate already running bar instances -killall -q polybar - -# Wait until the processes have been shut down -while pgrep -x polybar >/dev/null; do sleep 1; done - -if [ "${IS_WORK}" = "1" ]; then - export POLYBAR_WLAN="wlp4s0" - export POLYBAR_NETWORK="enp0s20f0u1u1i5" -else - export POLYBAR_WLAN="wlp3s0" - export POLYBAR_NETWORK="enp0s31f6" -fi - -MONITORS=( - "eDP1" - "eDP-1-1" - "HDMI1" - "HDMI-1-1" - "HDMI-1-2" - "DVI-I-1-1" - "DVI-I-2-1" - "HDMI2" -) - -for monitor in "${MONITORS[@]}"; do - if is-connected "${monitor}"; then - export POLYBAR_MONITOR="${monitor}" - polybar top & - polybar bottom & - fi -done diff --git a/system/.local/bin/power b/system/.local/bin/power index f531c8b..abad3d7 100755 --- a/system/.local/bin/power +++ b/system/.local/bin/power @@ -1,16 +1,4 @@ #!/usr/bin/env bash -# -# SCRIPT NAME: -# power -# -# AUTHOR: -# Severin Kaderli -# -# DESCRIPTION: -# Displays a power menu using rofi. -# -# USAGE: -# ./power # The rofi prompt PROMPT="Power Options" diff --git a/system/.local/bin/resolution b/system/.local/bin/resolution deleted file mode 100755 index c4c200d..0000000 --- a/system/.local/bin/resolution +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env bash -# -# SCRIPT NAME: -# resolution -# -# AUTHOR: -# Severin Kaderli -# -# DESCRIPTION: -# This is the script that is used to setup my monitors. This script -# is used by i3. -# -# USAGE: -# ./resolution - -autorandr --change diff --git a/system/.local/bin/scp b/system/.local/bin/scp index c412a75..1dde2dd 100755 --- a/system/.local/bin/scp +++ b/system/.local/bin/scp @@ -1,14 +1,3 @@ -#!/usr/bin/env bash -# -# SCRIPT NAME: -# scp -# -# AUTHOR: -# Severin Kaderli -# -# DESCRIPTION: -# Wrapper script for scp to use XDG directories -# -# USAGE: -# ./scp -"/usr/bin/scp" -F "${XDG_CONFIG_HOME}/ssh/config" "${@}" \ No newline at end of file +#!/usr/bin/env sh + +"/usr/bin/scp" -F "${XDG_CONFIG_HOME}/ssh/config" "${@}" diff --git a/system/.local/bin/screenlock b/system/.local/bin/screenlock deleted file mode 100755 index f1c9a70..0000000 --- a/system/.local/bin/screenlock +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env bash -# -# SCRIPT NAME: -# screenlock -# -# AUTHOR: -# Severin Kaderli -# -# DESCRIPTION: -# This script locks the screen using betterlockscreen. This script is called -# using a custom i3 keybinding. -# -# USAGE: -# ./screenlock -betterlockscreen -l diff --git a/system/.local/bin/screenshot b/system/.local/bin/screenshot index c35bb79..bdc55f0 100755 --- a/system/.local/bin/screenshot +++ b/system/.local/bin/screenshot @@ -1,16 +1,4 @@ #!/usr/bin/env bash -# -# SCRIPT NAME: -# screenshot -# -# AUTHOR: -# Severin Kaderli -# -# DESCRIPTION: -# Displays a screenshot menu using rofi. -# -# USAGE: -# ./screenshot # The rofi prompt PROMPT="Screenshot" diff --git a/system/.local/bin/sqlite3 b/system/.local/bin/sqlite3 index 32d5c7c..939c036 100755 --- a/system/.local/bin/sqlite3 +++ b/system/.local/bin/sqlite3 @@ -1,14 +1,3 @@ -#!/usr/bin/env bash -# -# SCRIPT NAME: -# sqlite3 -# -# AUTHOR: -# Severin Kaderli -# -# DESCRIPTION: -# Wrapper script for sqlite3 to use XDG directories -# -# USAGE: -# ./sqlite3 -"/usr/bin/sqlite3" -init "${XDG_CONFIG_HOME}/sqlite3/sqliterc" "${@}" \ No newline at end of file +#!/usr/bin/env sh + +"/usr/bin/sqlite3" -init "${XDG_CONFIG_HOME}/sqlite3/sqliterc" "${@}" diff --git a/system/.local/bin/ssh b/system/.local/bin/ssh index 735846d..0bc87e8 100755 --- a/system/.local/bin/ssh +++ b/system/.local/bin/ssh @@ -1,14 +1,3 @@ -#!/usr/bin/env bash -# -# SCRIPT NAME: -# ssh -# -# AUTHOR: -# Severin Kaderli -# -# DESCRIPTION: -# Wrapper script for ssh to use XDG directories -# -# USAGE: -# ./ssh -TERM=xterm-256color "/usr/bin/ssh" -F "${XDG_CONFIG_HOME}/ssh/config" "${@}" \ No newline at end of file +#!/usr/bin/env sh + +TERM=xterm-256color "/usr/bin/ssh" -F "${XDG_CONFIG_HOME}/ssh/config" "${@}" diff --git a/system/.local/bin/ssh-switch b/system/.local/bin/ssh-switch deleted file mode 100755 index 1cd5e75..0000000 --- a/system/.local/bin/ssh-switch +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env bash -# -# SCRIPT NAME: -# ssh-switch -# -# AUTHOR: -# Severin Kaderli -# -# DESCRIPTION: -# Switches the current SSH Key -# -# USAGE: -# ./ssh-switch KEY - -cp -a "${HOME}/.ssh/${1}" "${HOME}/.ssh/id_rsa" -cp -a "${HOME}/.ssh/${1}.pub" "${HOME}/.ssh/id_rsa.pub" \ No newline at end of file diff --git a/system/.local/bin/submodule-update b/system/.local/bin/submodule-update index ea2646e..82a6d92 100755 --- a/system/.local/bin/submodule-update +++ b/system/.local/bin/submodule-update @@ -1,17 +1,5 @@ #!/usr/bin/env bash -# -# SCRIPT NAME: -# submodule-update -# -# AUTHOR: -# Severin Kaderli -# -# DESCRIPTION: -# Updates the submodules in all Git repositories in this folder and creates a -# new commit and pushes it. Only when there are no staged changes pending. -# -# USAGE: -# ./submodule-update + . utils START_DIR=$(pwd) diff --git a/system/.local/bin/svn b/system/.local/bin/svn index 292e3c6..8bcb612 100755 --- a/system/.local/bin/svn +++ b/system/.local/bin/svn @@ -1,14 +1,3 @@ -#!/usr/bin/env bash -# -# SCRIPT NAME: -# svn -# -# AUTHOR: -# Severin Kaderli -# -# DESCRIPTION: -# Wrapper script for svn to use XDG directories -# -# USAGE: -# ./svn -"/usr/bin/svn" --config-dir "${XDG_CONFIG_HOME}/subversion" "${@}" \ No newline at end of file +#!/usr/bin/env sh + +"/usr/bin/svn" --config-dir "${XDG_CONFIG_HOME}/subversion" "${@}" diff --git a/system/.local/bin/twitch b/system/.local/bin/twitch index e7c741c..a9afcd0 100755 --- a/system/.local/bin/twitch +++ b/system/.local/bin/twitch @@ -1,26 +1,16 @@ -#!/usr/bin/env bash -# -# SCRIPT NAME: -# twitch -# -# AUTHOR: -# Severin Kaderli -# -# DESCRIPTION: -# This script loads a Twitch livestream in a local video player -# using streamlink. -# -# USAGE: -# ./twitch USERNAME [RESOLUTION] -if [[ -z $1 ]]; then - echo "Please enter a username!" +#!/usr/bin/env sh + +usage () { + echo "Usage: $(basename "${0}") []" + echo "Plays a stream from twitch.tv in a local video player." exit 1 +} + +if [ -z "${1}" ]; then + usage fi -if [[ -z $2 ]]; then - resolution="best" -else - resolution="${2}" -fi +username="${1}" +resolution="${2:-"best"}" -streamlink "https://twitch.tv/${1}" "${resolution}" +streamlink "https://twitch.tv/${username}" "${resolution}" diff --git a/system/.local/bin/update-count b/system/.local/bin/update-count index f3dde94..69d11e3 100755 --- a/system/.local/bin/update-count +++ b/system/.local/bin/update-count @@ -1,3 +1,4 @@ -#!/usr/bin/env bash +#!/usr/bin/env sh + UPDATES=$(checkupdates | wc -l) echo "${UPDATES}" diff --git a/system/.local/bin/upgrade b/system/.local/bin/upgrade index e879762..2ef318b 100755 --- a/system/.local/bin/upgrade +++ b/system/.local/bin/upgrade @@ -1,17 +1,5 @@ -#!/usr/bin/env bash -# -# SCRIPT NAME: -# upgrade -# -# AUTHOR: -# Severin Kaderli -# -# DESCRIPTION: -# This script upgrades all pacman packages and globally installed -# npm packages. -# -# USAGE: -# ./upgrade +#!/usr/bin/env sh + . utils print_section "Updating system" diff --git a/system/.local/bin/utils b/system/.local/bin/utils index 2a1d94f..185d4bf 100755 --- a/system/.local/bin/utils +++ b/system/.local/bin/utils @@ -1,17 +1,5 @@ #!/usr/bin/env bash -# -# SCRIPT NAME: -# utils -# -# AUTHOR: -# Severin Kaderli -# -# DESCRIPTION: -# This script provides functions and variables that I use in my other scripts. -# It is not supposed to be run directly but to be sourced by other scripts. -# -# USAGE: -# Source this script in the needed script. + ####################################### # Directory variables ####################################### diff --git a/system/.local/bin/wallpaper b/system/.local/bin/wallpaper deleted file mode 100755 index 2f35377..0000000 --- a/system/.local/bin/wallpaper +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -# -# SCRIPT NAME: -# wallpaper -# -# AUTHOR: -# Severin Kaderli -# -# DESCRIPTION: -# Sets the wallpaper using feh -# -# USAGE: -# ./wallpaper -. /home/severin/.local/bin/utils - -HOST="$(hostname)" -feh --bg-fill --no-fehbg "${DOTFILES}/assets/wallpaper.${HOST}.jpg" \ No newline at end of file diff --git a/system/.local/bin/watch-file b/system/.local/bin/watch-file index 2f06c43..cd5982e 100755 --- a/system/.local/bin/watch-file +++ b/system/.local/bin/watch-file @@ -1,17 +1,5 @@ -#!/usr/bin/env bash -# -# SCRIPT NAME: -# watch-file -# -# AUTHOR: -# Severin Kaderli -# -# DESCRIPTION: -# This script watches a file for changes and if it changes it -# executes the given command. -# -# USAGE: -# ./watch-file FILE COMMAND... +#!/usr/bin/env sh + . utils # The file to watch @@ -27,4 +15,4 @@ while inotifywait -qq -e close_write "${FILE}"; do print_notify "${FILENAME} has changed" "Executing command" $COMMAND -done \ No newline at end of file +done