[solved] script/keybinding to launch terminal and run command

the answer is probably simple. but here's the idea.
i use cmus as my music player. at the moment, i have to open a terminal and then type 'cmus'. i'd like to set up a keybinding to run cmus. (incidentally, i'm trying to do this in i3.)
the code
exec cmus
doesn't work, presumably because 'cmus' has to be loaded from within the terminal. (is that right?) what's the syntax for passing on the command 'cmus' to the terminal? what's the best way to do this?
Last edited by anti-destin (2012-03-15 23:52:40)

bindsym mod+c exec urxvtc -name cmus -e cmus
urxvtc => Your terminal here if you use something else. Most support -name and -e. Please read their man pages.
-name => Useful for xprop. It assigns the WM_CLASS which can be used for tagging clients.
man urxvt
-e command [arguments]
Run the command with its command-line arguments in the urxvt
window; also sets the window title and icon name to be the basename
of the program being executed if neither -title (-T) nor -n are
given on the command line. If this option is used, it must be the
last on the command-line. If there is no -e option then the default
is to run the program specified by the SHELL environment variable
or, failing that, sh(1).
Last edited by Earnestly (2012-03-15 19:19:25)

Similar Messages

  • Open Terminal and Run Commands

    Hi I have to ping several IP adresses on a regular basis. Therefore I would like to create an Applescript application that will run terminal and ping the specified IPs so that I can see the results. Any ideas on how to best complete this?

    This script will prompt you to enter the number of times you want to ping each server. You'll need to specify the servers to ping in the "set serverAddresses..." line. It writes the results of each ping to a text file on your desktop and opens the file when finished. The next time you run the script if the text file exists it deletes it first.
    set theDesktop to (path to desktop)
    set serverAddresses to {"www.microsoft.com", "www.apple.com", "www.cnet.com"}
    set pingTimes to text returned of (display dialog "Ping each server how many times?" default answer "1" giving up after 10)
    tell application "Finder"
    if exists file (theDesktop & "ping replies.txt" as string) then
    delete file (theDesktop & "ping replies.txt" as string)
    end if
    set fileID to (open for access file (theDesktop & "ping replies.txt" as string) with write permission)
    repeat with aServer in serverAddresses
    try
    set pingReply to (do shell script "ping -c " & pingTimes & " " & aServer)
    on error
    set pingReply to "No reply from server " & aServer
    end try
    write (pingReply & return & return & "########################" & return & return) to fileID
    end repeat
    close access fileID
    open file (theDesktop & "ping replies.txt" as string)
    end tell
    Robert

  • Unix Perl Script To verify a Up and Running Database on Different Server

    Unix Perl Script To verify a Up and Running Database on Different Server
    Hi
    can any one please tell me a solution to verify a Up and Running Database on Different Server other than the one where we run the unix perl script? The perl script should check if the database is running else it must exit.
    Thanks much
    Kiran

    The other best solution would be Enterprise Manager, load the EM on the other machine and install oracle intelligent agent on all the boxes where oracle is running and problem solved.
    FTP is only a File Transfer Protocol, you can upload/download the files but cant execute them.
    Apart from EM the best way is load oracle client and make connection to all the databases.
    AND There are some free oracle monitoring software available I dont know much about them but one is NAGIO (if I am not wrong), try that if you want.
    BTW whats the problem in monitoring the boxes from the same physical box, means just schedule a script using cron on the same physical box where oracle is to either make connection using SQLPLUS or check the processes using "ps" command and if there is anything wrong then send alert from that box only. In this way there is no need to maintain a central monitoring server.
    Daljit Singh

  • How to "telnet" and run commands on another computer?

    I have a Unix program. I need this to "telnet" to a Windows computer and run commands (via the prompt in Windows). Is there a way to do this in java?
    Also it is something that will be a cron job so the password will be stored in a file rather than the user typing it at the screen. There is no GUI. There is no server or java process running on Windows at the time. The Unix program needs to connect to Windows only when needed.

    Try enabling the Windows telnet server, use a regular telnet client and check if it is enough for your needs.
    Several commands in Windows apparently could be run in command-line mode using telnet, but for some reason they don't work very well. For instance, they could be using some special console-mode APIs for hiding the cursor or drawing characters in different colors, that simply will not be echoed by the telnet server.
    I remember when I've tried to use the osql tool (a command-line interface) of MS SQL Server in a Windows telnet server session. Some things simply didn't work.

  • Trying to turn off spotlight because it's a resource hog.  open terminal and enter command but it won't respond or even ask for password.

    trying to turn off spotlight because it's a resource hog.  open terminal and enter command but it won't respond or even ask for password.

    Step #1:
    In System Preferences click on Spotlight.
    Step #2:
    Click on the Privacy tab here.
    Step #3:
    Click on the + button here and when the window opens click on "Macintosh HD" (or whatever you've named your HD) and then click the Choose button.

  • How to using sqlplus to connect and run command ?

    Hello,i have a small problem please help me
    I want to use sqlplus to connect and run command
    for example : sqlplus test/test@DB select sysdate from dual ;
    and then it will show data (sysdate) to screen
    what should i do ?
    Thanks

    kenshin19xx wrote:
    Hello,i have a small problem please help me
    I want to use sqlplus to connect and run command
    for example : sqlplus test/test@DB select sysdate from dual ;
    and then it will show data (sysdate) to screen
    what should i do ?
    Thanks
    bcm@bcm-laptop:~$ echo "select sysdate from dual ;" > now.sql
    bcm@bcm-laptop:~$ sqlplus user1/user1 @now
    SQL*Plus: Release 11.2.0.1.0 Production on Wed Dec 14 20:41:33 2011
    Copyright (c) 1982, 2009, Oracle.  All rights reserved.
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SYSDATE
    2011-12-14 20:41:33

  • Need a script to delete user files and run on logout.

    Hi folks!
    I'm a total Mac novice so forgive me if I'm vague on anything here. I work in a library and we have recently acquired an iMac running Mountain Lion. The unit is primarily for use by Visually Impaired users however sighted folks can use it as well.
    What I need is something that will delete any files created/downloaded by the sighted users but that will not delete anyone else's files. I tried just using the Guest Account however that also deletes all the system preferences for that account including the dock setup which I need to stay the same.
    If possible I would like this to run on logout.
    For additional points anyone who can also find me something that will run automatically when the users sign in and will sign them out after 30 minutes would super spectacularly awesome.
    Thanks people!

    That being said, if you you still really want to do this you can create a logout hook and write a shell script to remove the files.  See "About Daemons and Services", Appendix B on writing a logout hook.
    But a far easier way is to create Account's login item that will cause a shell script to be launched to delete the files.  You can encapsulate the shell script so it runs as an application that can be added to the Login Items.  One such encapsulator is Platypus.
    Note, rather than delete them, if you want to ensure all the specific plists have specific settings, then create a master set of them and copy the master set into the Preferences directory (being careful to observe ownership and permissions settings of course).

  • [SOLVED] Strange behaviour of gnome-terminal and xterm

    Hello,
    I've been on Archlinux for 2 days, and I have a strange problem with gnome-terminal and xterm. When I write a too long command on a line, the text continues from the beginning of this line erasing the text, instead of going to a new line. Do you have any idea of how to fix that?
    Thanks a lot!
    Last edited by crotte (2008-04-13 21:59:34)

    Seems to be in a fresh install, too. I didn't change any setting of bash and no PS1.
    I still can't reproduce it... I hate those errors. :-(
    Edit:
    Fixed by using zsh now.
    Last edited by Misery (2008-05-16 08:48:44)

  • [solved] rox run action - open xterm and run command?

    Probably a really simple question but I'm not having any luck.
    I want to set a run action in rox for mp3 files to bring up xterm and run mpg123 in it. I've tried pipes and redirects but they don't work. Any ideas?

    You're welcome

  • Shell Script - Need to Open terminal and Print output?

    Hi All,
    I have a script to update a git version of a software, but I would like to be able to check the output of the script in a terminal.
    So in a nut shell, I want when launching the script:
    - Terminal to Open
    - All command to be executed in the terminal
    - Terminal to close only if no error (do not know if it's possible?)
    See below my very simple script:
    Many thanks in advance for your time and advice,
    rm -r /home/sweetth/banshee &&
    cd /home/sweetth &&
    git clone git://git.gnome.org/banshee &&
    cd /home/sweetth/banshee &&
    ./autogen.sh &&
    make

    Right,  I manage it differently
    So I got my script to dl those PKGBUILD for those Ipod library needed for the latest Banshee, then dl the latest banshee git and "make" it.
    for those who might be interested to keep their banshee-git update:
    #!/bin/bash
    xterm -hold -e "mkdir ~/libpod;
    cd ~/libpod;
    mkdir ~/libpod/gtk-sharp-beans-git
    cd ~/libpod/gtk-sharp-beans-git
    wget http://aur.archlinux.org/packages/gtk-sharp-beans-git/gtk-sharp-beans-git/PKGBUILD;
    wget http://aur.archlinux.org/packages/gtk-sharp-beans-git/gtk-sharp-beans-git/autogen_fix.patch;
    makepkg -s;
    mv gtk-sharp-beans-git** ~/libpod;
    cd ~/libpod;
    rm -rf ~/libpod/gtk-sharp-beans-git;
    mkdir ~/libpod/gio-sharp-git;
    cd ~/libpod/gio-sharp-git;
    wget http://aur.archlinux.org/packages/gio-sharp-git/gio-sharp-git/PKGBUILD;
    makepkg -s;
    mv gio-sharp-git** ~/libpod;
    cd ~/libpod;
    rm -rf ~/libpod/gio-sharp-git;
    mkdir ~/libpod/gkeyfile-sharp-git;
    cd ~/libpod/gkeyfile-sharp-git;
    wget http://aur.archlinux.org/packages/gkeyfile-sharp-git/gkeyfile-sharp-git/PKGBUILD;
    makepkg -s;
    mv gkeyfile-sharp-git** ~/libpod;
    cd ~/libpod;
    rm -rf ~/libpod/gkeyfile-sharp-git;
    mkdir ~/libpod/gudev-sharp-git;
    cd ~/libpod/gudev-sharp-git;
    wget http://aur.archlinux.org/packages/gudev-sharp-git/gudev-sharp-git/PKGBUILD;
    makepkg -s;
    mv gudev-sharp-git** ~/libpod;
    cd ~/libpod;
    rm -rf ~/libpod/gudev-sharp-git;
    mkdir ~/libpod/libpod-sharp-git;
    cd ~/libpod/libpod-sharp-git;
    wget http://aur.archlinux.org/packages/libgpod-sharp-git/libgpod-sharp-git/PKGBUILD;
    makepkg -s;
    mv libgpod-sharp-git** ~/libpod;
    rm -rf ~/libpod/libpod-sharp-git;
    cd ~/libpod;
    sudo pacman -U gtk-sharp-beans-git** gio-sharp-git** gkeyfile-sharp-git** gudev-sharp-git** libgpod-sharp-git**;
    rm -rf ~/banshee;
    cd ~;
    git clone git://git.gnome.org/banshee;
    cd ~/banshee;
    ./autogen.sh;
    make;
    rm bin/Banshee.NotificationArea.dll*"

  • Connot make a keybind to launch terminal from Gnome

    It used to work well, but after I stoped the compiz it stopped working, and kept saying
    Text was empty (or contained only whitespace)
    when I tried to use the shortkeys.
    All the other short keys work very well.
    Anyone has an idea? Thank you!

    Here:
    set AppName to {"Safari", "Firefox", "Opera", "Google Chrome", "SeaMonkey", "Camino", "OmniWeb"}
    set AppName1 to (choose from list AppName) as string
    tell application AppName1 to run
    (51697)

  • Terminal not running commands.

    I recently tried running a command to uninstall Xcode "sudo /Developer/Library/uninstall-devtools –mode=all" but it failed after asking me to enter a password. Now after I run the Terminal I get nothing for a response and the window is now named "Terminal-login-86x24". I looked for everything online and on Apple support. What should I do?

    paniclabs wrote:
    I recently tried running a command to uninstall Xcode "sudo /Developer/Library/uninstall-devtools –mode=all" but it failed after asking me to enter a password. Now after I run the Terminal I get nothing for a response and the window is now named "Terminal-login-86x24". I looked for everything online and on Apple support. What should I do?
    That command looks incomplete. From the readme:
    ++++++++
    Uninstalling Xcode Developer Tools
    To uninstall Xcode developer tools on the boot volume along with the <Xcode> directory, from a Terminal window type:
    $ sudo <Xcode>/Library/uninstall-devtools --mode=all
    To remove the underlying developer content on the boot volume, but leave the <Xcode> directory and supporting files untouched, from a Terminal window type:
    $ sudo <Xcode>/Library/uninstall-devtools --mode=systemsupport
    To just remove the UNIX development support on the boot volume, but leave the <Xcode> directory and supporting files untouched, from a Terminal window type:
    $ sudo <Xcode>/Library/uninstall-devtools --mode=unixdev
    Finally, to just uninstall the <Xcode> directory you can simply drag it to the trash, or from a Terminal window type:
    $ sudo <Xcode>/Library/uninstall-devtools --mode=xcodedir
    NOTE: The uninstaller that ships with previous versions of the Xcode developer tools will not clean everything off of your system properly. You should use the one installed with these Xcode developer tools.

  • [SOLVED] Questions about /etc/vconsole.conf and setfont command

    Running setfont command, either
    setfont Lat2-Terminus16
    or
    setfont /usr/share/kbd/consolefonts/Lat2-Terminus16
    gets me "Couldn't get a file descriptor referring to the console"
    When I installed the system I set my keymap to Lat2-Terminus16, doesn't this force the fonts to load in the bootup process?
    Last edited by w201 (2013-02-12 19:27:14)

    karol wrote:
    jasonwryan wrote:Please read the wiki page: the hook you want is not keymap.
    I'm not sure I get it, but https://wiki.archlinux.org/index.php/Mk … mmon_hooks lists only keymap.
    I posted this https://wiki.archlinux.org/index.php/Ta … onsolefont a year ago and didn't receive any response.
    I was referring to this page: https://wiki.archlinux.org/index.php/Fo … sole_fonts
    I guess consolefont is not considered "common"...

  • How to create a logon script to delete folder, subfolders and contents when a user logs on ?

    I need to create a logon script which will delete a folder, subfolder and contents when a user logs on. I have no experience with scripting so any pointers you can give would be much appreciated.
    Thanks

    depending on how you have thing set up, it might be easier to make a LaunchAgent to handle this.  do this:
    copy the text below into a text editor
    save it as a plain text file in /Library/LaunchAgents with the file name "user.startup.folderDeleter.plist" (the name doesn't matter so much, but the 'plist' extension is required)
    load the plist into launchd by restarting the machine or by opening terminal and running the command launchctl load /Library/LaunchAgents/user.startup.folderDeleter.plist
    This will delete the folder any time any user logs in.  You could also expand this to delete the folder periodically (once a day, for instance) if that would be helpful.
    Note, this file must be saved as plain text. apps like TextEdit sometimes default to making rich text files which will not work.  Either download a programmer's text editor like TextWrangler, or make sure that TextEdit is using plain text (if the window has a formatting toolbar it's using rich text;  select "Make Plain Text" from the Format menu).
    copy the text below:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
              <key>Label</key>
              <string>user.startup.folderDeleter</string>
              <key>RunAtLoad</key>
              <true/>
              <key>ProgramArguments</key>
              <array>
                        <string>osascript</string>
                        <string>-e</string>
                        <string>tell application "Finder" to delete folder "Final Cut Express Data" of folder (path to preferences from user domain)</string>
                        <string>-e</string>
                        <string>tell application "Finder" to empty trash</string>
              </array>
    </dict>
    </plist>

  • OPM "build and run" error

    Hi
    I have a problem with OPM when I use "build and run".
    I only get a message "The system cannot find the file specified" and nothing more. It has worked, but it used to open Google Chrome browser. Since I did not want this behaviour I uninstalled Google Chrome. But then I got this error instead.
    I can run "build and debug" prefectly fine.
    The problem is not related to a specific project.
    I have also tried to reinstall OPM but the problem remains.
    What file is it the system cannot find? Is there a way of finding this in a log somewhere?
    How does the "build and run" command work? Is there a way of checking why it can not open the browser?
    kind regards,
    Michael

    Hi Andrew
    Just to add some more observations.
    It seems that OPM doesn't look directly to the default browser setting. If I change the default browser, OPM does not directly recognize the new setting. OPM opens the previous selected default browser anyway.
    I dont know if the setting is unique per project or if it is per OPM installation.
    OPM seems to pick up the default browser, but then OPM caches this somewhere. Which caused problem for me when I uninstalled Google Chrome. OPM insisted on trying to start Google Chrome anyway.
    When I now got Firefox working as default browser the problem solved it self. But when I selected IE as default browser, then when I ran OPM it still opened Firefox, and Firefox gave me the warning that it was not default browser.
    So OPM does not always look at the default browser setting.
    kind regards,
    Michael

Maybe you are looking for

  • How to upgrade memory expansion on Satellite A100-192

    please i need help because i can't take the cover off to install the memory expansion. thanks in advance.

  • How to enable RewriteLog in Apache on OSX Server 4

    Hi, I'm having a hard time trying to enable RewriteLog in OS X Server 4 configuration file. It simply makes the server not responding after configuration files change. I want to put these lines: RewriteLog "/var/log/apache2/rewrite_log" RewriteLogLev

  • How to repair backup of .mdf file database?

    Hi folks, One of our clients gets the following error when trying to backup a database: quote: System.Data.SqlClient.SqlException: SQL Server detected a logical consistency-based I/O error: incorrect checksum (expected: 0x121db60d; actual: 0x521db60d

  • Jsp compilation problem

    Hi,           I am just trying to get the examples to work(new with weblogic) and am           getting a compilation error like:           java.io.IOException: /usr/local/jdk1.2.2/bin/javac.exe not found.           at java.lang.UNIXProcess.forkAndExe

  • Gettign the movieClip back

    When you use the AS 2.0 class Linkage method How do I get the functions of my movieClip back? My hitTest won't work because he won,t use the MovieClip part of the class to call hitTest So how do I MAKE HIM use that method?