«dmenu-launch»

[dmenu-launch] is a launcher written in Bash that lets you quickly launch programs by name.  In addition to binary names, it supports launching XDG shortcuts and will display these (including your local launchers) in the list.
To those that have already been using it, the 0.4.1 > 0.5.3 update fixes a few bugs and adds launch history, uses lsx instead of the deprecated (and removed) dmenu_run, and XDG shortcuts are parsed and cached in one fell swoop to speed things up.
[View screenshot]
[View the AUR package]
Last edited by Wintervenom (2011-08-27 21:12:55)

Would it be a major development effort to add multiple executable searches and bash-style command tab completion?
So if I wanted to sudo tail /var/log/kernel.log not only will it find sudo and tail but it would also locate /var/log/kernel.log using command tab completion.
I figure there'd need to be a special keypress required between 'sudo' and 'tail' to indicate that I'm still looking for executables and a different special keypress between 'tail' and '/var/log/ker...' to indicate that I'm now switching over to command tab completion for the command argument.
Or is all of this already there and I just don't know how to user either dmenu or dmenu-launch?
And in a totally "Aim for the treetops - land on the ground. Aim for the stars - land of the treetops." manouver, how about another special keypress to indicate '--lines=N' is a command option if I wanted to sudo tail --lines=N /var/log/kernel.log instead?
Last edited by KairiTech (2012-01-19 16:53:31)

Similar Messages

  • [Solved] Customize dmenu-launch

    Howdy-ha, folks.  So, I've found a good deal of info on customizing dmenu, but has anyone found a guide on applying the same options to dmenu-launch?  The link on the AUR page for the dmenu-launch homepage is dead, so it's no help right now.  Regardless of the flags used when run, the colors/fonts/etc.  Remain the same with dmenu-launch.  I can't seem to find any other source of info.  Thanks in advance.
    Last edited by ANOKNUSA (2011-04-20 02:32:31)

    EDIT: And you caught it while I was typing.  Not a problem.
    FINAL EDIT:  I didn't think to check the actual script in /usr/bin, which is apparently just a wrapper for standard dmenu.  The line labeled "#Dmenu command" in /usr/bin/dmenu-launcher can be edited to one's liking.  Sweet.
    Last edited by ANOKNUSA (2011-04-20 02:31:58)

  • Lightest combination of WM & DE's

    I originally was going to do different sessions of arch, so that I could have one for basic use, and another session specifically for minimal resource use for graphic design in gimp, emulating flash in sun Vbox, and coding in scite. But I have no idea how to do that, so I'm just gonna do a full re install on a different partition.
    Lightest WM, and DE that still maintain usability?
    (Really all I care about is the simple stuff when I say usability, without being a tiling wm, ability to skin/change color scheme would be nice though.)
    So far I've found:
    PekWM, which seems the best option ATM
    tint2, (but where am I going to have an apps menu?)
    pcmanfm, for wallpaper changing, desktop managing, file exploring and whatnot
    and conky, just because.

    markp1989 wrote:
    Wintervenom wrote:
    Maybe this script could take care of you for an applications menu.  All that's needed is Dmenu, and to bind the script to a keyboard shortcut.
    #!/bin/dash
    ### Dmenu Launcher #############
    # Version 0.2 by Scott Garrett #
    # Wintervenom [(at)] gmail.com #
    xdg_paths="/usr/share/applications
    /usr/local/share/applications
    $XDG_DATA_HOME/applications"
    dm='dmenu -i'
    get_app_names () {
    until [ -z "$1" ]; do
    if [ -d "$1" ]; then
    grep -h '^Name=' "$1/"*.desktop | sed -e 's:Name=: :'
    fi
    shift
    done
    dmenu_path
    get_xdg_app_cmd () {
    name=`echo "$*" | sed 's:^.*-n ::'`
    until [ -z "$1" ]; do
    if [ -d "$1" ]; then
    grep -l "^Name=$name$" "$1/"*.desktop
    fi
    shift
    done | while read file; do
    grep '^Exec=' "$file" | sed -e 's:^Exec=::' -e 's: %.::'
    done
    program_exists () {
    which "$1"
    app=`get_app_names $xdg_paths | $dm -p 'Execute:'`
    [ ! "$app" ] && exit
    if [ ! "`echo "$app" | cut -d' ' -f1`" ]; then
    app=`get_xdg_app_cmd $xdg_paths -n $app`
    echo "$app" | wc -l
    [ "`echo "$app" | wc -l`" != '1' ] && app=`echo "$app" | $dm -p 'Which program?'`
    [ -z "$app" ] && exit
    fi
    program_exists $app && exec $app &
    i was never really a ffan off dmenu so i wrote this graphical launcher using zenity,, and tied it to my windows key
    the entrys need to be edited depending what programs you have installed..
    #!/bin/bash
    menuitem=`zenity --list --title="Application Launcher" \
    --width=280 --height=225 \
    --text="Application Launcher" \
    --column="Program" --column="Description" --separator=";" \
    Firefox "Firefox Web Browser" \
    LeafPad "Test Editor" \
    Lxterminal "Lxterminal" \
    Pidgin "Messenger" \
    Thunar "File Manager" \
    VLC "Media Player" \
    Wicd "Network manager" \
    Shutdown "Shutdown the pc" `
    case $menuitem in
    Firefox) firefox;;
    Lxterminal) xterm ;;
    Pidgin) pidgin;;
    Thunar) thunar ~/;;
    VLC) vlc;;
    Sonata) sonata ;;
    Sylpheed) sylpheed ;;
    Wicd) wicd-client -n ;;
    LeafPad) leafpad ;;
    Shutdown) sudo /sbin/shutdown -h now ;;
    esac
    As cool as it is, the fact that it needs to be manually edited to add every app turns me off to it, as I install/uninstall new progs all the time. I could just eliminate the clutter and use it for only essentials though, the rest can be run from the terminal. Wintervenom: Very nice script, might actually try that one today if I don't switch to jwm, thanks for the nifty menu Do you mind if I copypasta to my website/some friends? (with credit)
    Decided to use jwm, as the majority of you say it is the lightest floating WM, however I may still try xmonad, as I haven't ever actually tried a tiling wm. and Mythus, you have an extremely lightweight system, I might actually emulate that one on my computer (minus the Prague MM, I prefer Amarok or Songbird). Also, what is Orage?
    Thanks for your suggestions everybody!

  • Compiz has improved as a potential minimalistic WM

    Hi all,
    I personally always like and use minimalistic (floating) WM. I use a minimalistic fluxbox setup, and use urxvt for pretty much everything. However, I always thought Compiz potentially could bring more than eye-candy. If the developers are careful in decision making, I think Compiz can use compositing to bring additional productivity, to my taste at least. This week, after trying Compiz again, I think Compiz finally allow as much (or little) eye candy as you like, and enables productive workflow given by composition. I'm not sure if fellow Archers are aware of this improvement, and I just thought I'd share my experience.
    In my opinion, one of the most potentially productive feature of Compiz is the scale addon. I think this is "borrowed" from Mac's expose? To me, it means I can effectively select or monitor all windows, and is more efficient than a taskbar or those windows lists, mostly because scale gives you the visual information about each particular window. Perhaps tiling WM lovers have their solutions that maximizes their workflow, but personally I prefer a floating WM to a tiling one. Compiz has a simple but fairly effective window placement algorithm, by trying not to have new windows overlap, and place them in edges and corners. Compiz has the feature from I think OpenBox and pekwm, which stretches a window in all four directions until they hit an edge. Again, tiling WM advocates probably has nothing to gain here, but for people who like floating WMs, these windows operations are probably good enough for day to day use.
    Compiz now allows eye candy as an option, but I find I can turn them all off if I like, and I mean all, and I doubt too many who try will disagree. For example, in the Alt+Tab thingy, it is simple to configure Compiz to be non-intrusive while presenting a pop-up window list after a small time lag. The fanciful shrinking of the whole desktop while Alt+Tabbing is optional. (I'm not sure who wants that!)
    I use Compiz as a standalone WM on my eeepc, with the 7.9" inch screen. I find I can free up additional screen space compared to fluxbox, because I don't need a taskbar anymore. I just use the Alt+Tab thingy and scale to select windows, and I find that very productive and enjoyable. The magnifying glass is also somewhat helpful for such a small screen. Also, the last few times I tried Compiz, there were always some cheap bugs, although I don't recall any particular ones. This time, I can't find any. The only problem I run into is that I'm trying out some simple OpenGL programming, which runs in fluxbox, but now in Compiz it doesn't. At this point, I don't bother fixing it yet.
    Overall, I am very satisfied with Compiz, and will use it in all my computers. I think it is now possible to configure Compiz to be a minimalistic WM while gaining efficiency through compositing. All eye candy is optional. While tiling WM lovers probably have nothing to gain from Compiz, floating WM users, for example *Box users, might find it enjoyable and useful.

    karabaja4 wrote:
    the problem i have right now is that i have to "hard code" the list of available apps,
    im hoping to eventualy make it so that it will check /usr/share/applications   and make entrys for that rather then having to set them up in the list manualy. [...]
    Perhaps you may find this useful:
    #!/bin/dash
    ### Dmenu Launcher #############
    # Version 0.4 by Scott Garrett #
    # Wintervenom [(at)] gmail.com #
    # Depends on: dmenu, exo #
    # Path to XDG shortcut (*.desktop) directories.
    xdg_paths="/usr/share/applications
    /usr/local/share/applications
    $XDG_DATA_HOME/applications"
    # Dmenu command.
    dm='dmenu -i'
    # Run in Terminal flag.
    terminal='no'
    # Returns the friendly names from XDG shortcuts and the names of
    # executables (according to $PATH).
    # Syntax:
    # get_app_names <path> [<path> ...]
    get_app_names () {
    # Go through the list of XDG shortcut directories that we were fed.
    until [ -z "$1" ]; do
    # Return a the list of friendly names from the XDG shortcut files,
    # replacing the "Name=" part with a space, so we can later tell if
    # the user chose an XDG shortcut or an executable.
    [ -d "$1" ] && grep -h '^Name=' "$1/"*.desktop | sed -e 's:Name=: :'
    shift
    done
    # Now, tack on the list of regular executables.
    dmenu_path
    # Look for an XDG shortcut by its friendly name and return the 'Exec'
    # parameter inside it. If we find more than one XDG shortcut with the
    # same friendly name, we just return all of their 'Exec' parameters.
    # Syntax:
    # get_xdg_app_cmd <path> [<path> ...] -n <XDG friendly name>
    get_xdg_app_cmd () {
    # Grab the friendly name we're supposed to be looking for from the
    # parameters.
    name=`echo "$*" | sed 's:^.*-n ::'`
    # Loop through the XDG shortcut paths.
    until [ -z "$1" ]; do
    # Return the paths to the XDG shortcuts that contain the friendly
    # name we're seeking.
    [ -d "$1" ] && grep -l "^Name=$name$" "$1/"*.desktop
    shift
    # Get out of this loop if we hit the friendly name switch.
    [ "$1" = '-n' ] && break
    # Now, we go through our search results...
    done | while read file; do
    # ...and grab the 'Exec' parameter from each of them, getting rid
    # of the extra stuff we don't need.
    grep '^Exec=' "$file" | sed -e 's:^Exec=::' -e 's: %.::'
    done
    # The reason this is a function is so that we can see only the first
    # parameter -- the name of the executable. We don't give a crap about
    # the users arguments if he or she entered any.
    program_exists () {
    which "$1"
    # Ask the user to select a program to launch.
    while :; do
    app=`(echo "[Run in Terminal: $terminal]"; get_app_names $xdg_paths) | $dm -p 'Execute:'`
    [ "$app" != "[Run in Terminal: $terminal]" ] && break
    terminal=`[ $terminal = no ] && echo yes || echo no`
    done
    # Quit if he or she selected nothing.
    [ ! "$app" ] && exit
    # Figure out whether or not the application selected was an executable
    # or an XDG shortcut by seeing if it started with a space.
    if [ ! "`echo "$app" | cut -d' ' -f1`" ]; then
    # If it did, it was an XDG shortcut, and we need to get a list of
    # the shortcuts by that name, just in case there's more than one.
    app=`get_xdg_app_cmd $xdg_paths -n $app`
    # If there's more than one, we ask the user which target executable
    # he or she would like to launch.
    [ "`echo "$app" | wc -l`" != '1' ] && app=`echo "$app" | $dm -p 'Which program?'`
    # Quit it they selected nothing.
    [ -z "$app" ] && exit
    fi
    # Check and see if the program (without params) exists, and launch it
    # (with params), if so.
    if program_exists $app; then
    [ $terminal = no ] && (exec $app &) || (exo-open --launch TerminalEmulator $app &)
    fi
    Last edited by Wintervenom (2010-01-03 00:24:05)

  • Kernel26-ck with BFS

    Is anyone using this kernel?
    I messed around with it over the weekend and settled on my MHZ set at 300 and i am impressed with its responsivness.
    Makes KDE4 alot smoother and snappier.  Anyone else use it and what have you found.?
    Last edited by smakked (2010-04-15 08:56:13)

    pogeymanz wrote:
    This is directly from the kernel config help menu for 1000Hz:
    1000 Hz is the preferred choice for desktop systems and other systems requiring fast interactive responses to events.
    Laptops can also benefit from this choice without sacrificing battery life if dynticks is also enabled.
    So, it would appear that setting a frequency and dynamic ticks are not mutually exclusive.
    I'm going to see if 2000Hz makes any interactivity difference while under load. Of course this could be placebo, but I'll try to be as objective as I know how.
    One this is for sure, BFS does make a huge difference when my CPU is cranking away at compiling or running Matlab scripts.
    Update: It seems like 2000Hz really does make a difference. My major test for this kind of stuff is to compile the kernel and while it's compiling, I scroll through my Firefox tabs, which usually stutters, launch dmenu-launch, and browse through pictures, etc in Thunar. I have gotten NOTHING that would indicate my CPU is under load. Now I want to time the compile to see if there is a big difference in throughput. There must be, right?
    SanskritFritz cited:
    http://ck.kolivas.org/patches/bfs/bfs-faq.txt wrote:
        THESE ARE OPTIONAL FOR LOWEST LATENCY. YOU DO NOT NEED THESE!
        Configure your kernel with 1000Hz, preempt ON and disable dynamic ticks.
    out of curiosity: are you discussing Kolivas guidelines? He is responsible for BFS.
    Why don't you read Kolivas FAQ if you are using his scheduler?
    In general higher CONFIG_HZ (without dynticks) more unstable system (crashing apps, WM/DM and so on).
    dynticks and CONFIG_HZ are not exclusive: if dynticks are set this is a mechanism that governs interrupts HZ.
    If you want real test compile something demanding: big stuff
    heh, you could try firefox icc with -ipo1
    Last edited by broch (2010-04-27 16:33:41)

  • SOLVED:Dmenu not launching correctly in Xmonad

    I am running xmonad and I am having issues getting the dmenu_run to execute properly. It was working fine before but now it just launches with a white bar and nothing autocompletes. I am running Xmonad 0.9.2-2.1 and dmenu 4.4-1. Here is my entry in xmonad.hs:
    , ((modMask, xK_p ), spawn "dmenu_run | dmenu -b")
    Also, here is my entire xmonad.hs:
    import XMonad hiding (Tall)
    import XMonad.Hooks.DynamicLog
    import XMonad.Hooks.ManageDocks
    import XMonad.Hooks.ManageHelpers
    import XMonad.Layout.HintedTile
    import XMonad.Layout.LayoutHints (layoutHints)
    import XMonad.Prompt
    import XMonad.Prompt.Shell
    import XMonad.Util.Run(spawnPipe)
    import System.Exit
    import System.IO
    import Data.Monoid
    import qualified XMonad.StackSet as W
    import qualified Data.Map as M
    myBorderWidth = 1
    main = do
    xmproc <- spawnPipe "/usr/bin/xmobar /home/comhack/.xmobarcc"
    xmonad $ defaultConfig {
    terminal = "urxvt",
    modMask = mod1Mask,
    workspaces = ["Net", "Chat", "Work", "4", "5", "6", "7", "8", "9"],
    normalBorderColor = "#000000",
    focusedBorderColor = "#838B8B",
    manageHook = composeOne [isFullscreen -?> doFullFloat],
    borderWidth = myBorderWidth,
    keys = myKeys,
    focusFollowsMouse = True,
    layoutHook = myLayout,
    logHook = dynamicLogWithPP $ xmobarPP
    { ppOutput = hPutStrLn xmproc,
    ppTitle = xmobarColor "green" "" . shorten 60,
    ppHiddenNoWindows = xmobarColor "grey" ""
    myKeys conf@(XConfig {XMonad.modMask = modMask}) = M.fromList $
    [ ((modMask , xK_Return ), spawn $ XMonad.terminal conf)
    , ((modm , xK_backslash ), spawn “amixer -q set Master toggle”)
    , ((modm , xK_minus ), spawn “amixer -q set Master 3- unmute”)
    , ((modm , xK_equal ), spawn “amixer -q set Master 3+ unmute”)
    , ((modMask .|. shiftMask, xK_c ), kill)
    , ((modMask , xK_space ), sendMessage NextLayout)
    , ((modMask .|. shiftMask, xK_space ), setLayout $ XMonad.layoutHook conf)
    , ((modMask , xK_n ), refresh)
    , ((modMask, xK_p ), spawn "dmenu_run | dmenu -b")
    , ((modMask , xK_Tab ), windows W.focusDown)
    , ((modMask , xK_j ), windows W.focusDown)
    , ((modMask , xK_k ), windows W.focusUp)
    , ((modMask , xK_m ), windows W.focusMaster)
    , ((modMask .|. shiftMask, xK_Return ), windows W.swapMaster)
    , ((modMask .|. shiftMask, xK_j ), windows W.swapDown)
    , ((modMask .|. shiftMask, xK_k ), windows W.swapUp)
    , ((modMask , xK_h ), sendMessage Shrink)
    , ((modMask , xK_l ), sendMessage Expand)
    , ((modMask , xK_t ), withFocused $ windows . W.sink)
    , ((modMask , xK_comma ), sendMessage (IncMasterN 1))
    , ((modMask , xK_period ), sendMessage (IncMasterN (-1)))
    , ((modMask .|. shiftMask, xK_q ), io (exitWith ExitSuccess))
    , ((modMask , xK_q ), spawn "xmonad --recompile")
    , ((modMask , xK_F2 ), shellPrompt defaultXPConfig)
    , ((0 , 0x1008ff30 ), shellPrompt defaultXPConfig)
    , ((0 , 0x1008ff13 ), spawn "amixer -q set Master 2dB+")
    , ((0 , 0x1008ff11 ), spawn "amixer -q set Master 2dB-")
    , ((0 , 0x1008ff12 ), spawn "amixer -q set Master toggle")
    , ((0 , 0x1008ff16 ), spawn "cmus-remote --prev")
    , ((0 , 0x1008ff17 ), spawn "cmus-remote --next")
    , ((0 , 0x1008ff14 ), spawn "cmus-remote --pause")
    , ((0 , 0x1008ff5b ), spawn "urxvt -e screen -rd cmus")
    , ((modMask , xK_Print ), spawn "scrot -e 'mv $f ~/Screenshots'")
    ++
    [((m .|. modMask, k), windows $ f i)
    | (i, k) <- zip (XMonad.workspaces conf) [xK_1 .. xK_9]
    , (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]]
    ++
    [((m .|. modMask, key), screenWorkspace sc >>= flip whenJust (windows . f))
    | (key, sc) <- zip [xK_w, xK_e, xK_r] [0..]
    , (f, m) <- [(W.view, 0), (W.shift, shiftMask)]]
    myLayout = avoidStruts $ tiled ||| wideTiled ||| Full
    where
    tiled = HintedTile nmaster delta ratio Center Tall
    wideTiled = HintedTile nmaster delta ratio Center Wide
    nmaster = 1
    ratio = 1/2
    delta = 3/100
    It was working fine before so I am thinking that it must of been an update or something. If I run the command in a terminal, it works just fine. So it has to be the syntax or something. This works perfectly:
    dmenu_run | dmenu -b
    Any ideas?
    Last edited by securitybreach (2011-08-08 03:07:25)

    Obscaenvs wrote:
    I don't think it's an actual bug; it's just updated syntax. For me, this solved the issue:
    In my xmonad.hs, I _had_ the line
    , ((modm, xK_p ), spawn "exe=`dmenu_path | dmenu` && eval \"exec $exe\"")
    I changed this to use dmenu_run instead and not piping to dmenu:
    , ((modm, xK_p ), spawn "exe=`dmenu_run` && eval \"exec $exe\"")
    A recompile is necessary for this to take effect. One of you did not have to recompile, but that was most likely because the downgraded dmenu understood the old syntax.
    Now it works...YMMV.
    EDIT: I see now that user "securitybreach" uses "dmenu_run" already... Try not piping the command; when I did this, I got two instances of Dmenu running: one with all the executables in path as usual, and one blank.
    There are people having issues with dmenu using other window managers besides XMonad, so that is not the same issue.  Not to mention, that my spawn of dmenu is WAY less complicated than that, and I am still getting the issue (before downgrade).

  • I3 freezes when launching ncmpcpp from dmenu

    It works great when I launch ncmpcpp from within a terminal (urxvt or xterm). But the whole system freezes when trying to launch it from dmenu. I'm forced to hit the power button on my desktop.
    When I power back on and inspect the i3 log file, there's nothing past the call to dmenu_run:
    08/13/2010 06:20:55 PM - Urgency flag changed to 0
    08/13/2010 06:21:01 PM - --- parsing command "exec /usr/bin/urxvt" ---
    08/13/2010 06:21:01 PM - starting "/usr/bin/urxvt"
    08/13/2010 06:21:02 PM - Managing window 0x00800007
    08/13/2010 06:21:02 PM - _NET_WM_NAME changed to "Terminal"
    08/13/2010 06:21:02 PM - WM_CLASS changed to urxvt (instance), URxvt (class)
    08/13/2010 06:21:02 PM - WM_CLASS changed to urxvt (instance), URxvt (class)
    08/13/2010 06:21:02 PM - _NET_WM_NAME changed to "Terminal"
    08/13/2010 06:21:12 PM - --- parsing command "exec /usr/bin/dmenu_run" ---
    08/13/2010 06:21:12 PM - starting "/usr/bin/dmenu_run"
    //... log ends here
    When I try and use dmenu, this time from openbox, ncmpcpp launches flawlessly.
    Let me know if you require more information
    Last edited by marfig (2010-08-13 19:05:21)

    marfig wrote:It's the freeze that bothers me though.
    IIRC, it will do that in any window manager when you try to run a[n] [N]CURSES program without a terminal.
    marfig wrote:[...] could you please at least have inserted a comment on AUR explaining the program?
    AUR description wrote:A simple Dmenu-based application launcher. Launches binaries and XDG shortcuts.
    AUR descriptions can only be so long and any comments there were wiped out by that database incident.  Sorry 'bout that.
    Anyway, it is a small shell script that uses Dmenu to launch applications either by binary name or XDG shortcut name (e.g., "writer" for OpenOffice Writer instead of $(soffice -writer)), and it can be told to launch applications in a terminal instead, which I figured would help you out.
    Last edited by Wintervenom (2010-08-14 02:39:57)

  • Dmenu-xdg - dmenu based desktop menu launcher

    Because there is absolutely no ideological disagreement whatsoever between the XDG and suckless.org people, I've written this script that scans a collection of directories you specify for XDG .desktop files, parses them, and then builds a cache file you can select from using dmenu to launch programs as if it were xfce-menu or what have you.
    The github: https://github.com/lharding/dmenu-xdg
    It's pretty rough at the moment (hardcoded file locations, no error handling at all), this is mostly a trial to see if anyone but me is interested in something like this before I go polishing it overmuch.
    To use, run install.sh or copy the files into ~/bin, and copy the .conf file into ~/.config and modify it as you please (it's just a python file that gets exec'd, so you can put any site-specific hackery you want in there). Then hook build-menu.py into a cronjob (or if your machine has a decent SSD just alias it to run before you run dmenu-xdg - for me it takes under 200ms to scan all of /usr/share), and then invoke dmenu-xdg by your quicklaunch method of choice.
    Thoughts?

    Huh, so it does, and it includes all the features I had on my roadmap! Thanks for the pointer.
    I'll leave this up here as a solution for really seriously RAM-constrained (the actual runtime invokation is just sh, not even bash) machines (Openpandora, Rasberry Pi, etc), which is what originally inspired me to write it.

  • Alcantara - a launcher inspired by dmenu but written in Qt

    Greetings Archers,
    I'd like to invite you all to try a launcher i have been developing: https://github.com/duca/Alcantara
    It is inspired by kde launcher, but it's intended to be fast and lightweigth (and have a graphic interface).
    I decided to write it along with the decision to move from gnome/kde to xfce4 because i missed something that Alt-F2 was not enough to satisfy.  Since i have some experience in Qt and had it installed, it was my choice.
    If you decide to give it a try, please report bugs and whatever comments you have.
    From the README.md
    Alcantara
    A Qt based launcher similar in spirit to dmenu but graphical.
    It features a dynamic search and although Alcantara assumes you often type the first letters of the desired program, you could also be typing a fragment from the middle or end of the name. In this respect it is more advanced than dmenu.
    Also it keeps track of opened programs by keeping their id's and my intention is to enable, through dbus, the retrieval of pid's (and names) to be used by taskbars and else.
    Last edited by Duca (2013-05-11 20:31:11)

    Thank you for your reply!  It was very amateurish of me.
    I just uploaded a  PKGBUILD and updated the README with some build instructions
    Hope it helps you out.
    Last edited by Duca (2013-05-12 02:04:34)

  • Using SLiM, dmenu's path is incomplete

    Due to an issue with the proprietary NVidia drivers causing the virtual consoles to go blank on my graphics card, I need to use a graphical login manager. I've decided on SLiM, however, I have one issue: When I login with SLiM (into XMonad or DWM), applications such as dmenu and GMrun don't detect the path additions that are set in my ~/.bashrc, so I can't use dmenu to launch any of the applications in ~/bin or ~/.cabal/bin. For instance, from urxvt, my path is as follows:
    /usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/bin/core_perl:/home/drkp/.cabal/bin:/home/drkp/bin
    If I "echo $PATH > somefile" from dmenu, it's:
    /usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/bin/core_perl
    What can I do to fix this bevavior?
    My /etc/slim.conf (the commented-out login command also doesn't work):
    # Path, X server and arguments (if needed)
    # Note: -xauth $authfile is automatically appended
    default_path /bin:/usr/bin:/usr/local/bin
    default_xserver /usr/bin/X
    xserver_arguments -nolisten tcp vt07
    # Commands for halt, login, etc.
    halt_cmd /sbin/shutdown -h now
    reboot_cmd /sbin/shutdown -r now
    console_cmd /usr/bin/xterm -C -fg white -bg black +sb -T "Console login" -e /bin/sh -c "/bin/cat /etc/issue; exec /bin/login"
    #suspend_cmd /usr/sbin/suspend
    # Full path to the xauth binary
    xauth_path /usr/bin/xauth
    # Xauth file for server
    authfile /var/run/slim.auth
    # Activate numlock when slim starts. Valid values: on|off
    # numlock on
    # Hide the mouse cursor (note: does not work with some WMs).
    # Valid values: true|false
    # hidecursor false
    # Set cursor to left pointer
    cursor left_ptr
    # 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
    # NOTE: if your system does not have bash you need
    # to adjust the command according to your preferred shell,
    # i.e. for freebsd use:
    # login_cmd exec /bin/sh - ~/.xinitrc %session
    login_cmd exec /bin/bash -login ~/.xinitrc %session > ~/.xerr 2>&1
    # Commands executed when starting and exiting a session.
    # They can be used for registering a X11 session with
    # sessreg. You can use the %user variable
    # sessionstart_cmd some command
    # sessionstop_cmd some command
    # Start in daemon mode. Valid values: yes | no
    # Note that this can be overriden by the command line
    # options "-d" and "-nodaemon"
    # daemon yes
    # Available sessions (first one is the default).
    # The current chosen session name is replaced in the login_cmd
    # above, so your login command can handle different sessions.
    # see the xinitrc.sample file shipped with slim sources
    sessions xmonad,dwm
    # Executed when pressing F11 (requires imagemagick)
    screenshot_cmd import -window root /slim.png
    # welcome message. Available variables: %host, %domain
    welcome_msg Welcome to %host
    # Session message. Prepended to the session name when pressing F1
    # session_msg Session:
    # shutdown / reboot messages
    shutdown_msg The system is halting...
    reboot_msg The system is rebooting...
    # default user, leave blank or remove this line
    # for avoid pre-loading the username.
    default_user drkp
    # Focus the password field on start when default_user is set
    # Set to "yes" to enable this feature
    focus_password yes
    # Automatically login the default user (without entering
    # the password. Set to "yes" to enable this feature
    #auto_login no
    # current theme, use comma separated list to specify a set to
    # randomly choose from
    current_theme archlinux-soft-grey
    # Lock file
    lockfile /var/lock/slim.lock
    # Log file
    logfile /var/log/slim.log
    My .bashrc:
    # ~/.bashrc
    # If not running interactively, don't do anything
    [[ $- != *i* ]] && return
    # Aliases
    if [ -f ~/.bash_aliases ]; then
    source ~/.bash_aliases
    fi
    # Misc
    eval $(dircolors -b) # Enhance colored ls output
    export LESSOPEN="| /usr/bin/src-hilite-lesspipe.sh %s"
    export LESS="-R" # Allow colored less output
    export EDITOR=vim # Vim as default text editor
    export ESCDELAY=1 # Ncurses escape delay
    # Path
    export PATH="$PATH:$HOME/.cabal/bin"
    export PATH="$PATH:$HOME/bin"
    # Prompt
    PS1='\[\e[1;34m\][\T] \[\e[0;33m\][\w] \[\e[0;31m\]$\[\e[0m\] '
    Last edited by DrKillPatient (2012-09-01 17:07:50)

    RAD version is 6.0.1.1
    "The project was not built since its build path is incomplete."This is obviously an IBM RAD question then.
    See if you can find an IBM RAD forum.
    I need this help urgently as I am stuck up.LOL.

  • [SOLVED] Dmenu + Xmonad, problem in a new version.

    Hello guys.
    I recently have problem with the new version of Dmenu on Xmonad. Dmenu version is 4.5 and the code i use is this:
    keys' :: XConfig Layout -> M.Map (KeyMask, KeySym) (X ())
    keys' conf@(XConfig {XMonad.modMask = modMask}) = M.fromList $
    -- launching and killing programs
    [ ((modMask, xK_Return), spawn $ XMonad.terminal conf)
    , ((modMask, xK_F2 ), spawn "exe=`dmenu_path | dmenu -fn -*-profont-*-*-*-*-12-*-*-*-*-*-*-* -nb black -nf rgb:a0/a0/a0 -sb rgb:00/80/80 -sf black` && eval \"exec $exe\"")
    Any idea?
    Thanks in advanced.
    Last edited by n0dix (2012-03-16 02:53:59)

    Well got it working again, look for this post. And changed my file to the following:
    [ ((modMask, xK_Return), spawn $ XMonad.terminal conf)
    , ((modMask, xK_F2 ), spawn "dmenu_run -fn -*-profont-*-*-*-*-12-*-*-*-*-*-*-* -nb black -nf rgb:a0/a0/a0 -sb rgb:00/80/80 -sf black")
    Thanks anyway

  • Awesomewm and dmenu

    Ive got dmenu as mod4+p in my rc.lua and it only works in the first tag, none of the others.
    -- Standard awesome library
    require("awful")
    require("awful.autofocus")
    require("awful.rules")
    -- Theme handling library
    require("beautiful")
    -- Notification library
    require("naughty")
    -- {{{ Variable definitions
    -- Themes define colours, icons, and wallpapers
    beautiful.init("/usr/share/awesome/themes/arch/theme.lua")
    -- This is used later as the default terminal and editor to run.
    terminal = "aterm"
    editor = os.getenv("EDITOR") or "nano"
    editor_cmd = terminal .. " -e " .. editor
    -- Default modkey.
    -- Usually, Mod4 is the key with a logo between Control and Alt.
    -- If you do not like this or do not have such a key,
    -- I suggest you to remap Mod4 to another key using xmodmap or other tools.
    -- However, you can use another modifier like Mod1, but it may interact with others.
    modkey = "Mod4"
    -- Table of layouts to cover with awful.layout.inc, order matters.
    layouts =
    awful.layout.suit.floating,
    awful.layout.suit.tile,
    awful.layout.suit.tile.left,
    awful.layout.suit.tile.bottom,
    awful.layout.suit.tile.top,
    awful.layout.suit.fair,
    awful.layout.suit.max
    -- {{{ Tags
    -- Define a tag table which hold all screen tags.
    tags = {}
    for s = 1, screen.count() do
    -- Each screen has its own tag table.
    tags[s] = awful.tag({ 1, 2, 3, 4, 5, 6, 7, 8, 9 }, s, layouts[1])
    end
    -- {{{ Menu
    -- Create a laucher widget and a main menu
    myawesomemenu = {
    { "manual", terminal .. " -e man awesome" },
    { "edit config", editor_cmd .. " " .. awful.util.getdir("config") .. "/rc.lua" },
    { "restart", awesome.restart },
    { "quit", awesome.quit }
    mymainmenu = awful.menu({ items = { { "awesome", myawesomemenu, beautiful.awesome_icon },
    { "open terminal", terminal }
    mylauncher = awful.widget.launcher({ image = image(beautiful.awesome_icon),
    menu = mymainmenu })
    -- {{{ Wibox
    -- Create a textclock widget
    mytextclock = awful.widget.textclock({ align = "right"} )
    -- Create a systray
    mysystray = widget({ type = "systray" })
    -- Create a wibox for each screen and add it
    mywibox = {}
    mypromptbox = {}
    mylayoutbox = {}
    mytaglist = {}
    mytaglist.buttons = awful.util.table.join(
    awful.button({ }, 1, awful.tag.viewonly),
    awful.button({ modkey }, 1, awful.client.movetotag),
    awful.button({ }, 3, awful.tag.viewtoggle),
    awful.button({ modkey }, 3, awful.client.toggletag),
    awful.button({ }, 4, awful.tag.viewnext),
    awful.button({ }, 5, awful.tag.viewprev)
    mytasklist = {}
    mytasklist.buttons = awful.util.table.join(
    awful.button({ }, 1, function (c)
    if c == client.focus then
    c.minimized = true
    else
    if not c:isvisible() then
    awful.tag.viewonly(c:tags()[1])
    end
    -- This will also un-minimize
    -- the client, if needed
    client.focus = c
    c:raise()
    end
    end),
    awful.button({ }, 3, function ()
    if instance then
    instance:hide()
    instance = nil
    else
    instance = awful.menu.clients({ width=250 })
    end
    end),
    awful.button({ }, 4, function ()
    awful.client.focus.byidx(1)
    if client.focus then client.focus:raise() end
    end),
    awful.button({ }, 5, function ()
    awful.client.focus.byidx(-1)
    if client.focus then client.focus:raise() end
    end))
    for s = 1, screen.count() do
    -- Create a promptbox for each screen
    mypromptbox[s] = awful.widget.prompt({ layout = awful.widget.layout.horizontal.leftright })
    -- Create an imagebox widget which will contains an icon indicating which layout we're using.
    -- We need one layoutbox per screen.
    mylayoutbox[s] = awful.widget.layoutbox(s)
    mylayoutbox[s]:buttons(awful.util.table.join(
    awful.button({ }, 1, function () awful.layout.inc(layouts, 1) end),
    awful.button({ }, 3, function () awful.layout.inc(layouts, -1) end),
    awful.button({ }, 4, function () awful.layout.inc(layouts, 1) end),
    awful.button({ }, 5, function () awful.layout.inc(layouts, -1) end)))
    -- Create a taglist widget
    mytaglist[s] = awful.widget.taglist(s, awful.widget.taglist.label.all, mytaglist.buttons)
    -- Create a tasklist widget
    mytasklist[s] = awful.widget.tasklist(function(c)
    return awful.widget.tasklist.label.currenttags(c, s)
    end, mytasklist.buttons)
    -- Create the wibox
    mywibox[s] = awful.wibox({ position = "top", screen = s })
    -- Add widgets to the wibox - order matters
    mywibox[s].widgets = {
    mylauncher,
    mytaglist[s],
    mypromptbox[s],
    layout = awful.widget.layout.horizontal.leftright
    mylayoutbox[s],
    mytextclock,
    s == 1 and mysystray or nil,
    mytasklist[s],
    layout = awful.widget.layout.horizontal.rightleft
    end
    -- {{{ Mouse bindings
    root.buttons(awful.util.table.join(
    awful.button({ }, 3, function () mymainmenu:toggle() end),
    awful.button({ }, 4, awful.tag.viewnext),
    awful.button({ }, 5, awful.tag.viewprev)
    -- {{{ Key bindings
    globalkeys = awful.util.table.join(
    awful.key({ modkey, }, "Left", awful.tag.viewprev ),
    awful.key({ modkey, }, "Right", awful.tag.viewnext ),
    awful.key({ modkey, }, "Escape", awful.tag.history.restore),
    awful.key({ modkey, }, "j",
    function ()
    awful.client.focus.byidx( 1)
    if client.focus then client.focus:raise() end
    end),
    awful.key({ modkey, }, "k",
    function ()
    awful.client.focus.byidx(-1)
    if client.focus then client.focus:raise() end
    end),
    awful.key({ modkey, }, "w", function () mymainmenu:show({keygrabber=true}) end),
    -- Layout manipulation
    awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( 1) end),
    awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end),
    awful.key({ modkey, "Control" }, "j", function () awful.screen.focus_relative( 1) end),
    awful.key({ modkey, "Control" }, "k", function () awful.screen.focus_relative(-1) end),
    awful.key({ modkey, }, "u", awful.client.urgent.jumpto),
    awful.key({ modkey, }, "Tab",
    function ()
    awful.client.focus.history.previous()
    if client.focus then
    client.focus:raise()
    end
    end),
    -- Standard program
    awful.key({ modkey, "Shift" }, "Return", function () awful.util.spawn(terminal)
    end),
    awful.key({ modkey, "Control" }, "r", awesome.restart),
    awful.key({ modkey, "Shift" }, "q", awesome.quit),
    awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end),
    awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end),
    awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1) end),
    awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1) end),
    awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1) end),
    awful.key({ modkey, "Control" }, "l", function () awful.tag.incncol(-1) end),
    awful.key({ modkey, }, "space", function () awful.layout.inc(layouts, 1) end),
    awful.key({ modkey, "Shift" }, "space", function () awful.layout.inc(layouts, -1) end),
    awful.key({ modkey, "Control" }, "n", awful.client.restore),
    -- Prompt
    awful.key({ modkey }, "r", function () mypromptbox[mouse.screen]:run() end),
    awful.key({ modkey }, "x",
    function ()
    awful.prompt.run({ prompt = "Run Lua code: " },
    mypromptbox[mouse.screen].widget,
    awful.util.eval, nil,
    awful.util.getdir("cache") .. "/history_eval")
    end)
    clientkeys = awful.util.table.join(
    awful.key({ modkey, }, "f", function (c) c.fullscreen = not c.fullscreen end),
    awful.key({ modkey, "Shift" }, "c", function (c) c:kill() end),
    awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle ),
    awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end),
    awful.key({ modkey, }, "o", awful.client.movetoscreen ),
    awful.key({ modkey, "Shift" }, "r", function (c) c:redraw() end),
    awful.key({ modkey, }, "t", function (c) c.ontop = not c.ontop end),
    awful.key({ modkey, }, "n",
    function (c)
    -- The client currently has the input focus, so it cannot be
    -- minimized, since minimized clients can't have the focus.
    c.minimized = true
    end),
    awful.key({ modkey, }, "m",
    function (c)
    c.maximized_horizontal = not c.maximized_horizontal
    c.maximized_vertical = not c.maximized_vertical
    end),
    awful.key({ modkey }, "p", function ()
    awful.util.spawn("dmenu_run -i -p 'Run command:' -nb '" ..
    beautiful.bg_normal .. "' -nf '" .. beautiful.fg_normal ..
    "' -sb '" .. beautiful.bg_focus ..
    "' -sf '" .. beautiful.fg_focus .. "'")
    end)
    -- Compute the maximum number of digit we need, limited to 9
    keynumber = 0
    for s = 1, screen.count() do
    keynumber = math.min(9, math.max(#tags[s], keynumber));
    end
    -- Bind all key numbers to tags.
    -- Be careful: we use keycodes to make it works on any keyboard layout.
    -- This should map on the top row of your keyboard, usually 1 to 9.
    for i = 1, keynumber do
    globalkeys = awful.util.table.join(globalkeys,
    awful.key({ modkey }, "#" .. i + 9,
    function ()
    local screen = mouse.screen
    if tags[screen][i] then
    awful.tag.viewonly(tags[screen][i])
    end
    end),
    awful.key({ modkey, "Control" }, "#" .. i + 9,
    function ()
    local screen = mouse.screen
    if tags[screen][i] then
    awful.tag.viewtoggle(tags[screen][i])
    end
    end),
    awful.key({ modkey, "Shift" }, "#" .. i + 9,
    function ()
    if client.focus and tags[client.focus.screen][i] then
    awful.client.movetotag(tags[client.focus.screen][i])
    end
    end),
    awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9,
    function ()
    if client.focus and tags[client.focus.screen][i] then
    awful.client.toggletag(tags[client.focus.screen][i])
    end
    end))
    end
    clientbuttons = awful.util.table.join(
    awful.button({ }, 1, function (c) client.focus = c; c:raise() end),
    awful.button({ modkey }, 1, awful.mouse.client.move),
    awful.button({ modkey }, 3, awful.mouse.client.resize))
    -- Set keys
    root.keys(globalkeys)
    -- {{{ Rules
    awful.rules.rules = {
    -- All clients will match this rule.
    { rule = { },
    properties = { border_width = beautiful.border_width,
    border_color = beautiful.border_normal,
    focus = true,
    keys = clientkeys,
    buttons = clientbuttons } },
    { rule = { class = "MPlayer" },
    properties = { floating = true } },
    { rule = { class = "pinentry" },
    properties = { floating = true } },
    { rule = { class = "gimp" },
    properties = { floating = true } },
    -- Set Firefox to always map on tags number 2 of screen 1.
    -- { rule = { class = "Firefox" },
    -- properties = { tag = tags[1][2] } },
    -- {{{ Signals
    -- Signal function to execute when a new client appears.
    client.add_signal("manage", function (c, startup)
    -- Add a titlebar
    -- awful.titlebar.add(c, { modkey = modkey })
    -- Enable sloppy focus
    c:add_signal("mouse::enter", function(c)
    if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier
    and awful.client.focus.filter(c) then
    client.focus = c
    end
    end)
    if not startup then
    -- Set the windows at the slave,
    -- i.e. put it at the end of others instead of setting it master.
    -- awful.client.setslave(c)
    -- Put windows in a smart way, only if they does not set an initial position.
    if not c.size_hints.user_position and not c.size_hints.program_position then
    awful.placement.no_overlap(c)
    awful.placement.no_offscreen(c)
    end
    end
    end)
    client.add_signal("focus", function(c) c.border_color = beautiful.border_focus end)
    client.add_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)

    thanks for the advice, I put it in the global keys and it worked.
    Now, problem is a run dmenu in a blank tag to spawn a browser then switch to tag 2 and try to run dmenu again, but i cant because the cursor is now the stop watch thing and wont let me run dmenu

  • Xmonad fails to launch terminal

    I have X11 working now (only as root, but I'll solve that one later). I can start xmonad, and I get the huge white screen, but no terminal.
    I've set the default terminal in xmonad.hs to be xterm, but it doesn't want to fire it up when xmonad starts. Furthermore, if I try to create a new window the screen flickers (as if it's adding a second pane), but then instantly flips back to the single dumb window I have.
    I've tried launching various terminal apps with dmenu (xterm, urxvt), but screen just flickers again and nothing happens.
    For clarity, I'm not using the "darcs" version of xmonad. I just grabbed the latest stable version with pacman.
    I've had the same issue in Ubuntu, and the only resolution was to grab someone else's xmonad.hs (or sit down and learn Haskell and the massive xmonad system of doing things). Xmonad also fails to generate its own xmonad.hs when run without one, so I'm stuck with the example config file for the time being.
    from what I'm seeing, my best guess is that xmonad is for some reason unable to invoke a terminal.

    http://www.apple.com/support/bootcamp/
    My iMac (27-inch, Late 2009) displays a black screen during installation of Microsoft Windows 7 using the Boot Camp Assistant. How do I fix it?
    The Windows 7 installer does not include required graphics or Bluetooth drivers for this computer. To obtain the necessary drivers and resolve the issue, see this article (creating the SD card and drivers for the "black screen" issue).
    http://support.apple.com/kb/TS3173

  • Dmenu autostart.

    Hello everyone! I recently switched over to Arch and decided to try AwesomeWM (as someone said, all the cool kids are doing it), and everything has been smooth up till now.
    I want to dmenu to start as I start x from the command line. I added
    /usr/bin/dmenu_run &
    to my .xinitrc file, and it seemed to work. Once. Now, no matter what I do dmenu will not autolaunch as X starts. After searching forums I have not found a solution. I am sure an answer is out there but I am about to fall asleep in my chair so I thought I would take a shortcut: Is it possible to launch dmenu as X starts ?
    Thanks!
    -Chris

    chrisp wrote:I want to dmenu to start as I start x from the command line.
    Do you mean that you want it to run as soon as awesome comes up? dmenu is not something you have running constantly like you do with gnome-do, you just need to bind dmenu_run to a key combination.
    I use mod4+space to launch dmenu and have this in my rc.lua:
    awful.key({ modkey }, "space", function () awful.util.spawn("dmenu_run") end),
    If you are just wanting dmenu to pop up when awesome starts, just add this somewhere in your rc.lua:
    awful.util.spawn("dmenu_run")

  • Dmenu-tools: a collection of scripts powered by dmenu

    dmenu-tools is a collection of scripts powered by dmenu.
    Project home
    Project source
    AUR package
    Included scripts at the time of release:
    dmenu_edit: Use dmenu to open and edit a file from a given list.
    dmenu_menu: A recursive dmenu menu.
    dmenu_mpc: Control mpc via dmenu.
    dmenu_netcfg: Switch netcfg network profiles.
    dmenu_run_recent: Sort dmenu items by usage. Append ";" to launch the app in terminal.
    Contributions/criticism welcome.
    Last edited by tlvince (2012-08-22 17:09:18)

    dmenu-translate
    uses google's translator
    #!/bin/bash
    # LIST OF LANGUAGES #
    # af (Afrikaans) #
    # sq (Albanian) #
    # ar (Arabic) #
    # hy (Armenian) #
    # az (Azerbaijani) #
    # eu (Basque) #
    # be (Belarusian) #
    # bn (Bengali) #
    # bg (Bulgarian) #
    # ca (Catalan) #
    # zh-CN (Chinese) #
    # hr (Croatian) #
    # cs (Czech) #
    # da (Danish) #
    # nl (Dutch) #
    # en (English) #
    # eo (Esperanto) #
    # et (Estonian) #
    # tl (Filipino) #
    # fi (Finnish) #
    # fr (French) #
    # gl (Galician) #
    # ka (Georgian) #
    # de (German) #
    # el (Greek) #
    # gu (Gujarati) #
    # ht (Haitian-Creole) #
    # iw (Hebrew) #
    # hi (Hindi) #
    # hu (Hungarian) #
    # is (Icelandic) #
    # id (Indonesian) #
    # ga (Irish) #
    # it (Italian) #
    # ja (Japanese) #
    # kn (Kannada) #
    # ko (Korean) #
    # la (Latin) #
    # lv (Latvian) #
    # lt (Lithuanian) #
    # mk (Macedonian) #
    # ms (Malay) #
    # mt (Maltese) #
    # no (Norwegian) #
    # fa (Persian) #
    # pl (Polish) #
    # pt (Portuguese) #
    # ro (Romanian) #
    # ru (Russian) #
    # sr (Serbian) #
    # sk (Slovak) #
    # sl (Slovenian) #
    # es (Spanish) #
    # sw (Swahili) #
    # sv (Swedish) #
    # ta (Tamil) #
    # te (Telugu) #
    # th (Thai) #
    # tr (Turkish) #
    # uk (Ukrainian) #
    # ur (Urdu) #
    # vi (Vietnamese) #
    # cy (Welsh) #
    # yi (Yiddish) #
    if [ -f $HOME/.dmenurc ]; then
    . $HOME/.dmenurc
    else
    DMENU='dmenu -i'
    fi
    # first run
    if [ ! -e $XDG_CONFIG_HOME/dmenu-translate ]
    then
    languages=$(echo "" | $DMENU -p "please provide your default languages (see the list of languages in the script), separated by space:")
    if [ "$languages" != '' ]
    then
    echo $languages > $XDG_CONFIG_HOME/dmenu-translate
    fi
    else
    languages=$(cat $XDG_CONFIG_HOME/dmenu-translate | sed 's/\ /\\n/g')
    if [ "$languages" != '' ]
    then
    from=$(echo -e "$languages" | $DMENU -p "translate from")
    if [ "$from" != '' ]
    then
    to=$(echo -e "$languages" | $DMENU -p "translate to")
    if [ "$to" != '' ]
    then
    text="$(xsel -o | $DMENU -p "text":)"
    if [ "$text" != '' ]
    then
    echo $(wget --user-agent="Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20100101 Firefox/14.0.1" "http://translate.google.com/translate_a/t?client=x&text=$text&hl=$from&sl=$from&tl=$to" -qO-)| awk -F\" '{ print $6 }' | tr \\n \\0 | $DMENU -p "translation from $from to $to:" | xsel -i
    fi
    fi
    fi
    fi
    fi
    or http://codepad.org/Cggq1GiG
    For code improvements (I'm not sure if my way is the best way), please tell me, I'm willing to learn!
    edited: little bug in the script
    edited again: I'll try to translate it to your style and reupload it, if you like what this script does and want to include it to your collection
    Last edited by Army (2012-08-27 10:30:34)

Maybe you are looking for

  • Photos in emails doesn't appear

    Hello, When I check my emails (hotmail) from Nokia E72 the photos which are in the email doesn't show, it gives me link for the photos only, but the photo itself does not appear. How can I get photos instead of the link? Is there any way?

  • Clear java cache

    Hi Hope someone can assist I'm struggling to download items on some websites on Safari and the forum on the website suggested I clear my Java cache. I can't find any references to Java under system Preferences or Utilities. There is also no option to

  • DW crashes on load (CS4 on a G5 PowerMac)

    Today I loaded Leopard onto my G5 PowerMac as well as Suitcase Fusion 2. Then I set about loading CS4 Web Premium and all but DW are OK loading up, but DW always crashes. I'm glad I didn't delete my CS3 version before opening up CS4. Does anyone have

  • How can I stop FCPX from loading every project on a drive?

    Every time I connect an external hard drive with FCP projects and events on them, Final Cut reads and loads every project which significantly slows down the program and my MacBook. Are there any settings or plugins/scripts that would give you the opt

  • What does it mean error 3194? i tried to download the 4.2, from 4.0

    what does it mean error 3194? i tried to download the 4.2, from 4.0