From 13964faa53b09924bdd27328311ba27457b0b61d Mon Sep 17 00:00:00 2001 From: Azat Bahawi Date: Wed, 16 Feb 2022 02:15:52 +0300 Subject: I hate the Antichrist --- scripts/nsp-console.sh | 7 +++---- scripts/toggle-compton.sh | 7 +++---- scripts/toggle-redshift.sh | 9 ++++----- scripts/toggle-touchpad.sh | 7 +++---- scripts/toggle-trackpoint.sh | 7 +++---- scripts/xmobar/fcitx.sh | 12 +++++------- scripts/xshot-select-upload.sh | 6 +++--- scripts/xshot-upload.sh | 6 +++--- 8 files changed, 27 insertions(+), 34 deletions(-) (limited to 'scripts') 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 -- cgit 1.4.1