You are not logged in.

#1 2010-08-21 10:29:17

hbekel
Member
Registered: 2008-10-04
Posts: 311

bashrun 1.0 rc2 -- complete rewrite, needs testing

Dear fellow archers,

About two years ago I posted an early version of bashrun on these forums. Bashrun is a versatile application laucher based on bash, using a small, one-line terminal window for it's user interface to provide a simple run-dialog.

The positive response I got here convinced me of properly publishing and developing it further. Credits are due to Ghost1227, Shapeshifter, DieterBe and lots of others from the Arch Community. Without your support and feedback, I would probably have forgotten about bashrun soon.

Unfortunately, my bash scripting skills were next to non-existent by the time i wrote the first version, and thus the current version of bashrun (0.16) suffers from a lot of shortcomings and ugly hacks. So I decided to do a complete rewrite to do it properly and implement a lot of stuff I had in mind for it.

I've now arrived at a release candidate for what I plan to become bashrun 1.0. I feel that I need some more testing before releasing it properly, since I can't possibly test it under all environments with every suited terminal out there... so I need your help! Please use the PKGBUILD provided below to install it. Note that the release candidate won't touch any existing config files from earlier versions, so you can simply downgrade again if you run into problems or just don't like it.

Some of the features and benefits bashrun 1.0 provides:

* An application launcher that works like bash, simply because it is bash. Completion, history, aliases are thus supported out of the box already.
* Launch graphical and terminal applications from any terminal, either by using a full-fledged bashrun session in a regular terminal or by sourcing a lightweight remote interface.
* Launch terminal/console apps in dedicated terminals, e.g. use a different terminal program for certain apps or use different font and geometry settings.
* Rewrite non-executable command lines using regular expressions and substitution, along with a simple interface to programmable completion, e.g add web shortcuts, file associations, special rules for certain commands, etc.
* Add your own actions, i.e. change and extend the core functionality of bashrun.
* Write plugins implementing new actions, handlers, rules etc. and share them with other users... (pacman/abs/aur plugin anyone?)
* Use bashrun as a lightweight replacement for graphical su frontends like gksu or kdesu. (see bashrun --help)
* Better suited for use in tiling wms (Tip: use urxvt, with -override-redirect to make bashrun float)
* Generalized terminal support -- you tell bashrun how to use the terminal of choice
* Now comes with it's own little helper application for window management -- no xdotool required anymore
* Uses GNU autotools for installation
* ...

In general, bashrun provides different kinds of configuration objects that can be used to implement a great variety of helpful features. Note that by simply adding 'eval "$(bashrun --remote-control)"' to your bashrc you will get remote access to all of bashrun's features from any terminal on your desktop. This is a feature I personally can't live without anymore. For example, consider the following bits of configuration:

+rule su-run
      --match '/^emacs +/etc//'

+rule su-term-notify 
      --match '/^/etc/rc.d/' '/^/etc/cron\..+/'

Now any command that begins with 'emacs /etc' will automatically be run as root, prompting me for the root password using the bashrun terminal window. Likewise, any command beginning with '/etc/rc.d', '/etc/init.d' or '/etc/cron.d' will be launched as root, it's output shown in a small terminal that automatically closes two seconds after the command is finished. But enough of this...

What you can do to help
Be sure to read the "Getting Started" section of the manual page and take a look at the system-wide config file located at /etc/xdg/bashrun/bashrun.rc. The latter is extensively commented and contains a lot of examples, and should give you an idea of what bashrun is capable of. Also, press F1 in bashrun to view a list of keybindings.

Any kind of feedback will be helpful. I've tried to make the manual as concise as possible, but it's probably far from perfect. If there's anything unclear or doesn't work as expected, please complain. If you don't feel like digging very deep, a simple "Runs fine in KDE and urxvt" is just as good, though.

Installation
This PKGBUILD should be all you need to get going:

pkgname=bashrun
pkgver=1.0.0rc2
pkgrel=1
pkgdesc="Launch applications from interactive bash sessions"
arch=('i686' 'x86_64')
url="http://bashrun.sourceforge.net"
license=('GPL2')
depends=('bash' 'libx11')
source=(http://bashrun.sourceforge.net/${pkgname}-${pkgver}.tar.gz)
md5sums=('f2879c71152713dbe8190f84949e219c')

build() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  ./configure --prefix=/usr --sysconfdir=/etc
  make || return 1
}

package() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  make DESTDIR="${pkgdir}" install
}

Note that the first startup may be somewhat slow. This will improve once the configuration has been cached.

Thanks in advance, and have fun!
Best regards,
Henning

EDIT: I've created a second release candidate, fixing a bug that would plugin lookups fail when multiple directories where present in XDG_CONFIG_DIRS. The PKGBUILD given in this post has been updated accordingly. The tarball is available at http://bashrun.sourceforge.net/bashrun-1.0.0rc2.tar.gz

Last edited by hbekel (2010-10-05 16:55:11)

Offline

#2 2010-08-21 13:42:16

livibetter
Member
From: Taipei
Registered: 2008-05-14
Posts: 95
Website

Re: bashrun 1.0 rc2 -- complete rewrite, needs testing

I have never heard of Bashrun before until I read this topic. After I downloaded and installed it, I immediately love it after I saw *HANDLERS*. I now use it as my bookmark opener as well, for example, I have ` '^t gm()' "$BROWSER 'https://mail.google.com/mail'"` to open Gmail, just type 't gm' to open. It makes easier to open a bookmark in Chromium as I did in Vimperator, though it's not the same but closer.

I used to use one called BashPad, which is developed by a Gentoo user (I'm one, too. I am using Bashrun on my Gentoo). I have set it up (with --prefix=/home/username) without any problems with Fluxbox. After I tried it, I decided to replace BashPad with Bashrun. I don't have xdotool installed since the version (~1.20100318.2737) is older than the requirement (>=1.20100416.2809) in Portage tree, but I don't think the loading really takes too long. It's less about a second until I see the prompt '>'. I can live with that.

Anyway, Bashrun is a great and thanks for the nice work!

(PS. there are still a lot of features I don't know about, need to dig in more)

Last edited by livibetter (2010-08-21 13:42:41)

Offline

#3 2010-08-21 14:15:25

hbekel
Member
Registered: 2008-10-04
Posts: 311

Re: bashrun 1.0 rc2 -- complete rewrite, needs testing

livibetter wrote:

I have never heard of Bashrun before until I read this topic. After I downloaded and installed it, I immediately love it after I saw *HANDLERS*. I now use it as my bookmark opener as well, for example, I have ` '^t gm()' "$BROWSER 'https://mail.google.com/mail'"` to open Gmail, just type 't gm' to open.

Glad you like it, but it sounds like you've installed the legacy version (0.16), while this thread was intended to advertise the new generation version 1.0.0 rc1. For non-archlinux users, the tarball is at http://bashrun.sourceforge.net/bashrun-1.0.0rc1.tar.gz. For a manual install, use

$ ./configure --prefix=/usr --sysconfdir=/etc
$ make
$ sudo make install

See the README for details.

In the new version, a handler like you mentioned will look like this:

+handler gmail
  --match '^t gm'
  --command 'https://mail.google.com/mail'
  --action 'browse'

I hadn't heard of BashPad yet. I briefly skimmed the source file and it looks a lot like early versions of bashrun wink

Offline

#4 2010-08-21 14:41:21

livibetter
Member
From: Taipei
Registered: 2008-05-14
Posts: 95
Website

Re: bashrun 1.0 rc2 -- complete rewrite, needs testing

hbekel wrote:

Glad you like it, but it sounds like you've installed the legacy version (0.16), while this thread was intended to advertise the new generation version 1.0.0 rc1. For non-archlinux users, the tarball is at http://bashrun.sourceforge.net/bashrun-1.0.0rc1.tar.gz. For a manual install, use

You are right, I didn't notice it before. I downloaded the 1.0 rc1, but I couldn't configure it right. It's too different, still trying to get the window setting right. I think I will stick with 0.16 now until I have time to look into the new configuration when I have time.

(edit: the loading is taking two or more seconds. Maybe it's really have too many features?)

Last edited by livibetter (2010-08-21 14:52:23)

Offline

#5 2010-08-21 16:06:02

hbekel
Member
Registered: 2008-10-04
Posts: 311

Re: bashrun 1.0 rc2 -- complete rewrite, needs testing

livibetter wrote:

(edit: the loading is taking two or more seconds. Maybe it's really have too many features?)

Note that those two seconds are used only for initialization. Once a bashrun session is running, the window will simply be hidden after every command, and shown again if you run "bashrun" the next time. This takes ~0.01 seconds on my machine.

Offline

#6 2010-10-04 20:16:08

riivo
Member
Registered: 2008-08-25
Posts: 112

Re: bashrun 1.0 rc2 -- complete rewrite, needs testing

Thumbs up from me. I'm still configuring it, but it perfectly replaces gmrun even in default settings. Hopefully the new version hits [community] soon.

Last edited by riivo (2010-10-04 20:16:28)

Offline

#7 2010-10-04 20:25:56

cesura
Package Maintainer (PM)
From: Tallinn, Estonia
Registered: 2010-01-23
Posts: 1,867

Re: bashrun 1.0 rc2 -- complete rewrite, needs testing

riivo wrote:

Thumbs up from me. I'm still configuring it, but it perfectly replaces gmrun even in default settings. Hopefully the new version hits [community] soon.

There's a new version? tongue The SF page says the latest is 0.16, which matches the one in [community].

Offline

#8 2010-10-04 20:50:40

hbekel
Member
Registered: 2008-10-04
Posts: 311

Re: bashrun 1.0 rc2 -- complete rewrite, needs testing

itsbrad212 wrote:
riivo wrote:

Thumbs up from me. I'm still configuring it, but it perfectly replaces gmrun even in default settings. Hopefully the new version hits [community] soon.

There's a new version? tongue The SF page says the latest is 0.16, which matches the one in [community].

Well yeah, I haven't released "officially" yet, because I'm somewhat in doubt whether it isn't over-engineered (maybe adding an oop layer to bash was a bad idea, after all)... and I'm also unsure about releasing this rewrite as a 1.0 version, since it will be disruptive for users who already use bashrun, and I'm not sure whether most people even need all the new features.

It has become quite complicated, but on the other hand, it does some very nice things (i think). And it's generally more robust than the "legacy" version. Still, might be just my little pet project... since a lot of the stuff it provides can be done in pure bash by users comfortable with a little bash scripting. I'm not sure if this isn't just a horrible case of feature creep wink

That's why I just announced it here, to get some feedback, but I didn't get much, so I kinda forgot about it...

I get very little feedback in general, so I'm not sure at all whether users of the old version even use all it's fancy features, or whether they are just happy with a launcher that has history and completion.

So I'm somewhat lost here...

So please, if you're using this, send some feedback (positive and negative) my way.

@riIvo: Glad you like it smile

Thanks,
Henning

Offline

#9 2010-10-05 11:14:34

Dieter@be
Forum Fellow
From: Belgium
Registered: 2006-11-05
Posts: 2,001
Website

Re: bashrun 1.0 rc2 -- complete rewrite, needs testing

oh man.  My approach to understanding tools like these is reading all the source code, it sure looks pretty complex tongue
what's brwctl ? it's a binary but does not have a manpage.


< Daenyth> and he works prolifically
4 8 15 16 23 42

Offline

#10 2010-10-05 11:38:36

bernarcher
Forum Fellow
From: Germany
Registered: 2009-02-17
Posts: 2,281

Re: bashrun 1.0 rc2 -- complete rewrite, needs testing

I tried it for about a week but then gave up. It was too tedious to configure for it's value. For what I need 0.16 fits perfectly.


To know or not to know ...
... the questions remain forever.

Offline

#11 2010-10-05 12:32:09

demian
Member
From: Frankfurt, Germany
Registered: 2009-05-06
Posts: 709

Re: bashrun 1.0 rc2 -- complete rewrite, needs testing

That's a very nice app.
After installing it, i had to create /etc/bashrun and copy the content of /etc/xdg/bashrun to that folder.
I'd prefer if that step were already integrated into the makefile/pkgbuild, preferably using ~/.config/ instead of /etc/.

Also, if I start bashrun via Openbox shortcut (

<keybind key="A-space">
        <action name="Execute">
        <execute>bashrun</execute>
      </action>
    </keybind>

), it produces an error message:
656fxt.jpg
After i click OK in that error message window bashrun finally starts.
That error occurs because bashrun is started by Openbox without the XDG_CONFIG_DIRS variable.
I'm currently avoiding this issue by placing the bashrun.rc in ~/.config/bashrun/ and commenting out line 12 (+plugins terminal) but maybe that's something you want to have a look at.

Also, i suppose, there is no easy way of making this use zsh instead of bash?

Regards,
demian

Last edited by demian (2010-10-05 12:54:54)


no place like /home
github

Offline

#12 2010-10-05 12:51:28

hbekel
Member
Registered: 2008-10-04
Posts: 311

Re: bashrun 1.0 rc2 -- complete rewrite, needs testing

Dieter@be wrote:

oh man.  My approach to understanding tools like these is reading all the source code, it sure looks pretty complex tongue
what's brwctl ? it's a binary but does not have a manpage.

brwctl is just a little c helper program to do the window management ("bashrun window control") and get rid of the xdotool dependency. While xdotool is a nice tool, it has had some backwards-incompatible changes in the past, and only provides a --version option recently, so the code used to check for a specific version became quite ugly for bashrun 0.16. I should probably mention it somewhere in the man page.

And yeah, the code is complex, and sure misses a HACKING file giving pointers and more comments. If you want to get into it, start at the "§engine.action" function in /usr/share/bashrun/engine. It's the main entry point. Turning on debug mode should help somewhat, too.

In any case, the manual should be sufficient to get started. But feel free to ask any questions you have about the code smile

Offline

#13 2010-10-05 13:00:44

hbekel
Member
Registered: 2008-10-04
Posts: 311

Re: bashrun 1.0 rc2 -- complete rewrite, needs testing

bernarcher wrote:

I tried it for about a week but then gave up. It was too tedious to configure for it's value. For what I need 0.16 fits perfectly.

Would you mind posting/sending me your 0.16 config so that i can see what features you're using? Also, I'm always happy to help out with configuring it.

Since I wrote it, a lot of things seem pretty obvious to me, so it's hard to judge where I may have failed to give enough info, or whether it's just gotten too complex. If you just want to keep 0.16, that's fine with me, of course. In any case, thanks for the feedback smile

Offline

#14 2010-10-05 13:18:30

hbekel
Member
Registered: 2008-10-04
Posts: 311

Re: bashrun 1.0 rc2 -- complete rewrite, needs testing

demian wrote:

That's a very nice app.
After installing it, i had to create /etc/bashrun and copy the content of /etc/xdg/bashrun to that folder.
I'd prefer if that step were already integrated into the makefile/pkgbuild, preferably using ~/.config/ instead of /etc/.

This shouldn't be necessary if bashrun was configured with --sysconfdir=/etc, like in the PKGBUILD i posted. This is explained in the README file. (EDIT: Or your XDG_CONFIG_DIRS is set to "/etc" instead of "/etc/xdg", in which case bashrun expects the config file at "/etc/bashrun/bashrun.rc". Please check.)

No package should install anything to the user's home directory, so I provide a system wide config file to start from. I could copy the config file to the user's XDG_CONFIG_HOME on first startup, but a lot of people don't like that, and it's considered bad taste. (See rmshit for example). Other projects like openbox or awesome don't do this either, it's up to the user.

demian wrote:

Also, if I start bashrun via Openbox shortcut (...) it produces an error message:
(...)
After i click OK in that error message window bashrun finally starts.
That error occurs because bashrun is started by Openbox without the XDG_CONFIG_DIRS variable.
I'm currently avoiding this issue by placing the bashrun.rc in ~/.config/bashrun/ and commenting out line 12 (+plugins terminal) but maybe that's something you want to have a look at.

Yes, this is a bug i discovered recently. I'll post an rc2 version here soon, please stay tuned.

Apart from this bug, bashrun doesn't care whether the XDG variables are actually defined, it uses the defaults in that case (as required by the xdg spec). Your XDG vars should be set to the defaults from /etc/profile.d/xorg.sh in any case, though.

demian wrote:

Also, i suppose, there is no easy way of making this use zsh instead of bash?

No, that may be a long term goal, if it's possible at all. (I know nothing about zsh, and bashrun uses some very bash specific features)

Last edited by hbekel (2010-10-05 13:30:01)

Offline

#15 2010-10-05 13:25:13

demian
Member
From: Frankfurt, Germany
Registered: 2009-05-06
Posts: 709

Re: bashrun 1.0 rc2 -- complete rewrite, needs testing

Thanks for the reply. I'm looking forward to RC2 and especially exploring the handler feature. Apart from the described issue bashrun runs fine here in Openbox with urxvt.

hbekel wrote:
demian wrote:

That's a very nice app.
After installing it, i had to create /etc/bashrun and copy the content of /etc/xdg/bashrun to that folder.
I'd prefer if that step were already integrated into the makefile/pkgbuild, preferably using ~/.config/ instead of /etc/.

This shouldn't be necessary if bashrun was configured with --sysconfdir=/etc, like in the PKGBUILD i posted. This is explained in the README file.

I tried it with both the PKGBUILD and manually with the configure options posted by you, before posting here. I still had to do those steps though.

hbekel wrote:

(EDIT: Or your XDG_CONFIG_DIRS is set to "/etc" instead of "/etc/xdg", in which case bashrun expects the config file at "/etc/bashrun/bashrun.rc". Please check.)

That's it! XDG_CONFIG_DIRS="$HOME/.config:/etc".
Sorry, i was under the impression /etc was a default just like $HOME/.config.

Also, iirc, rmshit is referring to applications that install files directly into $HOME, making a ls -a very confusing. I always thought placing the config files in a subdir in $HOME/.config was a widely accepted/preferred practice - but then again i might be confusing things.

Last edited by demian (2010-10-05 13:36:52)


no place like /home
github

Offline

#16 2010-10-05 13:36:47

hbekel
Member
Registered: 2008-10-04
Posts: 311

Re: bashrun 1.0 rc2 -- complete rewrite, needs testing

demian wrote:

I tried it with both the PKGBUILD and manually with the configure options posted by you, before posting here.
I still had to do those steps.

Also, iirc, rmshit is referring to applications that install files directly into $HOME, making a ls -a very confusing. I always thought placing the config files in the subdir $HOME/.config was a widely accepted practice but maybe I'm confusing things here.

I just edited my above post...

Maybe your XDG_CONFIG_DIRS is set to "/etc" instead of "/etc/xdg", in which case bashrun would expect the config file at "/etc/bashrun/bashrun.rc". Please check. Otherwise I can't reproduce this.

I mentioned rmshit just as an example. You're right, it doesn't mention copying files to .config explicitly. But it's still common (and good taste in my opinion) to leave that to the user.

Oh, and you don't need the "terminal" plugin to use handlers, (it's just for running bashrun in a "proper" terminal. See the GETTING STARTED section in the manual for details.)

Last edited by hbekel (2010-10-05 13:38:09)

Offline

#17 2010-10-05 13:39:00

demian
Member
From: Frankfurt, Germany
Registered: 2009-05-06
Posts: 709

Re: bashrun 1.0 rc2 -- complete rewrite, needs testing

Yes, i just saw it and edited my last post too tongue.
I caused the problem myself, as usual.

Edit: There's no confusion about the handler feature. I just mentioned it as an example of a feature I'm looking forward to exploring. It's what got my interested in bashrun in the first place since I've been using gmrun until now which isn't anywhere as customizable/feature rich.

Last edited by demian (2010-10-05 13:43:36)


no place like /home
github

Offline

#18 2010-10-05 13:43:30

hbekel
Member
Registered: 2008-10-04
Posts: 311

Re: bashrun 1.0 rc2 -- complete rewrite, needs testing

demian wrote:
hbekel wrote:

(EDIT: Or your XDG_CONFIG_DIRS is set to "/etc" instead of "/etc/xdg", in which case bashrun expects the config file at "/etc/bashrun/bashrun.rc". Please check.)

That's it! XDG_CONFIG_DIRS="$HOME/.config:/etc".
Sorry, i was under the impression /etc was a default just like $HOME/.config.

Uh, that's not right at all. XDG_CONFIG_DIRS contains system-wide config dirs, defaulting to "/etc/xdg". XDG_CONFIG_HOME is assumed to default to "$HOME/.config" if not set. Having $HOME/.config in XDG_CONFIG_DIRS may well confuse other applications, too, as they might want to look for a system-wide config explicitly but will find your user config file first. See the xdg spec for details.

Offline

#19 2010-10-05 13:50:49

demian
Member
From: Frankfurt, Germany
Registered: 2009-05-06
Posts: 709

Re: bashrun 1.0 rc2 -- complete rewrite, needs testing

Okay, thanks for clearing that up. I better stop going offtopic now.


no place like /home
github

Offline

#20 2010-10-05 16:56:01

riivo
Member
Registered: 2008-08-25
Posts: 112

Re: bashrun 1.0 rc2 -- complete rewrite, needs testing

Could you please make the Esc key also to unmap the window?

Offline

#21 2010-10-05 16:56:59

hbekel
Member
Registered: 2008-10-04
Posts: 311

Re: bashrun 1.0 rc2 -- complete rewrite, needs testing

A second release candidate has been made available, fixing the bug reported by demian. Please see my recent edit to the original post.

Offline

#22 2010-10-05 17:18:19

hbekel
Member
Registered: 2008-10-04
Posts: 311

Re: bashrun 1.0 rc2 -- complete rewrite, needs testing

riivo wrote:

Could you please make the Esc key also to unmap the window?

No, I can't. In bash, the escape key is equivalent to Alt (meta, to be precise). E.g. pressing M-Enter is equivalent to first pressing Escape and then enter. Thus Escape is somewhat like a modifier in bash and can't be bound on it's own.

The only way I know to work around this is a crude hack described here: http://bashrun.sourceforge.net/faq.htm

The basic principle should also work for the rc version, but I haven't tested this yet. Thinking about it, there may be a less ugly way to do this, I'll see if I can come up with something better...

Last edited by hbekel (2010-10-05 17:18:57)

Offline

#23 2010-10-05 17:25:06

quigybo
Member
Registered: 2009-01-15
Posts: 223

Re: bashrun 1.0 rc2 -- complete rewrite, needs testing

hbekel wrote:

I get very little feedback in general, so I'm not sure at all whether users of the old version even use all it's fancy features, or whether they are just happy with a launcher that has history and completion.

So please, if you're using this, send some feedback (positive and negative) my way.

Happy user of 0.16 here, all I'm after is a pop-up run dialog with history and completion. I gave 1.0 a quick whirl but prefer the simplicity of 0.16.

hbekel wrote:

Well yeah, I haven't released "officially" yet, because I'm somewhat in doubt whether it isn't over-engineered (maybe adding an oop layer to bash was a bad idea, after all)... and I'm also unsure about releasing this rewrite as a 1.0 version, since it will be disruptive for users who already use bashrun, and I'm not sure whether most people even need all the new features.

Maybe calling it bashrun2 is the way to go, as I'm sure there are users who do like the new version better. It would be a shame to write something and not release it. smile

Offline

#24 2010-10-05 17:35:34

Erus_Iluvatar
Wiki Admin
Registered: 2010-04-01
Posts: 124

Re: bashrun 1.0 rc2 -- complete rewrite, needs testing

Can't get used to it. 0.16 rules here.


I'm french, don't mind my mistakes in english.

Offline

#25 2010-10-05 20:55:39

hbekel
Member
Registered: 2008-10-04
Posts: 311

Re: bashrun 1.0 rc2 -- complete rewrite, needs testing

quigybo wrote:

Maybe calling it bashrun2 is the way to go, as I'm sure there are users who do like the new version better. It would be a shame to write something and not release it. smile

I hadn't thought about that yet, but it sounds like a good idea. I could make a clean cut and let users decide what they want. Thanks for the suggestion, quigybo smile

I'll sleep over this and decide what to do. If you have an opinion, I'd be glad to hear it, of course smile

So thanks for your feedback, everyone. If you have any questions, feel free to ask them here, or just send me a mail. I'm always willing to help out.

Regards,
Henning

Offline

Board footer

Powered by FluxBB