1
0
Fork 0
mirror of https://github.com/SinTan1729/random.git synced 2024-12-26 21:18:36 -06:00

avoid concurrent processes

This commit is contained in:
Sayantan Santra 2022-08-01 21:43:35 -05:00
parent 6465b5e9a6
commit 19503ef85e

View file

@ -19,7 +19,10 @@
# it might also be a good idea to add '<location-of-this-script> scheduler' to your DE's autostart list, or to '.profile' so that it launches on system login # it might also be a good idea to add '<location-of-this-script> scheduler' to your DE's autostart list, or to '.profile' so that it launches on system login
# (sometimes I forget to turn on the monitor when I start my PC, so this is better than having a crontab) # (sometimes I forget to turn on the monitor when I start my PC, so this is better than having a crontab)
# location of the config file # avoid running two concurrent processes
[ "${BRTNESSLOCKER}" != "running" ] && exec env BRTNESSLOCKER="running" flock -en "/tmp/brightness-by-daylight" "$0" "$@" || :
# set location of the config file
[ -z "$XDG_CONFIG_HOME" ] && confdir="/home/sintan/.config" || confdir="$XDG_CONFIG_HOME" [ -z "$XDG_CONFIG_HOME" ] && confdir="/home/sintan/.config" || confdir="$XDG_CONFIG_HOME"
# read from the config file # read from the config file