Le 10/04/2012 15:27, Bill Sun a écrit :
> Hi,
>
> Currently I'm sharing my computer with someone, and we use different
> window manager/desktop environment. I want to save alsa volume level on
> a per-user basis, so I need to execute `alsactl store -f ~/.asoundrc`
> when logging out.
>
> Since I use slim as my 'login manager', I thought I can use .xinitrc to
> achieve that. I added that command to the very end of my .xinitrc, after
> `ck-launch-session awesome` (see my attachment).
>
> If I just logout, then everything seems OK---my current volume level
> would be successfully stored. If, however, I shut my computer down via
> an awesome key binding (I created a shell script that uses dbus/
> consolekit command to poweroff; then use `awful.key({ modkey }, "]",
> function () awful.util.spawn_with_shell(/home/user1/bin/poweroff)) to
> assign that script to a key), then my current volume level wouldn't be
> saved. The only message I saw is `xinit: connection to X closed` during
> shutting down.
>
> The guy who shares computer with me uses KDE, and he uses basically the
> same .xinitrc (except replace `awesome` with `startkde`). KDE handles
> this correctly---either just logging off or shutting down in KDE, his
> volume level would be saved.
>
> So, how to achieve this function in awesome?
>
> -BillWhen the computer is shutting down, a SIGTERM is send to all the process and a few second later a SIGKILL is send. You should try to catch the SIGTERM in the .xinitrc script using the command “trap” (man trap). Clément -- Clef GPG : 0xDD51E028
signature.asc
Description: OpenPGP digital signature
