vdotfiles

Cem's Dotfiles for Void Linux
git clone git://git.ckyln.com/vdotfiles.git
Log | Files | Refs | Submodules | README | LICENSE

commit a61e3d348ac5b79b5edd2c970e7037e472a55f5e
parent c9bf1b202db98218496314af5ed7bbac6640a1d8
Author: Cem Keylan <warc1998@gmail.com>
Date:   Fri, 24 May 2019 21:23:27 +0300

Much POSIX So Compliant

Diffstat:
Mbin/nightmodetoggle | 38+++++++++++++++++++++-----------------
Mbin/todo | 4++--
2 files changed, 23 insertions(+), 19 deletions(-)

diff --git a/bin/nightmodetoggle b/bin/nightmodetoggle @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh if [ -e $HOME/.night ] then @@ -28,36 +28,40 @@ then else if [ `date +%H%M` -gt "1859" ] || [ `date +%H%M` -lt "0600" ] then - echo $'CLICK=0\nNIGHT=1' > $HOME/.night + printf "CLICK=0\nNIGHT=1" > $HOME/.night else - echo $'CLICK=0\nNIGHT=0' > $HOME/.night + printf "CLICK=0\nNIGHT=0" > $HOME/.night fi fi ;; *) - echo $'Please enter an argument!\ne.g.\nclick\ndisable\ncron' + printf "Please enter an argument!\ne.g.\nclick\ndisable\ncron\n" exit ;; esac if [ $(tail -n -1 $HOME/.night) = "NIGHT=1" ] then feh --bg-fill --randomize $HOME/Pictures/Wallpapers/Night/* - if [[ $(ps aux | grep -i polybar) == *night* ]] - then - exit - else - $HOME/bin/polyrestart night - fi + case $(ps aux | grep -i polybar) in + *night*) + exit + ;; + *) + $HOME/bin/polyrestart night + ;; + esac else feh --bg-fill --randomize $HOME/Pictures/Wallpapers/Morning/* - if [[ $(ps aux | grep -i polybar | head -n +1 -) == *"polybar -q top" ]] - then - exit - else - $HOME/bin/polyrestart morning - fi + case $(ps aux | grep -i polybar | head -n +1 -) in + *"polybar -q top") + exit + ;; + *) + $HOME/bin/polyrestart morning + ;; + esac fi else touch $HOME/.night - echo $'CLICK=0\nNIGHT=0' > $HOME/.night + printf "CLICK=0\nNIGHT=0" > $HOME/.night fi diff --git a/bin/todo b/bin/todo @@ -1,6 +1,6 @@ -#!/bin/bash +#!/bin/sh -if [[ $(cat $HOME/todo.txt) == "" ]] +if [ -s $HOME/todo.txt ] then echo "Nothing to do!" else