addet scripts
This commit is contained in:
parent
55101b6ba2
commit
9b3171425d
16 changed files with 25 additions and 9 deletions
44
scripts/redshift.sh
Executable file
44
scripts/redshift.sh
Executable file
|
@ -0,0 +1,44 @@
|
|||
#!/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
|
||||
}
|
||||
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