From afb38610f1f555b69c69203a504c4416e6d72e7d Mon Sep 17 00:00:00 2001 From: AngeD Date: Mon, 15 Nov 2021 16:16:12 +0100 Subject: [PATCH] feat: removed toggle touchpad script. fix: bad root checks. style: replaced single quotes with double --- bin/epitest | 4 ++-- bin/toggle_touchpad | 7 ------- bin/virt-manager-launcher | 4 ++-- 3 files changed, 4 insertions(+), 11 deletions(-) delete mode 100755 bin/toggle_touchpad diff --git a/bin/epitest b/bin/epitest index 154af60..e28648b 100755 --- a/bin/epitest +++ b/bin/epitest @@ -1,7 +1,7 @@ #!/usr/bin/bash -if [ "$EUID" != '0' ]; then - echo 'error: you cannot perform this operation unless you are root.' +if [ "$EUID" -ne 0 ]; then + echo "error: you cannot perform this operation unless you are root." exit 1 fi diff --git a/bin/toggle_touchpad b/bin/toggle_touchpad deleted file mode 100755 index 6236039..0000000 --- a/bin/toggle_touchpad +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/bash - -DEV="Elan Touchpad" - -ON=$(xinput list-props "$DEV" | awk -F ':' '$1 ~ "Device Enabled" {print $2}') - -xinput set-prop "$DEV" "Device Enabled" "$((1-ON))" diff --git a/bin/virt-manager-launcher b/bin/virt-manager-launcher index 1b52bb8..8f5518f 100755 --- a/bin/virt-manager-launcher +++ b/bin/virt-manager-launcher @@ -2,8 +2,8 @@ set -e -if [ "$EUID" == 0 ]; then - echo 'error: cannot be root.' +if [ "$EUID" -eq 0 ]; then + echo "error: cannot be root." exit 1 fi