From 914b37cd262d074e7b47185a363913e96b742ae6 Mon Sep 17 00:00:00 2001
From: simonvic <simonvic.dev@gmail.com>
Date: Wed, 11 Nov 2020 14:22:02 +0100
Subject: [PATCH] Added commands abbreviations + changed sLockscreenctl options

---
 .config/i3/config         |  4 ++--
 .local/bin/sBatteryctl    | 14 ++++++++++----
 .local/bin/sBluetoothctl  |  5 ++++-
 .local/bin/sBrightnessctl | 21 ++++++++++++++-------
 .local/bin/sLockscreenctl | 30 ++++++++++++++++--------------
 .local/bin/sMicrophonectl | 11 ++++++++---
 .local/bin/sPlayerctl     | 17 ++++++++++++-----
 .local/bin/sPolybarctl    | 23 ++++++++++++++++-------
 .local/bin/sVolumectl     | 11 ++++++++---
 README.md                 |  2 +-
 10 files changed, 91 insertions(+), 47 deletions(-)

diff --git a/.config/i3/config b/.config/i3/config
index 2a4a273..1aa5c57 100644
--- a/.config/i3/config
+++ b/.config/i3/config
@@ -25,7 +25,7 @@ exec numlockx
 
 # Lockscreen
 exec xset s 600 300 
-exec xss-lock -n "sBrightnessctl screensaver" -l -- sLockscreenctl --suspend
+exec xss-lock -n "sBrightnessctl screensaver" -l -- sLockscreenctl suspend
 
 # Restore redshift state
 exec $HOME/.config/i3/scripts/restoreRedshift.sh
@@ -84,7 +84,7 @@ bindsym $mod+Ctrl+Shift+p exec sPolybarctl hide
 
 
 # === Lock the screen
-bindsym $mod+l exec sLockscreenctl --lock
+bindsym $mod+l exec sLockscreenctl lock
 
 # Adjust volume 
 # -Ctrl is used to control the microphone
diff --git a/.local/bin/sBatteryctl b/.local/bin/sBatteryctl
index 9271135..7a888d3 100755
--- a/.local/bin/sBatteryctl
+++ b/.local/bin/sBatteryctl
@@ -188,13 +188,19 @@ function printUsage() {
 	plugin 	Show notification about plugging AC
 	unplug 	Show notification about unplugging AC
 	current 	Show current information on the battery
+	
+- Abbreviations
+	m = monitor
+	p = plugin
+	u = unplug
+	c = current
 "
 }
 
 case $1 in
-	monitor) monitor ;;
-	plugin) plugin ;;
-	unplug) unplug ;;
-	current) current ;;
+	monitor | m) monitor ;;
+	plugin | p) plugin ;;
+	unplug | u) unplug ;;
+	current | c) current ;;
 	help | *) printUsage ;;
 esac
diff --git a/.local/bin/sBluetoothctl b/.local/bin/sBluetoothctl
index 356d287..eb4751f 100755
--- a/.local/bin/sBluetoothctl
+++ b/.local/bin/sBluetoothctl
@@ -54,12 +54,15 @@ function printUsage() {
 	help 	Show this help
 	print 	Print the current status label
 	power <toggle|on|off> 	Switch on or off the bluetooth, or toggle between the states
+
+- Abbreviations
+	p = power
 "
 }
 
 case $1 in
     print)	printStatus ;;
-  	power)	power $2 && updatePolybar ;;
+  	power | p)	power $2 && updatePolybar ;;
   	help | *)	printUsage ;;
 esac
 
diff --git a/.local/bin/sBrightnessctl b/.local/bin/sBrightnessctl
index 615008d..17757cf 100755
--- a/.local/bin/sBrightnessctl
+++ b/.local/bin/sBrightnessctl
@@ -215,21 +215,28 @@ function printUsage() {
 	redshift increase [amount] 	Increase the redshift temperature by [amount] if specified or the default value otherwise
 	redshift decrease [amount] 	Decrease the redshift temperature by [amount] if specified or the default value otherwise
 	redshift print 	Print the current redshift temperature (used in polybar)
+	
+- Abbreviations
+	i = increase
+	d = decrease
+	s = set	
+	r = redshift
+	t = toggle
 "
 }
 
 case $1 in
-    increase)
+    increase | i)
     	changeBrightness -inc $2
 			updatePolybar
 			sendNotification
 			;;
-    decrease)
+    decrease | d)
     	changeBrightness -dec $2
 			updatePolybar
 			sendNotification
 			;;
-		set)
+		set | s)
 			setBrightness "$2 -step $fade_fps -time $fade_time"
 			updatePolybar
 			sendNotification
@@ -241,14 +248,14 @@ case $1 in
 		print)
 			printBrightness $2
 			;;
-		redshift)
+		redshift | r)
 			case $2 in
-				toggle)
+				toggle | t)
 					toggleRedshift
 					updatePolybar
 					sendNotification
 				;;
-				increase)
+				increase | i)
 					if [ -z $3 ]; then
 						changeTemp $((REDSHIFT_TEMP+defaultTempChangeValue))
 					else
@@ -257,7 +264,7 @@ case $1 in
 					updatePolybar
 					sendNotification
 					;;
-				decrease)
+				decrease | d)
 					if [ -z $3 ]; then
 						changeTemp $((REDSHIFT_TEMP-defaultTempChangeValue))
 					else
diff --git a/.local/bin/sLockscreenctl b/.local/bin/sLockscreenctl
index 7be1dc1..abde039 100755
--- a/.local/bin/sLockscreenctl
+++ b/.local/bin/sLockscreenctl
@@ -131,27 +131,29 @@ function printUsage() {
 	sLockscreenctl <options>
 	
 - Options
-	--suspend 	Lock the screen and suspend
-	-s 	Equivalent to --suspend
-	--lock Lock the screen
-	-l Equivalent to --lock	
+	suspend 	Lock the screen and suspend
+	lock 	Lock the screen
+
+- Abbreviations
+	s = suspend
+	l = lock
 "
 }
 
 case "$1" in
-	-s | --suspend)
-		suspend=true
-		;&
-
-	-l | --lock)
-		lock=true
-		[[ $suspend ]] || extraArgs="$extraArgs -n"
-		;;
-	* | help) printUsage ;;
+	suspend | s)
+		isSuspend=true
+	;&
+
+	lock | l)
+		isLock=true
+		[[ $isSuspend ]] || extraArgs="$extraArgs -n"
+	;;
+	help | *) printUsage ;;
 esac
 
 # Activate lockscreen (and suspend if specified)
-[[ $lock ]] && lock && { [[ $suspend ]] && systemctl suspend; }
+[[ $isLock ]] && lock && { [[ $isSuspend ]] && systemctl suspend; }
 
 exit 0
 
diff --git a/.local/bin/sMicrophonectl b/.local/bin/sMicrophonectl
index abfd384..24e7b09 100755
--- a/.local/bin/sMicrophonectl
+++ b/.local/bin/sMicrophonectl
@@ -83,21 +83,26 @@ function printUsage() {
 	up [amount] 	Increase input volume by [amount] if specified or the default value otherwise
 	down [amount] 	Decrease input volume by [amount] if specified or the default value otherwise
 	mute 	Toggle mute on/off for the microphone
+
+- Abbreviations
+	u = up
+	d = down
+	m = mute	
 "
 }
 
 case $1 in
-	up)
+	up | u)
 		amixer sset Capture cap
 		amixer -D pulse sset Capture csvolume "$2"%+ > /dev/null
 		sendNotification
 	;;
-	down)
+	down | d)
 		amixer sset Capture cap
 		amixer -D pulse sset Capture csvolume "$2"%- > /dev/null
 		sendNotification
 	;;
-	mute)
+	mute | m)
 		amixer -D pulse sset Capture toggle > /dev/null
 		if isMute ; then
 			# Building the volume bar
diff --git a/.local/bin/sPlayerctl b/.local/bin/sPlayerctl
index 1dbfc0c..fadc815 100755
--- a/.local/bin/sPlayerctl
+++ b/.local/bin/sPlayerctl
@@ -127,6 +127,13 @@ function printUsage() {
 	next 	Go to the next song
 	previous 	Go to the previous song
 	info 	Print info of the playing song
+	
+- Abbreviations
+	pp = play-pause
+	s = stop
+	n = next
+	p = previous
+	i = info	
 "
 }
 
@@ -134,23 +141,23 @@ if [ -z $1 ] || [ $1 == "help" ]; then
 	printUsage
 elif [ "$(playerctl -l | head -n 1)" != "No players were found" ]; then
 	case $1 in
-		play-pause)
+		play-pause | pp)
 			playerctl -p "$player" play-pause
 			sendNotification
 		;;
-		stop)
+		stop | s)
 			playerctl -p "$player" stop
 			sendNotification
 		;;
-		next)
+		next | n)
 			playerctl -p "$player" next
 			sendNotification
 		;;
-		previous)
+		previous | p)
 			playerctl -p "$player" previous
 			sendNotification
 		;;
-		info)
+		info | i)
 			info
 		;;
 	esac
diff --git a/.local/bin/sPolybarctl b/.local/bin/sPolybarctl
index eaa23df..8b9b070 100755
--- a/.local/bin/sPolybarctl
+++ b/.local/bin/sPolybarctl
@@ -151,14 +151,23 @@ function printUsage() {
 [WIP]	autoHide <bar id>	Enable auto-hide for the specified bar. Move the cursor to [position] to show the bar
 [WIP]	drag <bar id>	Drag the polybar with the mouse
 [WIP]	resize <bar id>	Resize the polybar with the mouse
+
+- Abbreviations
+	l = launch
+	t = toggle
+	s = show 
+	h = hide
+	d = drag
+	r = resize
+	i = ipc
 "
 }
 
 case "$1" in
-	launch)
+	launch | l)
 		launch
 		;;
-	toggle)
+	toggle | t)
 		toggle $2
 		updateSwitches
 		;;
@@ -171,21 +180,21 @@ case "$1" in
 	autoHide)
 		autoHide $2
 		;;
-	show)
+	show | s)
 		show $2
 		updateSwitches
 		;;
-	hide)
+	hide | h)
 		hide $2
 		updateSwitches
 		;;
-	drag)
+	drag | d)
 		drag $2
 		;;
-	resize)
+	resize | r)
 		resize $2
 		;;
-	ipc)
+	ipc | i)
 		ipc $2 $3 $4 $5
 	;;
 	help | *)	printUsage ;;
diff --git a/.local/bin/sVolumectl b/.local/bin/sVolumectl
index 926107e..da01150 100755
--- a/.local/bin/sVolumectl
+++ b/.local/bin/sVolumectl
@@ -86,22 +86,27 @@ function printUsage() {
 	up [amount] 	Increase speaker/headphone volume by [amount] if specified or the default value otherwise
 	down [amount] 	Decrease speaker/headphone volume by [amount] if specified or the default value otherwise
 	mute 	Toggle mute on/off for the speaker/headphone
+	
+- Abbreviations
+	u = up
+	d = down
+	m = mute	
 "
 }
 
 case $1 in
-	up)
+	up | u)
 		# Set the volume on (if it was muted)
 		amixer -D pulse set Master on > /dev/null
 		amixer -D pulse sset Master "$2"%+ > /dev/null
 		sendNotification
 	;;
-	down)
+	down | d)
 		amixer -D pulse set Master on > /dev/null
 		amixer -D pulse sset Master "$2"%- > /dev/null
 		sendNotification
 	;;
-	mute)
+	mute | m)
  	# Toggle mute
 		amixer -D pulse set Master toggle > /dev/null
 		if isMute ; then
diff --git a/README.md b/README.md
index 8e5d64f..dd390cf 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,5 @@
 # simonvic personal full-keyboard driven rice/workflow 
-![version](https://img.shields.io/badge/version-2.0.0-red)
+![version](https://img.shields.io/badge/version-2.1.0-red)
 
 ## Getting started
 Make sure to visit the [Wiki](https://github.com/simonvic/dotfiles/wiki) to have a ful overview of what my workflow can offer