You are not logged in.

#1 2009-10-13 07:17:00

Respen
Member
Registered: 2008-12-13
Posts: 11

Getting sounds in Slim

Hello all,

I would like to get login/logout sounds working in Slim, but I do not know if it is possible.  I was using GDM as a login, but since the update got rid of gdmsetup, my configuration file no longer works.  The only reason I was using GDM to begin with is for the login page loaded, login, login failure, etc. sounds.  Is there a way to do this with Slim?

Offline

#2 2009-10-13 08:00:05

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: Getting sounds in Slim

Slim doesn't do that afaik, but maybe you can set up something with ~/.login and ~/.logout (dunno if it works with anything else than bash) or your initrc maybe.


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#3 2009-10-13 20:03:24

Respen
Member
Registered: 2008-12-13
Posts: 11

Re: Getting sounds in Slim

Thanks for your quick reply.

I was thinking that Slim does not do that, and I thought I might try something with its login (and similar) commands.  I guess that I would want to insert something into the following line in /etc/slim.conf

# This command is executed after a succesful login.
# you can place the %session and %theme variables
# to handle launching of specific commands in .xinitrc
# depending of chosen session and slim theme
#
login_cmd           exec /bin/bash -login ~/.xinitrc %session

With GDM I was using aplay to play the sound files.  What I need to know now is what is the way (if any) that I could use to insert the command to play the sound file into that line.

Offline

#4 2009-10-13 22:02:38

harryNID
Member
From: P3X-1971
Registered: 2009-06-12
Posts: 117

Re: Getting sounds in Slim

Hi Respen,

I've not tried this but after reading your post I remembered reading something recently while learning to script. I don't know if this will help but it might point you in the right direction. It sounds kinda like what you want.

I nicked it from

Bash Guide For Beginners: (Chapter 1. Bash and Bash scripts)

http://tldp.org/LDP/Bash-Beginners-Guid … 01_05.html

1.5.6. Example init script

An init script starts system services on UNIX and Linux machines. The system log daemon, the power management daemon, the name and mail daemons are common examples. These scripts, also known as startup scripts, are stored in a specific location on your system, such as /etc/rc.d/init.d or /etc/init.d. Init, the initial process, reads its configuration files and decides which services to start or stop in each run level. A run level is a configuration of processes; each system has a single user run level, for instance, for performing administrative tasks, for which the system has to be in an unused state as much as possible, such as recovering a critical file system from a backup. Reboot and shutdown run levels are usually also configured.

The tasks to be executed upon starting a service or stopping it are listed in the startup scripts. It is one of the system administrator's tasks to configure init, so that services are started and stopped at the correct moment. When confronted with this task, you need a good understanding of the startup and shutdown procedures on your system. We therefore advise that you read the man pages for init and inittab before starting on your own initialization scripts.

Here is a very simple example, that will play a sound upon starting and stopping your machine:

#!/bin/bash

# This script is for /etc/rc.d/init.d
# Link in rc3.d/S99audio-greeting and rc0.d/K01audio-greeting

case "$1" in
'start')
  cat /usr/share/audio/at_your_service.au > /dev/audio
  ;;
'stop')
  cat /usr/share/audio/oh_no_not_again.au > /dev/audio
  ;;
esac
exit 0

While this is a just a basic example you might be able to accomplish your task like this. With a little fiddling, of course!


In solving a problem of this sort, the grand thing is to be able to reason backward. That is a very useful accomplishment, and a very easy one, but people do not practice it much. In the everyday affairs of life it is more useful to reason forward, and so the other comes to be neglected. There are fifty who can reason synthetically for one who can reason analytically.  --Sherlock Holmes

Offline

Board footer

Powered by FluxBB