Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Cruncbang has a file called cb-exit (phython) I use sudo nano to edit this file. I was attempting to play a logoff wave file and I was told where to place the command:
I have done as told and yet the command simply will not execute: I used two versions of the command 1)
os.system("aplay /path to file) and 2)os.system("path to script.sh"). Neither works, I have run chmod 0755 and imported the path to files but no joy. Both commands run in terminal. Below is what I tried initially:
I also tried > os.system("aplay -D plughw -q /home/william/Soundfiles/tada.wav")
I also tried the script
> os.system("bash /home/william/scripts/shutdown_tada.sh
i'm not so sure about those ">" in there - they are not really in the script, yes? you just added them to highlight the crucial bits?
anyhow i tried this shutdown sound thing, and python is really picky about indentation, it's part of the syntax.
in my case, cb-exit wouldn't run anymore until i changed the settings in my editor and forced it to use tabs (many editors replace tabs with spaces).
but after that it would work just fine.
i think this syntax is even better:
Interesting. I don't think the syntax is the issue as you imply. I am using sudo nano in terminal. The keys tabs are working and I saw nothing about tab options(I may know what I am looking for). I backed the cursor to the left of the page and hit <tab><tab> then edited the line os.system("aplay /home/william/Soundfiles/tada.wav ; openbox --exit"). That did not work so I must not be editing python correctly. Back to school!
No problems playing aplay in terminal. I've done it dozens of times in different forms and even with a script. Logout works fine it seems as long as the indentation and syntax
is correct logout will work. Below the line is my pasted cb-exit.
Guess I need to learn about code tags and whereis output.
code tags: when you reply in normal/advanced mode (not quick reply), you can see a "#" in the editor's toolbar. click it, it will generate code tags (you can also just type those).
paste your code between those tags, it will be more readable.
whereis: open a terminal and literally type what i asked before. it will show you where the requested file is, if it's in your $PATH.
btw, you know you have to edit the file in /usr/bin with sudo?
but it's not recommended to change installed files; i don't know what will happen when you upgrade.
better to copy cb-exit to somewhere where you have user rights, edit it there without sudo, then point your openbox menu/hotkey to that file instead.
Thanks anyway This a copy of cb-exit I got from a crunchbang forum. It seems different from your cb-exit although I am not clever enough to analyze it. I don't have a compare software package to detect differences.
you are posting weird stuff.
if you don't use code tags i can't tell whether you accidentally formatted it wrong or whether the script is really borked.
you also haven't really reacted to any of my suggestions since the last few posts.
get yourself a copy of the cb-exit script as it is intended to be (it really isn't that hard to find a crunchbang repo mirror, meaning a place in the internet where all crunchbang software is stored - or maybe a git version) and start from scratch.
Sorry the last post was a mistake. I thought I had used code tags. You have been more than kind. I just did not have the time or skill to do everything I should have. I will go off and study as much as I can. You can close this thread if you like!