merovius / shellex Goto Github PK
View Code? Open in Web Editor NEWShell-based launcher
License: Other
Shell-based launcher
License: Other
Since e6e04a2, File::Temp
and File::Basename
are not used anymore. They shouldn't be imported.
fzf
(https://github.com/junegunn/fzf) enables fuzzy-searching the command history (among other things).
When I'm in a regular shell I can hit Ctrl+R and filter with fuzzy-search through previous commands.
Is there a way to achieve this is shellex
?
Thanks
as reported https://aur.archlinux.org/packages/shellex/, there is an install -d
missing in conf.mk. afaiu the missing directory should get created in install-conf
, but since there's no dependency between install-rc
and install-conf
, i must not assume $(DESTDIR)$(SYSCONFDIR)
exists.
When not entering anything, the zsh-config does not work.
Sometimes, we open a launcher with alt+F2 but we need to open terminal-based app.
So, is it possible to make shellex in this situations to autodetect this need and open a terminal with the asked command in it?
As example, supose I try to run vim on shellex, not gvim but vim, so currently nothing happend.
Ideally, shellex should open a urxvt (or other terminal) with vim on it.
currently launching several applications at once fails to quit shellex:
usecase:
Triggered by the investigation of #57 I checked how shellex launches on empty workspaces in lxde/openbox and got as output (with some extra printouts from me):
position should be at the top
Getting shellex-position from focused window
Get outputs
urxvt: An X Error occurred, trying to continue after report.
urxvt: + Serial number of failed request: 136
urxvt: + X Error of failed request: BadValue (integer parameter out of range for operation)
urxvt: + Major opcode of failed request: 12
urxvt: + (which is X_ConfigureWindow)
urxvt: + Value in failed request: 0x0
line is LVDS-1 connected primary 1366x768+0+0 (normal left inverted right x axis y axis) 277mm x 156mm
w=1366 h=768 x=0 y=0
line is VGA-1 connected (normal left inverted right x axis y axis)
w= h= x= y=
line is HDMI-2 connected (normal left inverted right x axis y axis)
w= h= x= y=
Got outputs
Got input focus
not DefaultRootWindow
Focus 12583203 (1x1)
writing max rows file done
loading config
add_lines(string = "%")
resizing to -10
size_change(1366, 174)
add_lines(string = " \r \r\r")
resizing to -10
add_lines(string = "robusta% ")
resizing to -10
add_lines(string = "u")
resizing to -10
add_lines(string = "unset LD_PRELOAD")
resizing to -10
add_lines(string = "\r\r\n")
resizing to -10
add_lines(string = "%")
resizing to -10
add_lines(string = " \r \r\r")
The observations are:
get_outputs
. This surprises me, as the function only parses the output of xrandr -q
(which runs fine when started on its own with a shortcut).$nrows
is greater than 0 don't work (possibly because $ENV{SHELLEX_MAX_ROWS}
is negative).On some systems, there is an X-Error when initiallly configuring the window. The problem is this magic constant, it appears, you have to add some pixels, for some reasons, to the fontheight. 2 works on my system, but not on others, so it seems to be dependent on the font or something. It's a minor nuisance, but we should figure out, why we need that and how to get it at runtime.
In i3 specifically, some apps do not opened in the workspace from whom they were called. It’s a weird behaviour.
So, the solution as described here is still to use exec i3
before the command.
So, it would be useful if shellex allow to define of kind of prefix to execute before each command.
Then the expected behavior would be this one:
randomcommand
;i3 exec randomcommand
.It would be nice if shellex could show some error-output, so that you don't wonder what is happening, if your command does not start.
We have to think about some magic way to determine, wether output is helpfull or the launcher should be hidden immediately.
shellex should be able to have dmenu-like completion, i.e. typing chess
should show a list of all commands containing chess
. The user then should be able to shoose one of them with the cursor-keys and hitting return to start it, or space to input command-line parameters or something like that.
I installed the latest version of shellex (11.05.2014) and I have trouble with the tab-completion shellex offers.
When I try to tabcomplete anything, shellex offers me a list of anything, and then the commandline opens up under these offers, just like the default bash behaviour.
When I then try to tabcomplete anything else, shellex starts to flicker and stops only after pressing a button, or has to be killed manually, and does not tabcomplete.
Since this is one of the major features of shellex, it would be nice if this issue could be resolved.
We have some debug output. We should define a debug-level environment variable and log conditionally
I have installed shellex on my Arch Linux system, which uses wayland with sway. Shellex sometimes (I think in like 10% of the cases I press the key binding) starts as a fullscreen urxvt terminal. Screenshot (taken right after the keybinding for shellex, in a fresh and empty workspace): http://oi65.tinypic.com/241qyv6.jpg
Even if the terminal shows up as a bar at the top of the screen (as intended), a bigger terminal window sometimes flashes for a tiny moment. The problem seems to occur mostly (but not exclusively) when I start shellex (by pressing the keybinding) for the first time in a new/fresh workspace.
I'm not sure if this is related to (or maybe even covered by) #21. More details will be provided if demanded.
Edit: I was sloppy in the original post. In X11, shellex seems to work properly. This issue seems to be (contrary to what I wrote in the first version) exclusive to wayland (possibly to sway).
I've created a Gentoo Overlay containing shellex: http://github.com/Proxypoke/gentoo-overlay. I'll try to see how and if I can get shellex into the main portage tree.
The dmenu-like completion from #4 should also incorporate .desktop-files
I assume this is, because xbindkeys grabs the keyboard, which is why our grab fails.
Once we are decided on how to bundle/distribute shellex, we should stop hardcoding any paths.
I have this in my zshrc, but it does not get picked up when using shellex.
Maybe it’s a feature that we should offer regardless of whether the user has it in her zsh configuration, and just put it into the shellex config?
http://michael.stapelberg.de/Artikel/zsh_recent_completion
This is super useful for me. It enables use cases such as “open the most recently downloaded file in evince”.
It is not currently possible to have multiple lines in a command (usefull for e.g. loops) due to shellex wrapping every line in it's magic. Maybe we can think of a way to allow this in the future.
shellex should get a list of the randr-outputs, decide on which of them to show the launcher (and at the same time not hardcode the width of the screen).
I'd really love to see support for custom zsh configuration, as I have customized autocompletion configured.
I tried to remove the -f
from shellex.in
and it works like a charm. Is there a good reason for the -f
to be present or can it just be omitted?
(e.g. try kill<tab><tab>
)
We desperately need to support history. Just adding the HISTFILE etc. options to the config does not appear to work for me, that has to be troubleshooted.
upon modifying urxvt/shellex.in
to
sub get_outputs {
my @outputs = ();
for my $line (qx(xrandr -q)) {
next unless $line =~ /\sconnected/;
my ($w, $h, $x, $y) = ($line =~ /(\d+)x(\d+)\+(\d+)\+(\d+)/);
print "line is $line w=$w h=$h x=$x y=$y\n";
push @outputs, { w => $w, h => $h, x => $x, y => $y };
}
return @outputs;
}
I observe output like:
line is LVDS-1 connected primary 1366x768+0+0 (normal left inverted right x axis y axis) 277mm x 156mm
w=1366 h=768 x=0 y=0
line is VGA-1 connected (normal left inverted right x axis y axis)
w= h= x= y=
line is HDMI-2 connected (normal left inverted right x axis y axis)
w= h= x= y=
I.e. connected monitors that are not enabled end up as outputs with invalid
geometry. Looking through the help message of xrandr
this could be replaced
by
sub new_outputs {
my @outputs = ();
for my $line (qx(xrandr --listactivemonitors)) {
next if $line =~ /Monitors: /;
# output format is ' 0: +*LVDS-1 1366/277x768/156+0+0 LVDS-1'
my ($w, $h, $x, $y) = ($line =~ /(\d+)\/\d+x(\d+)\/\d+\+(\d+)\+(\d+)/);
#print "line is $line w=$w h=$h x=$x y=$y\n";
push @outputs, { w => $w, h => $h, x => $x, y => $y };
}
return @outputs;
}
This parses fewer lines with less input that shellex ignores and does the
filtering of connected devices and active devices on the xrandr
side.
Reviewing #66 , I noticed $thefiles
leaks into the shellex command
line. It does not make it to the child process (cat $thefiles > /tmp/test
yields and empty file) but echo $thefi⇥
completes the
variable name and echo ${f}⇥
substitutes it. Declaring them local
(local -a thefiles
) is not an ad-hoc solution as they get solved. Atm
unset thefiles
at the end of shellexrc
seems good to me, but not to
interfere with possible user variables, I would prefer namespacing the
shell variables in addition. Following typical completion functions,
that would involve leading underscores in the variable name, and
probably even shellex
in the name.
I thought a bit if not-unsetting them and make them accessible to the
user (for whatever they would want to do with them … debugging?) but
since the behaviour is inconsistent (accessible to tabbing,
inaccessible to processes), I assume it's not worth it.
Though we pass the -name parameter to urxvt, it does not stop it from using the existing urxvt-resources. In some setups this messes up the display of shellex (because we pass -bg and -fg)
Urxvt is setgid utmp in a recent versions. This causes ld.so to ignore LD_PRELOAD, which means we can't lie to the shell about how big the terminal really is, which breaks shellex. This might be the cause of #30.
We need to figure out a way to deal with this. urxvt needs to be setgid utmp, so we need to find a way different from LD_PRELOADing into urxvt to make this work. Options might be:
When tab-completion has multiple lines of suggestions or the command contains multiple lines, the urxvt-window should dynamically grow and shrink to accomodate the change.
The current empty line treatment is to use ZLE to replace empty lines by exit and then execute exit.
This adds 'exit' to the shellex history. It would be nicer if the behaviour would be similar to pushing escape, which does not leave a trace in the history.
When starting shellex and moving the mouse, focus is sometimes lost.
Long version:
Settings: Archlinux with i3wm with focus_follows_mouse set to no (so mouse movement should not cause focus changes).
When I start shellex (press $mod+d which causes i3wm to do exec /usr/bin/shellex), it launches and I can enter text. However, when I move the mouse the slightest, or if there are no other windows in this workspace, focus is immediateley lost. To regain control of shellex, I have to move the mouse over it.
Hi
I was browsing launchers and saw this but the thing is that nos creenshot is provided which makes it hard to judge what it is all about.
thanks
When using shellex (in this case with bspwm), there is the possibility that shellex does not find the display dimensions. In this case, setting shellex to appear on the bottom edge puts it in an inaccurate position, with no way (That I am able to see) to change this behavior short of compiling from source with manual edits done to the defaults defined here.
This could presumably be resolved by optionally reading these defaults from .Xresources
in the same way that edge
and pos
are.
I did a fresh install of Arch Linux with i3gaps. I installed shellex via the Arch User Repository (AUR), and configured i3 to bind alt+d to shellex.
When I press alt+d, a dark bar is visible at the top of my screen for about 0.1 second. Running shellex from the terminal gives the following output:
ruben@T410 » shellex ~
position should be at the top
Getting shellex-position from focused window
size_change(1440, 15)
urxvt: An X Error occurred, trying to continue after report.
urxvt: + Serial number of failed request: 147
urxvt: + X Error of failed request: BadValue (integer parameter out of range for operation)
urxvt: + Major opcode of failed request: 12
urxvt: + (which is X_ConfigureWindow)
urxvt: + Value in failed request: 0x0
line_update(row = 0)
resizing to 1
size_change(1440, 17)
line_update(row = 1)
resizing to 1
line_update(row = 2)
resizing to 1
line_update(row = 3)
resizing to 1
(the line_update(row=..) and resizing continues until row = 23).
For me, commenting out the first line of the shellex script in /usr/bin/shellex, fixes the issue (that is, I put changed the line
LD_PRELOAD="/usr/lib/shellex/shellex_preload.so"
to
# LD_PRELOAD="/usr/lib/shellex/shellex_preload.so"
So I do have a workaround for this issue (although I haven't tested it thoroughly). I am reporting this issue just for the record. I can't change the status of this issue myself, so it's "open" for now. I figured that LD_PRELOAD might be doing something important, so it's possible that I will run into other issues as a result later.
replacing urxvt
by urxvtc
in shellex.in
(and running urxvtd
) it appears the shellex size file never gets filled, and subsequently the size file doesn't get unlinked.
I have bound that key in i3 to execute a screenshot-shellscript. This is what strace prints when pressing the prntscrn key:
recvfrom(7, 0x25d8c04, 4096, 0, 0, 0) = -1 EAGAIN (Resource temporarily unavailable)
epoll_wait(3, {{EPOLLIN, {u32=7, u64=4294967303}}}, 64, 59743) = 1
recvfrom(7, "\3\0261\1\221\256w\17\215\0\0\0\20\0\0\2\0\0\0\0\310\1$\3\305\1\370\376\0\0\1\0", 4096, 0, NULL, NULL) = 32
recvfrom(7, 0x25d8c04, 4096, 0, 0, 0) = -1 EAGAIN (Resource temporarily unavailable)
recvfrom(7, 0x25d8c04, 4096, 0, 0, 0) = -1 EAGAIN (Resource temporarily unavailable)
epoll_wait(3, {{EPOLLIN, {u32=7, u64=4294967303}}}, 64, 59743) = 1
recvfrom(7, "\2k1\1\271\262w\17\215\0\0\0\20\0\0\2\0\0\0\0\310\1$\3\305\1\370\376\0\0\1\0", 4096, 0, NULL, NULL) = 32
recvfrom(7, 0x25d8c04, 4096, 0, 0, 0) = -1 EAGAIN (Resource temporarily unavailable)
pipe2([10, 11], O_CLOEXEC) = 0
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f4aff19ead0) = 20942
close(10) = 0
fcntl(11, F_SETFD, 0) = 0
fstat(11, {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f4aff1d1000
write(11, "shellex> \n", 11) = 11
close(11) = 0
wait4(20942, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 20942
--- SIGCHLD (Child exited) @ 0 (0) ---
rt_sigreturn(0x100) = 20942
munmap(0x7f4aff1d1000, 4096) = 0
recvfrom(7, 0x25d8c04, 4096, 0, 0, 0) = -1 EAGAIN (Resource temporarily unavailable)
epoll_wait(3, {}, 64, 0) = 0
This is rather unexpected. shellex should only grab keys zsh actually handles and pass the rest through.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.