restarting program after computer awakens

1

When my computer comes back from slumber, my program, cairo-dock, looks terrible. I don't know why the icons on it look like a bunch of noise, but I can't fix the problem. The best way I know how to is to restart the program.

I have tried automating this. I have placed a script in the /lib/systemd/system-sleep directory to stop the current running version of cairo-dock and restart it under my user account. The problem I have encountered is that cairo-dock doesn't start. I'm not entirely certain, but the script may be firing off before the X server is running.

FWIW, here's the script:

#!/bin/sh
set -e

case $1 in
  post)
   logger "Now killing cairo-dock."
   killall cairo-dock
   logger "Now starting cairo-dock."
   sudo -u user cairo-dock &
  ;;
esac

Another reason for why it's not starting up is that I may not be able to start programs on my account with sudo and systemd.

Ertain

Posted 2017-07-30T04:52:57.333

Reputation: 80

Answers

0

This is a known problem : Icons are corrupted after waking up from sleep mode.

The help says :

There is a bug with some icons when resuming from suspend/hibernation but only when using nVidia proprietary drivers.

This bug has already been reported a few years ago but feel free to add new comments there: http://www.nvnews.net/vbulletin/showthread.php?p=2289131 (and/or report this bug to nVidia devs again ).

But there is a workaround: you can launch a daemon which will relaunch the dock when resuming from suspend/hibernation.

  • Download this file here (click on 'download file link on the top) (source: LP: #535065)
  • Launch it at startup (help here) by adding a new entry with this command: python /path/to/the/file/refresh_cd_on_resuming.py

Note: you can also use a program which does the same thing but coded in C: https://bugs.launchpad.net/cairo-dock-plug-ins/+bug/535065/comments/12 .

harrymc

Posted 2017-07-30T04:52:57.333

Reputation: 306 093