2

I want to check 10+ local Git repositories if they have any unpushed commit, before shutdown.

(I always forgot to push them, so later, the next morning I came office and back home again)

I think maybe the shutdown process can check some conditions to meet, if any condition is not met, then give the user the choice to continue to shutdown or just cancel.

Then, I can write something to hook the shutdown to check my Git repository to push.

EDIT

I have changed the title from Ubuntu shutdown hook to Compiz shutdown hook. I want to hook to the small lovely shutdown button, rather then click another ugly shortcut icon on the desktop.

1
  • Why does this need to be compiz? Why not just put a script in /etc/rc0.d? May 15, 2011 at 19:17

3 Answers 3

1

You could go the easy way and write a shutdown-script, which does this checking for you. Instead of clicking shutdown, you click on this script.

Unfortunately, I haven't worked by now with GIT, so you I can't give you any pointers on how this could work.

1

The proper way to hook this in would be to run a script when you log out of gdm. Unfortunately, there does not seem to be a straightforward way to configure this on a per-user basis. This question contains some ideas how to set this up, though: https://stackoverflow.com/questions/1167484/how-to-gracefully-shutdown-emacs-daemon; look for /etc/gdm/PostSession/.

1
  • I have tried a test script #!/bin/sh \n exit 1, however, it couldn't cancel the shutdown process. So, the post session script doesn't work for me.
    – Lenik
    Jan 11, 2011 at 1:02
0

I think what you want can be solved with the Sentinella app, you can do program it to monitor a script launched by you, and once this script the app shutdowns the system for you. You will need a little bit of bash, but otherwise this solves your problem.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .