Skip to content

Commit

Permalink
Added commands abbreviations + changed sLockscreenctl options
Browse files Browse the repository at this point in the history
  • Loading branch information
simonvic committed Nov 11, 2020
1 parent 25ffada commit 914b37c
Show file tree
Hide file tree
Showing 10 changed files with 91 additions and 47 deletions.
4 changes: 2 additions & 2 deletions .config/i3/config
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
14 changes: 10 additions & 4 deletions .local/bin/sBatteryctl
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 4 additions & 1 deletion .local/bin/sBluetoothctl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
21 changes: 14 additions & 7 deletions .local/bin/sBrightnessctl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -257,7 +264,7 @@ case $1 in
updatePolybar
sendNotification
;;
decrease)
decrease | d)
if [ -z $3 ]; then
changeTemp $((REDSHIFT_TEMP-defaultTempChangeValue))
else
Expand Down
30 changes: 16 additions & 14 deletions .local/bin/sLockscreenctl
Original file line number Diff line number Diff line change
Expand Up @@ -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

11 changes: 8 additions & 3 deletions .local/bin/sMicrophonectl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 12 additions & 5 deletions .local/bin/sPlayerctl
Original file line number Diff line number Diff line change
Expand Up @@ -127,30 +127,37 @@ 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
"
}

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
Expand Down
23 changes: 16 additions & 7 deletions .local/bin/sPolybarctl
Original file line number Diff line number Diff line change
Expand Up @@ -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
;;
Expand All @@ -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 ;;
Expand Down
11 changes: 8 additions & 3 deletions .local/bin/sVolumectl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 914b37c

Please sign in to comment.