LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   [awesome] Running xterm on specific tags on startup only (https://www.linuxquestions.org/questions/linux-newbie-8/%5Bawesome%5D-running-xterm-on-specific-tags-on-startup-only-4175413656/)

VirtualDuck 06-27-2012 07:44 AM

[awesome] Running xterm on specific tags on startup only
 
Hi

I have little problem: I want to run on startup (and only on startup) few xterms (ie with 'cd /tmp', 'ls' etc commands) and each of them in different tag. Because after startup I want to run xterm in current tag, resolving this problem with awful.rules.rules table isn't a good way (or easy).
I try sth like this in the end of my rc.lua:
Code:

awful.tag.viewonly(tags[1][1])
awful.util.spawn_with_shell("xterm -e cmatrix")
os.execute("sleep 2")
awful.tag.viewonly(tags[1][2])
awful.util.spawn_with_shell("xterm -e 'cd /tmp && /bin/bash'")

But both xterms run in second tag. I put sleep because I thought that tags are changing so fast that "xterm -e cmatrix" is finish executing after change to second tag. But after restart awesome its only hang for 2 sec and run both xterms in second tag.
awful.util.spawn_with_shell() function has second argument to determine on which screen run command, but not on which tag.


All times are GMT -5. The time now is 10:02 PM.