aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorInigoGutierrez <inigogf.95@gmail.com>2019-04-09 16:26:46 +0200
committerInigoGutierrez <inigogf.95@gmail.com>2019-04-09 16:28:27 +0200
commit6e1ce4f87831d3761a46497f80e56ac7a73e14c8 (patch)
tree1ce2f613f63e9d0a8b3443ef70feb81d6ad1f583
parent8da9dfb0098bf119b278e043f93a56c629013b26 (diff)
downloadscripts-6e1ce4f87831d3761a46497f80e56ac7a73e14c8.tar.gz
scripts-6e1ce4f87831d3761a46497f80e56ac7a73e14c8.zip
Minor changes.
-rwxr-xr-xbgSelector.sh2
-rwxr-xr-xbrightFirst.sh2
-rwxr-xr-xclipboardUtils.sh2
-rwxr-xr-xdmenuMount.sh8
-rwxr-xr-xdmenuTerm.sh2
-rwxr-xr-xdmenuUmount.sh12
-rwxr-xr-xfloats/floatMonths.sh2
-rwxr-xr-xi3blocks/i3battery.sh2
-rwxr-xr-xmusicMode.sh6
-rwxr-xr-xshowColors.sh2
-rwxr-xr-xsystemControl.sh4
11 files changed, 22 insertions, 22 deletions
diff --git a/bgSelector.sh b/bgSelector.sh
index 541a96b..f69cd0f 100755
--- a/bgSelector.sh
+++ b/bgSelector.sh
@@ -1,5 +1,5 @@
#!/bin/bash
-if [ $(date +%H) -gt 18 ]
+if [ "$(date +%H)" -gt 18 ]
then
feh --bg-scale ~/images/wallpapers/night*
else
diff --git a/brightFirst.sh b/brightFirst.sh
index 5dd2540..acbf721 100755
--- a/brightFirst.sh
+++ b/brightFirst.sh
@@ -1,2 +1,2 @@
-#!/bin/bash
+#!/bin/sh
sudo chmod 666 /sys/class/backlight/intel_backlight/brightness
diff --git a/clipboardUtils.sh b/clipboardUtils.sh
index 8504ef8..fadb3e7 100755
--- a/clipboardUtils.sh
+++ b/clipboardUtils.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
# Manipulate the X selection
# Dependencies: dmenu, xsel
diff --git a/dmenuMount.sh b/dmenuMount.sh
index edbf4d7..f453078 100755
--- a/dmenuMount.sh
+++ b/dmenuMount.sh
@@ -33,7 +33,7 @@ do
done <<< "$(lsblk -lp | grep "part $" )"
[[ "$mountable" = "" ]] && exit 1
lines=$(echo "$mountable" | wc -l)
-chosen=$(echo "$mountable" | dmenu -i -l $lines -p "Mount which drive?" | awk '{print $2}')
+chosen=$(echo "$mountable" | dmenu -i -l "$lines" -p "Mount which drive?" | awk '{print $2}')
[ "$chosen" == "" ] && exit 1
sudo mount "$chosen" && pgrep -x dunst && notify-send "$chosen mounted." && exit 0
@@ -44,11 +44,11 @@ while read -r line
do
i=$((i+1))
directories="$directories$i. $line"$'\n'
-done <<< "$(find /mnt $HOME/mounts -type d -maxdepth 3 -empty 2>/dev/null)"
+done <<< "$(find /mnt "$HOME/mounts" -type d -maxdepth 3 -empty 2>/dev/null)"
lines=$(echo "$directories" | wc -l)
-mountpoint=$(echo "$directories" | dmenu -i -l $lines -p "Type in mount point." | awk '{print $2}')
+mountpoint=$(echo "$directories" | dmenu -i -l "$lines" -p "Type in mount point." | awk '{print $2}')
[ "$mountpoint" == "" ] && exit 1
if [[ ! -d "$mountpoint" ]]; then
prompt.sh "$mountpoint does not exist. Create it?" "sudo mkdir -p $mountpoint"
fi
-sudo mount $chosen $mountpoint && pgrep -x dunst && notify-send "$chosen mounted to $mountpoint."
+sudo mount "$chosen" "$mountpoint" && pgrep -x dunst && notify-send "$chosen mounted to $mountpoint."
diff --git a/dmenuTerm.sh b/dmenuTerm.sh
index a959673..57c3634 100755
--- a/dmenuTerm.sh
+++ b/dmenuTerm.sh
@@ -8,7 +8,7 @@ chosen=$(echo -e "$options" | dmenu -i -p "~$ urxvt -e")
case "$chosen" in
# floating windows
neofetch) urxvt -title invisible -sh 100 -cr "#aaddff" -geometry "80x21+50+35" -e ~/scripts/neofetch.sh ;;
- showColors) urxvt -title floating -sh 10 -cr black -geometry 43x9 -e ~/scripts/showColors.sh ;;
+ showColors) urxvt -title floating -sh 10 -cr black -geometry 44x9 -e ~/scripts/showColors.sh ;;
years) ~/scripts/floats/floatYears.sh ;;
months) ~/scripts/floats/floatMonths.sh ;;
weather) urxvt -title floating -sh 10 -geometry 125x40 -e weather.sh ;;
diff --git a/dmenuUmount.sh b/dmenuUmount.sh
index 7c19019..d2c8fb3 100755
--- a/dmenuUmount.sh
+++ b/dmenuUmount.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
# _
# __| |_ __ ___ ___ _ __ _ _
# / _` | '_ ` _ \ / _ \ '_ \| | | |
@@ -15,7 +15,7 @@
exclusionregex="\(/boot/efi\|/home\|/\)$"
list="$(lsblk -lp | grep "part /" | grep -v "$exclusionregex")"
-[ "$list" == "" ] && notify-send -t 2000 "No devices found to unmount." && exit 0
+[ "$list" = "" ] && notify-send -t 2000 "No devices found to unmount." && exit 0
drives=""
i=0
while read -r line
@@ -28,8 +28,8 @@ do
fstype="$(lsblk -lpo "name,fstype" | grep "$name" | awk '{print $2}')"
drives="$drives$i. $name ($size) \"$label\" [$fstype] on $mountpoint"$'\n'
done <<< "$list"
-[ "$drives" == "" ] && exit
+[ "$drives" = "" ] && exit
lines=$(echo "$drives" | wc -l)
-chosen=$(echo "$drives" | dmenu -i -l $lines -p "Unmount which drive?" | awk '{print $2}')
-[ "$chosen" == "" ] && exit
-sudo umount $chosen && pgrep -x dunst && notify-send "$chosen unmounted."
+chosen=$(echo "$drives" | dmenu -i -l "$lines" -p "Unmount which drive?" | awk '{print $2}')
+[ "$chosen" = "" ] && exit
+sudo umount "$chosen" && pgrep -x dunst && notify-send "$chosen unmounted."
diff --git a/floats/floatMonths.sh b/floats/floatMonths.sh
index 94a6f13..9ea274c 100755
--- a/floats/floatMonths.sh
+++ b/floats/floatMonths.sh
@@ -1,3 +1,3 @@
#!/bin/sh
- urxvt -title floating -sh 20 -cr black -geometry 22x9 -e ~/scripts/months.sh
+ urxvt -title floating -sh 20 -cr black -geometry 20x9 -e ~/scripts/months.sh
diff --git a/i3blocks/i3battery.sh b/i3blocks/i3battery.sh
index 1e8d749..d6acda6 100755
--- a/i3blocks/i3battery.sh
+++ b/i3blocks/i3battery.sh
@@ -20,7 +20,7 @@ elif [ "$capacity" -ge 60 ]; then
color="#ebdbb2"
elif [ "$capacity" -ge 40 ]; then
color="#fabd2f"
-elif [ "$capacity" -ge 20 ]; then
+elif [ "$capacity" -ge 10 ]; then
color="#fe8019"
else
color="#fb4934"
diff --git a/musicMode.sh b/musicMode.sh
index 14b97ba..15e0632 100755
--- a/musicMode.sh
+++ b/musicMode.sh
@@ -11,7 +11,7 @@ i3-msg "exec urxvt -title 'noborder' -sh 100 -fn xft:monospace:size=4 -e vis -c
# Loop checking current song and setting background
file=""
-while [ true ]
+while true
do
# Check if current file has changed
if [ "$file" != "$(cmus-remote -Q | grep "^file" | cut -d' ' -f2-)" ]; then
@@ -21,10 +21,10 @@ do
# Get title. It is only used for video search.
title="$(cmus-remote -Q | grep "^tag title " | cut -d' ' -f3-)"
[ -z "$title" ] && title="$(basename "$(cmus-remote -Q | grep "^file" | cut -d' ' -f2- | cut -d'.' -f1 )")"
- dunstify -r $(dunstifyIDs.sh musicMode) -t 0 "$(~/scripts/i3blocks/i3music.sh)"
+ dunstify -r "$(dunstifyIDs.sh musicMode)" -t 0 "$(~/scripts/i3blocks/i3music.sh)"
ffmpeg -i "$file" "$coverPath" >/dev/null
feh --no-fehbg --bg-max "$coverPath" >/dev/null #|| feh --no-fehbg --bg-max $HOME/images/wallpapers/bg_* >/dev/null
- videoFile="$(ls -d $HOME/videos/music/* | grep "$title")"
+ videoFile="$(find "$HOME/videos/music" | grep "$title")"
if [ "$videoFile" ]; then # videoclip found
cmus-remote -u
mpv --fs "$videoFile"
diff --git a/showColors.sh b/showColors.sh
index 93d4a24..d879e51 100755
--- a/showColors.sh
+++ b/showColors.sh
@@ -5,7 +5,7 @@ echo -e "\033[0;31mRed (0;31) \033[1;31mLight Red (1;31)"
echo -e "\033[0;32mGreen (0;32) \033[1;32mLight Green (1;32)"
echo -e "\033[0;33mOrange (0;33) \033[1;33mLight Orange (1;33)"
echo -e "\033[0;34mBlue (0;34) \033[1;34mLight Blue (1;34)"
-echo -e "\033[0;35mPurple (0;35) \033[1;35mLight Purple (1;35)"
+echo -e "\033[0;35mMagenta (0;35) \033[1;35mLight Magenta (1;35)"
echo -e "\033[0;36mCyan (0;36) \033[1;36mLight Cyan (1;36)"
echo -e "\033[0;37mWhite (0;37) \033[1;37mLight White (1;37)"
diff --git a/systemControl.sh b/systemControl.sh
index b7ba5ee..4654e98 100755
--- a/systemControl.sh
+++ b/systemControl.sh
@@ -1,12 +1,12 @@
#!/bin/bash
# A dmenu prompt script to control system functions.
-options="lock\nreboot\nshutdown\nexit i3"
+options="lock\nreboot\nshutdown\nexit i3"
chosen=$(echo -e "$options" | dmenu -p ">_")
case "$chosen" in
- lock) i3lock -i ~/images/wallpapers/lockbg.png -f ;;
+ lock) i3lock.sh ;;
reboot) ~/scripts/prompt.sh Reboot? reboot ;;
shutdown) ~/scripts/prompt.sh Shutdown? "shutdown now" ;;
"exit i3") ~/scripts/prompt.sh "Exit i3? (ends X session)" "i3-msg exit" ;;