git-dude icon indicating copy to clipboard operation
git-dude copied to clipboard

Not displaying notifications.

Open vredesbyyrd opened this issue 6 years ago • 2 comments

Thanks much for sharing this awesome tool.

I am struggling to get it to display any notifications though. This is on gnome, so its using notify-send which works fine otherwise. I am calling this script at boot to start dude:

watchdir=$(git config dude.watchdir)

if [ -n $watchdir ]; then
    git dude $watchdir  
fi

The directory where I am keeping the repos I want monitored is ~/.git-watch, which i have defined in the .gitconfig

As far as I can tell everything seems to start and run fine, as you can see in the screenshot of the relevant processes.

rofi-2018-07-29-1257-00000

I am pretty much at a loss on what could be preventing the notifications from displaying. I am not using gdm or any display manager / screensaver. Is git-dude supposed to sleep if the screensaver is active and not fetch any info from git, if I am understanding correctly?

If you have any thoughts on what could be going wrong I would love to hear them.

vredesbyyrd avatar Jul 29 '18 21:07 vredesbyyrd

Investigating this further, it appears that git-dude is detecting that the screensaver is active when it should not be....i think

clu ~> bash -x /usr/bin/git-dude /home/clu/.git-watch/                                        10:47:25
+ set -e
++ git config dude.interval
+ interval=30
+ interval=30
++ basename /usr/bin/git-dude
+ app_name=git-dude
+ export LC_ALL=C
+ LC_ALL=C
++ git config dude.notify-command
+ [[ -n '' ]]
++ which notify-send
+ '[' /usr/bin/notify-send ']'
+ notify_cmd='notify-send -i "$ICON_PATH" "$TITLE" "$DESCRIPTION"'
++ git config dude.screensaver-command
+ [[ -n '' ]]
++ which gnome-screensaver-command
+ '[' ']'
+ [[ -d /home/clu/.git-watch/ ]]
+ cd /home/clu/.git-watch/
+ true
+ screensaver
+ '[' -n '' ']'
+ return 0
+ '[' 30 = 0 ']'
+ sleep 30
+ true
+ screensaver
+ '[' -n '' ']'
+ return 0
+ '[' 30 = 0 ']'
+ sleep 30
+ true
+ screensaver
+ '[' -n '' ']'
+ return 0
+ '[' 30 = 0 ']'
+ sleep 30
+ true
+ screensaver
+ '[' -n '' ']'
+ return 0
+ '[' 30 = 0 ']'
+ sleep 30
+ true
+ screensaver
+ '[' -n '' ']'
+ return 0
+ '[' 30 = 0 ']'
+ sleep 30

...

vredesbyyrd avatar Jul 30 '18 15:07 vredesbyyrd

Changing line 65 to:

return 1

Seemed to fix the issue. Something was going on with the screensaver logic.

vredesbyyrd avatar Jul 30 '18 16:07 vredesbyyrd