Skip to content
  • Start
  • About
  • Privacy Policy

Log out sound on GNU/Linux GDM even easier

Posted by Lopo Lencastre de Almeida on Dezembro 2, 2010Setembro 17, 2020
  1. Home
  2. rants
  3. Log out sound on GNU/Linux GDM even easier

Well! If for some of you the previous instructions didn’t work just test this hack that David made for all of us:

I did kind of a hack workaround for the no sound on shutdown problem some people are having. I just put together some other fixes I read about and so far it seems to work. The only problem is if you want to change the sound that is played requires modifying the script. Not that big a deal I guess. Anyway, this is what I did. In a terminal type gksudo nautilus. Enter password and your now in nautilus with root privilege. Navigate to the /sbin folder. From the ‘File’ menu select ‘Create Document’ > ‘Empty File’. It will create a file called “new file”. Open this file and add the following:

#!/bin/sh
#Put your custom commands after this line
aplay /usr/share/sounds/shutdown.wav
# The next line is the regular gnome logout command
/sbin/shutdown -h now "Shut Down via gdm."

Save the file and rename it shutdown_mod. Now make the file executable by right clicking on it then click on properties. Go to the ‘Permissions’ tab and check ‘Allow executing file as program’. Close the properties window. Close Nautilus.
Now go to the ‘System’ menu > ‘Administration’ > ‘Login Window’. Click ‘Edit Commands’ at the bottom of the ‘General’ tab.
Select ‘Halt command’ from the Command type box. Write down what you see in the Path box just in case you need to change it back.
Now replace what’s in the Path box with /sbin/shutdown_mod. Now click ‘Apply Command Changes’ then close the window. Close the ‘Login Window Preferences’ window.

You should also do this for the reboot command. The only difference will be to name the file reboot_mod and add the following lines:

#!/bin/sh
#Put your custom commands after this line
aplay /usr/share/sounds/shutdown.wav
# The next line is the regular gnome logout command
/sbin/shutdown -r now "Rebooted via gdm."

Don’t forget to make this file executable also. Now modify the ‘Reboot command’ in the ‘Login Window’ the same way you did before. Type /sbin/reboot_mod without the quotes in the Path box.

This worked for me on a fresh 8.04 install. As I said before, I just put this together using some other info I found in different places. I’m not really that knowledgeable about Linux so do this at your own risk. If anyone with more knowledge sees a problem with this, please let me know. Good luck.

Lopo Lencastre de Almeida

Entrepreneur. Project Manager, Web Strategist and Application Developer. Particularly interested in client / server systems and design of relational databases, Usability, UX and Accessibility, Security, Authentication and authorization in distributed software development. Always keen to be part of interesting projects, particularly in the spirit of FLOSS. Also interested in governance, ethics and transparency. Remote work evengelist.

Posted in rants
Tagged code, gksu, gnome, GNOME Display Manager, gnu linux, gtk, login, Open Source, PostSession, Ubuntu, X Window System   

Navegação de artigos

Log out sound on GNU/Linux GDM on 4 easy steps
Tudo o que se disse sobre o WordCamp Lisboa 2011
Member of The Internet Defense League

Recent boots

  • Persona template
  • I don’t start with a design objective
  • WooCommerce Cookbook
  • Laravel 5 Essentials
  • One more Now 4.4
  • WordPress 4.0 is out Go grab it
  • When To Prototype When To Wireframe
  • Da Computer Experto
  • Mais uma ronda pelo forum do WordPress org…
  • Today at f8 we announced Anonymous Login…

  • Facebook link
  • Twitter link
  • Wordpress link
  • Github link

Copyright 2020 iPublicis!COM /Humaneasy Consulting