about summary refs log tree commit diff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xscripts/nsp-console.sh7
-rwxr-xr-xscripts/toggle-compton.sh7
-rwxr-xr-xscripts/toggle-redshift.sh9
-rwxr-xr-xscripts/toggle-touchpad.sh7
-rwxr-xr-xscripts/toggle-trackpoint.sh7
-rwxr-xr-xscripts/xmobar/fcitx.sh12
-rwxr-xr-xscripts/xshot-select-upload.sh6
-rwxr-xr-xscripts/xshot-upload.sh6
8 files changed, 27 insertions, 34 deletions
diff --git a/scripts/nsp-console.sh b/scripts/nsp-console.sh
index 510ecdb..4ac9e32 100755
--- a/scripts/nsp-console.sh
+++ b/scripts/nsp-console.sh
@@ -1,8 +1,7 @@
 #!/bin/sh
 
-if tmux list-sessions | grep "scratchpad"
-then
-    tmux attach-session -t "scratchpad"
+if tmux list-sessions | grep "scratchpad"; then
+	tmux attach-session -t "scratchpad"
 else
-    tmux new-session -s "scratchpad" -n "scratchpad" -c "$HOME"
+	tmux new-session -s "scratchpad" -n "scratchpad" -c "$HOME"
 fi
diff --git a/scripts/toggle-compton.sh b/scripts/toggle-compton.sh
index e5a3aaa..0fcb1bf 100755
--- a/scripts/toggle-compton.sh
+++ b/scripts/toggle-compton.sh
@@ -1,8 +1,7 @@
 #!/bin/sh
 
-if ! pgrep compton > /dev/null 2>&1
-then
-    compton -b
+if ! pgrep compton >/dev/null 2>&1; then
+	compton -b
 else
-    pkill compton
+	pkill compton
 fi
diff --git a/scripts/toggle-redshift.sh b/scripts/toggle-redshift.sh
index 2813aea..2af8258 100755
--- a/scripts/toggle-redshift.sh
+++ b/scripts/toggle-redshift.sh
@@ -1,9 +1,8 @@
 #!/usr/bin/env bash
 
-if ! pgrep redshift > /dev/null 2>&1
-then
-    redshift &
-    disown redshift
+if ! pgrep redshift >/dev/null 2>&1; then
+	redshift &
+	disown redshift
 else
-    pkill redshift
+	pkill redshift
 fi
diff --git a/scripts/toggle-touchpad.sh b/scripts/toggle-touchpad.sh
index 449bd5b..2a1c061 100755
--- a/scripts/toggle-touchpad.sh
+++ b/scripts/toggle-touchpad.sh
@@ -3,9 +3,8 @@
 ID=$(xinput list | grep -Eo 'TouchPad\s*id\=[0-9]{1,2}' | grep -Eo '[0-9]{1,2}')
 STATE=$(xinput list-props "$ID" | awk '/Device Enabled/ {print $4}')
 
-if [ "$STATE" = 1 ]
-then
-    xinput disable "$ID"
+if [ "$STATE" = 1 ]; then
+	xinput disable "$ID"
 else
-    xinput enable "$ID"
+	xinput enable "$ID"
 fi
diff --git a/scripts/toggle-trackpoint.sh b/scripts/toggle-trackpoint.sh
index 1429dcf..d385553 100755
--- a/scripts/toggle-trackpoint.sh
+++ b/scripts/toggle-trackpoint.sh
@@ -3,9 +3,8 @@
 ID=$(xinput list | grep -Eo 'TrackPoint\s*id\=[0-9]{1,2}' | grep -Eo '[0-9]{1,2}')
 STATE=$(xinput list-props "$ID" | awk '/Device Enabled/ {print $4}')
 
-if [ "$STATE" = 1 ]
-then
-    xinput disable "$ID"
+if [ "$STATE" = 1 ]; then
+	xinput disable "$ID"
 else
-    xinput enable "$ID"
+	xinput enable "$ID"
 fi
diff --git a/scripts/xmobar/fcitx.sh b/scripts/xmobar/fcitx.sh
index 48eefa0..f159c41 100755
--- a/scripts/xmobar/fcitx.sh
+++ b/scripts/xmobar/fcitx.sh
@@ -2,14 +2,12 @@
 
 STATUS="$(fcitx-remote)"
 
-if [ "$STATUS" = 0 ]
-then
-    OUT="Off"
-elif [ "$STATUS" = 1 ]
-then
-    OUT="Disabled"
+if [ "$STATUS" = 0 ]; then
+	OUT="Off"
+elif [ "$STATUS" = 1 ]; then
+	OUT="Disabled"
 else
-    OUT="Enabled"
+	OUT="Enabled"
 fi
 
 echo "$OUT"
diff --git a/scripts/xshot-select-upload.sh b/scripts/xshot-select-upload.sh
index 040251e..70c08c4 100755
--- a/scripts/xshot-select-upload.sh
+++ b/scripts/xshot-select-upload.sh
@@ -2,6 +2,6 @@
 
 PIC="$HOME/pictures/screenshots/$(date +%Y-%m-%d_%H-%M-%S).png"
 
-maim --format=png --hidecursor --quality 8 --select "$PIC" && \
-    curl --form "file=@$PIC" "https://0x0.st" | \
-    xclip -quiet
+maim --format=png --hidecursor --quality 8 --select "$PIC" &&
+	curl --form "file=@$PIC" "https://0x0.st" |
+	xclip -quiet
diff --git a/scripts/xshot-upload.sh b/scripts/xshot-upload.sh
index ed037de..17b614a 100755
--- a/scripts/xshot-upload.sh
+++ b/scripts/xshot-upload.sh
@@ -2,6 +2,6 @@
 
 PIC="$HOME/pictures/screenshots/$(date +%Y-%m-%d_%H-%M-%S).png"
 
-maim --format=png --hidecursor --quality 8 "$PIC" && \
-    curl --form "file=@$PIC" "https://0x0.st" | \
-    xclip -quiet
+maim --format=png --hidecursor --quality 8 "$PIC" &&
+	curl --form "file=@$PIC" "https://0x0.st" |
+	xclip -quiet

Consider giving Nix/NixOS a try! <3