LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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!

Notices


Reply
  Search this Thread
Old 06-27-2017, 09:49 AM   #1
rdeyvil
LQ Newbie
 
Registered: Jun 2017
Posts: 1

Rep: Reputation: Disabled
how to Run .sh file directly from dmenu-i3wm?


How can I run .sh file directly from dmenu on i3WM ?
 
Old 06-27-2017, 12:41 PM   #2
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,354
Blog Entries: 13

Rep: Reputation: 4411Reputation: 4411Reputation: 4411Reputation: 4411Reputation: 4411Reputation: 4411Reputation: 4411Reputation: 4411Reputation: 4411Reputation: 4411Reputation: 4411
Hi rdeyvil and welcome to LQ.

I'm not well versed on dmenu, however in most desktop environments you can create a shortcut.

That short cut should point to the path and filename for the .sh file.

Please note that the .sh file should be executable for the username using the shortcut.

If not a shortcut, perhaps what they are talking about here with respect to aliases: https://wiki.archlinux.org/index.php..._shell_aliases. Bear in mind that I have never used this window manager or desktop environment so I may be out in left field here. My normal experience is that I'd create a desktop shortcut and point that to the script.
 
Old 06-27-2017, 01:00 PM   #3
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (current), FreeBSD, Win10, It varies
Posts: 9,952

Rep: Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148
dmenu takes executable from /usr/bin - may even use the desktop files in applications. so no - not unless you create a desktop file for it then add it to /usr/share/applications

i3 config keyboard short cuts will work.

i3 too using a modded dmenu "i3-dmenu-desktop" that only uses the files what have a desktop file if you used that one then created a desktop file for it that too should work (work around)
Code:
[Desktop Entry]
Type=Application
Name=MY_Shell-Script
Comment=Does stuff 
Keywords=
TryExec=/path/to/script/ScriptName
Exec=/path/to/script/ScriptName
Terminal=false/true?
Categories="whatever menu selection you might want it in."
the placement of the script is also an important issue to take into consideration.

Last edited by BW-userx; 06-27-2017 at 01:13 PM.
 
Old 06-27-2017, 04:07 PM   #4
GazL
LQ Veteran
 
Registered: May 2008
Posts: 5,963

Rep: Reputation: 3954Reputation: 3954Reputation: 3954Reputation: 3954Reputation: 3954Reputation: 3954Reputation: 3954Reputation: 3954Reputation: 3954Reputation: 3954Reputation: 3954
I use this instead of the dmenu_run script:
Code:
#!/bin/sh
#
#  This script uses 'dmenu' to provide application launcher
#  and run dialog functionality to the 'dwm' window manager.
#
#  $HOME/.dwm_menu.conf contains a list of executables
#  that will be displayed to the user.
#

conf="$HOME/.dwm_menu.conf"

if [ ! -f "$HOME/.dwm_menu.conf" ] ; then
   echo -e "xterm\nfirefox\nemacs" > "$conf"
fi

if cmd=$( /usr/bin/dmenu "$@" < "$conf" ) ; then
   exec /bin/sh -c "${cmd}"
fi

########################################################################
you can run any command you want from it, or choose one of the pre defined ones in the normal way.
I find the default dmenu_run scripts just returns far too much stuff to be practical.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to run .sh directly without cd to the parent directory? wch705 Linux - Newbie 9 11-08-2011 02:20 AM
how to run a .sh file directly kamesh156 Linux - Software 4 05-21-2009 04:51 PM
can we run the binary file directly kamesh156 Linux - General 1 10-17-2005 07:57 AM
how to run a .sh file directly kamesh156 Linux - General 3 10-13-2005 08:26 AM
how to run a .sh file directly kamesh156 Linux - Software 7 10-10-2005 05:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:08 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration