A solução que parece funcionar melhor para mim é editar /etc/gdm/PostLogin/Default . Isso é executado logo após o usuário efetuar login com o gdm. Apenas o que eu queria.
Que arquivo devo modificar para executar algumas instruções quando qualquer usuário efetua login através do gdm?
Eu tentei /etc/bashrc , mas isso é executado ony ao iniciar o bash (e sempre que um xterm é aberto). Eu gostaria de executar algo apenas uma vez quando o usuário faz o login.
O que eu quero fazer é "redefinir" algumas preferências do usuário cada vez que o usuário fizer logon (incluindo o gerenciador de janelas), para que o script seja executado antes que o WM seja inicializado.
No Debian e nos derivados, você pode modificar /etc/profile , mas não é universal.
Da página do manual:
When bash is invoked as an interactive login shell, or as a non-interactive shell with the --login option, it first reads and executes commands from the file /etc/profile, if that file exists. After reading that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order, and reads and executes commands from the first one that exists and is readable. The --noprofile option may be used when the shell is started to inhibit this behavior.
When a login shell exits, bash reads and executes commands from the file ~/.bash_logout, if it exists.
When an interactive shell that is not a login shell is started, bash reads and executes commands from /etc/bash.bashrc and ~/.bashrc, if these files exist. This may be inhibited by using the --norc option. The --rcfile file option will force bash to read and execute commands from file instead of /etc/bash.bashrc and ~/.bashrc.
Para alterar o WM dos seus usuários: desinstale o kdm / gdm / xdm / slim, configure o WM em ~ / .xinitrc e execute o "startx" a partir da sua configuração do bash.