about summary refs log tree commit diff
path: root/scripts
diff options
context:
space:
mode:
authorAzat Bahawi <azahi@teknik.io>2019-12-02 18:03:13 +0300
committerAzat Bahawi <azahi@teknik.io>2019-12-02 18:03:13 +0300
commit29a3bfae91ff4843a9ea2cab5b8cd18393fbdbf4 (patch)
treecc977d45768cd4403b89182bbe26303037a55d41 /scripts
parentfix build script error and update stack (diff)
Refactor scripts
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/nsp-console.sh2
-rwxr-xr-xscripts/screenlock.sh7
-rwxr-xr-xscripts/toggle-compton.sh4
-rwxr-xr-xscripts/toggle-redshift.sh2
-rwxr-xr-xscripts/toggle-touchpad.sh2
-rwxr-xr-xscripts/toggle-trackpoint.sh2
-rwxr-xr-xscripts/xmobar/fcitx.sh2
-rwxr-xr-xscripts/xshot-select-upload.sh6
-rwxr-xr-xscripts/xshot-select.sh4
-rwxr-xr-xscripts/xshot-upload.sh6
-rwxr-xr-xscripts/xshot.sh4
11 files changed, 17 insertions, 24 deletions
diff --git a/scripts/nsp-console.sh b/scripts/nsp-console.sh
index 8923ea2..b83d526 100755
--- a/scripts/nsp-console.sh
+++ b/scripts/nsp-console.sh
@@ -4,5 +4,5 @@ if tmux list-sessions | grep -q "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/screenlock.sh b/scripts/screenlock.sh
deleted file mode 100755
index fda4556..0000000
--- a/scripts/screenlock.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/sh
-
-i3lock \
-    --no-unlock-indicator \
-    --image "${HOME}/pictures/wallpapers/mill-lock.png" \
-    --pointer default \
-    --ignore-empty-password
diff --git a/scripts/toggle-compton.sh b/scripts/toggle-compton.sh
index ee3c880..7c36b2f 100755
--- a/scripts/toggle-compton.sh
+++ b/scripts/toggle-compton.sh
@@ -1,8 +1,8 @@
-#!/usr/bin/env bash
+#!/bin/sh
 
 if ! pgrep compton
 then
-    compton -b --config "${XDG_CONFIG_HOME}/compton.conf"
+    compton -b --config "$XDG_CONFIG_HOME/compton.conf"
 else
     pkill compton
 fi
diff --git a/scripts/toggle-redshift.sh b/scripts/toggle-redshift.sh
index 4dbcc38..bd70f60 100755
--- a/scripts/toggle-redshift.sh
+++ b/scripts/toggle-redshift.sh
@@ -2,7 +2,7 @@
 
 if ! pgrep redshift
 then
-    redshift -c "${XDG_CONFIG_HOME}/redshift.conf" &
+    redshift -c "$XDG_CONFIG_HOME/redshift.conf" &
     disown redshift
 else
     pkill redshift
diff --git a/scripts/toggle-touchpad.sh b/scripts/toggle-touchpad.sh
index 7a82391..449bd5b 100755
--- a/scripts/toggle-touchpad.sh
+++ b/scripts/toggle-touchpad.sh
@@ -3,7 +3,7 @@
 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" -eq 1 ]
+if [ "$STATE" = 1 ]
 then
     xinput disable "$ID"
 else
diff --git a/scripts/toggle-trackpoint.sh b/scripts/toggle-trackpoint.sh
index 2d54670..1429dcf 100755
--- a/scripts/toggle-trackpoint.sh
+++ b/scripts/toggle-trackpoint.sh
@@ -3,7 +3,7 @@
 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" -eq 1 ]
+if [ "$STATE" = 1 ]
 then
     xinput disable "$ID"
 else
diff --git a/scripts/xmobar/fcitx.sh b/scripts/xmobar/fcitx.sh
index 5538f50..48eefa0 100755
--- a/scripts/xmobar/fcitx.sh
+++ b/scripts/xmobar/fcitx.sh
@@ -2,7 +2,7 @@
 
 STATUS="$(fcitx-remote)"
 
-if   [ "$STATUS" = 0 ]
+if [ "$STATUS" = 0 ]
 then
     OUT="Off"
 elif [ "$STATUS" = 1 ]
diff --git a/scripts/xshot-select-upload.sh b/scripts/xshot-select-upload.sh
index 777eb87..040251e 100755
--- a/scripts/xshot-select-upload.sh
+++ b/scripts/xshot-select-upload.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 
-PIC="${HOME}/pictures/screenshots/$(date +%Y-%m-%d_%H-%M-%S).png"
+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" | \
+maim --format=png --hidecursor --quality 8 --select "$PIC" && \
+    curl --form "file=@$PIC" "https://0x0.st" | \
     xclip -quiet
diff --git a/scripts/xshot-select.sh b/scripts/xshot-select.sh
index fc714c8..a0913a5 100755
--- a/scripts/xshot-select.sh
+++ b/scripts/xshot-select.sh
@@ -1,5 +1,5 @@
 #!/bin/sh
 
-PIC="${HOME}/pictures/screenshots/$(date +%Y-%m-%d_%H-%M-%S).png"
+PIC="$HOME/pictures/screenshots/$(date +%Y-%m-%d_%H-%M-%S).png"
 
-maim --format=png --hidecursor --quality 8 --select "${PIC}"
+maim --format=png --hidecursor --quality 8 --select "$PIC"
diff --git a/scripts/xshot-upload.sh b/scripts/xshot-upload.sh
index 0dcd1ec..ed037de 100755
--- a/scripts/xshot-upload.sh
+++ b/scripts/xshot-upload.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 
-PIC="${HOME}/pictures/screenshots/$(date +%Y-%m-%d_%H-%M-%S).png"
+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" | \
+maim --format=png --hidecursor --quality 8 "$PIC" && \
+    curl --form "file=@$PIC" "https://0x0.st" | \
     xclip -quiet
diff --git a/scripts/xshot.sh b/scripts/xshot.sh
index 0fbe40e..046315d 100755
--- a/scripts/xshot.sh
+++ b/scripts/xshot.sh
@@ -1,5 +1,5 @@
 #!/bin/sh
 
-PIC="${HOME}/pictures/screenshots/$(date +%Y-%m-%d_%H-%M-%S).png"
+PIC="$HOME/pictures/screenshots/$(date +%Y-%m-%d_%H-%M-%S).png"
 
-maim --format=png --hidecursor --quality 8 "${PIC}"
+maim --format=png --hidecursor --quality 8 "$PIC"

Consider giving Nix/NixOS a try! <3