initial commit
This commit is contained in:
parent
c6326a45e6
commit
cebf404919
15 changed files with 757 additions and 0 deletions
31
.scripts/redshift.sh
Executable file
31
.scripts/redshift.sh
Executable file
|
@ -0,0 +1,31 @@
|
|||
#!/bin/bash --norc
|
||||
|
||||
# Check if the given command exists silently
|
||||
command_exists() {
|
||||
command -v "$@" >/dev/null 2>&1
|
||||
}
|
||||
|
||||
_rdshft() {
|
||||
# color temperature for redshift
|
||||
local temp="5200"
|
||||
|
||||
if command_exists redshift; then
|
||||
pkill redshift redshift
|
||||
sleep 1
|
||||
pkill redshift redshift-gtk &&
|
||||
redshift -P -O "$temp"
|
||||
# redshift -P -O "$temp"
|
||||
|
||||
# Check if redshift is running
|
||||
sleep 2
|
||||
if ! pgrep -x redshift-gtk >/dev/null && ! pgrep -x redshift >/dev/null; then
|
||||
notify-send -u critical "ERROR" "Redshift failed to start. Please check your configuration."
|
||||
else
|
||||
notify-send -u normal "INFO" "Redshift started successfully."
|
||||
fi
|
||||
else
|
||||
notify-send -u critical "ERROR" "Redshift is not installed. Please install it for better screen color management."
|
||||
fi
|
||||
}
|
||||
|
||||
_rdshft
|
Loading…
Add table
Add a link
Reference in a new issue