X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;ds=sidebyside;f=system-status;h=430f8061c1c6611eafea56f369211c46d8804f94;hb=HEAD;hp=2efb2dc3f485156f18e424b41c072e9d4c31266f;hpb=50f25d1eec109c4596cfc638c9a7c98da0f0b5d0;p=distro-setup diff --git a/system-status b/system-status index 2efb2dc..ae37d3b 100755 --- a/system-status +++ b/system-status @@ -358,8 +358,10 @@ write-status() { if grep -qxF $HOSTNAME $x; then all_dirs+=( ${x%.hosts} ); fi done + script_files=("${my_service_scripts[@]}" "${my_bin_files[@]}" $my_lib_files) + # Just because i forget a lot, -mmin -NUM means files modified <= NUM minutes ago - if (( fmin < 0 )) && [[ $(find ${all_my_scripts[@]} ${all_dirs[@]} -mmin $fmin -type f -print -quit 2>/dev/null) ]]; then + if (( fmin < 0 )) && [[ $(find "${script_files[@]}" ${all_dirs[@]} -mmin $fmin -type f -print -quit 2>/dev/null) ]]; then v conflink newer filesystem files chars+=(CONFLINK) break @@ -438,32 +440,30 @@ mute() { local locked export DISPLAY=:0 locked=false - if lock_info=$(xscreensaver-command -time); then + if lock_info=$(xscreensaver-command -time 2>/dev/null); then if [[ $lock_info != *non-blanked* ]]; then locked=true fi - else - locked=true - fi - midnight=$(date -d 00:00 +%s) - mdiff=$(( EPOCHSECONDS - midnight )) - if $locked && (( mdiff < 6 *60*60 || mdiff > 21 *60*60 )); then - case $(pactl get-sink-mute @DEFAULT_SINK@ | awk '{print $2}') in - no) - # for log purposes - echo muted - pactl set-sink-mute @DEFAULT_SINK@ true - ;; - esac - fi - if ! $locked && (( mdiff > 6 *60*60 || mdiff < 12 *60*60 )) && [[ ! -e /tmp/ianknap ]]; then - case $(pactl get-sink-mute @DEFAULT_SINK@ | awk '{print $2}') in - yes) - # for log purposes - echo unmuted - pactl set-sink-mute @DEFAULT_SINK@ false - ;; - esac + midnight=$(date -d 00:00 +%s) + mdiff=$(( EPOCHSECONDS - midnight )) + if $locked && (( mdiff < 6 *60*60 || mdiff > 21 *60*60 )); then + case $(pactl get-sink-mute @DEFAULT_SINK@ | awk '{print $2}') in + no) + # for log purposes + echo muted + pactl set-sink-mute @DEFAULT_SINK@ true + ;; + esac + fi + if ! $locked && (( mdiff > 6 *60*60 || mdiff < 12 *60*60 )) && [[ ! -e /tmp/ianknap ]]; then + case $(pactl get-sink-mute @DEFAULT_SINK@ | awk '{print $2}') in + yes) + # for log purposes + echo unmuted + pactl set-sink-mute @DEFAULT_SINK@ false + ;; + esac + fi fi }