LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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,882
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
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 (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
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: 6,897

Rep: Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019
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



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 03:44 PM.

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