open-dynamix / raiseorlaunch Goto Github PK
View Code? Open in Web Editor NEWA run-or-raise-application-launcher for i3 window manager.
License: MIT License
A run-or-raise-application-launcher for i3 window manager.
License: MIT License
Right now it uses Popen. It would be beneficial to use i3s mechanism for running commands.
If I run something like
brave --app=https://google.com --window-position=1500,2000 --window-size=80,80
then a chrome/brave window of 80x80 appears in the center of my screen.
However if I run
raiseorlaunch -c some_class -e "brave --app=https://google.com --window-position=1500,2000 --window-size=80,80"
Then the geometry is not respected. Is this a bug or feature? Thanks in advance!
This should be done in a backward compatible way.
As pointed out by @petobens in #27 (comment).
I have this in my i3 config:
bindsym $mod+f exec raiseorlaunch -c firefox -e firefox
assign [class="firefox"] NET
So when I hit mod+f, firefox is started (or focused) in the NET workspace.
However when the NET workspace is not focused, the Firefox window is correctly created in the NET workspace, and then raiseorlaunch
force moves it to current workspace for no reason.
I3 already has everything in place to start windows in specific workspaces, so when I don't use the -w
or -W
parameters, raiseorlaunch
should not interfere with that. Also this sets the urgency hint on the NET workspace (when the window is created), and then move it to the current workspace, which leaves the NET workspace empty with the urgency hint, and is far from ideal.
This is due to this code:
raiseorlaunch/raiseorlaunch/raiseorlaunch.py
Line 523 in ddd5728
Hi!
Thanks for your work on this! It really increases my productivity with i3.
I did run into one issue, that it is impossible to run a command with a space in the name. I tried:
Then I really went out on a limb and tried
Now, I agree that spaces in names are really horrible things :-) but sometimes I just need to work with them.
Thanks so much!
Hi,
I've recently noticed, especially when using two monitors, that the spotify apps seems to steal focus. I have, for instance, the following bindings:
bindsym $mod+Control+m $nexec raiseorlaunch -c Spotify -W $ws3 -e \
"spotify --force-device-scale-factor=2"
bindsym $mod+Control+p $nexec raiseorlaunch -c Zathura -W $ws6 -C
where workspace "ws3" is opened in one monitor and "ws6" in another. If I focus the spotify window with mod+control+m
and then focus zathura with mod+control+p
then the zathura window seems to gain focus (as reported per polybar xwindow module) but I cannot actually use the window (i.e pressing a key doesn't trigger any action on the app). I was able to reproduce this with several apps (i.e switching from spotify to any other app) except for Chromium. Can you check it/reproduce it? Thanks!
I'm using the cycle feature with zathura. Now imagine I have two visible (floating) windows: one my terminal and another one the pdf I'm actually reading. There is also a third floating window with another pdf that is hidden behind the other two. If I have focus on my terminal and run the zathura mapping then raiseorlaunch will automatically cycle to the third window (the second pdf) rather than focusing on the last zathura focued window (my visible pdf). So I was wondering if you could change the behaviour such that when cycling is enabled then the last focused window is first focused and only after that the cycling begins. Please let me know if I explained myself properly.
As always thanks for the help!
Is it possible to launch a script immediately after raising (but not when focusing a program)? My use case is as follows: I wrote a resize.py script to resize my floating windows. Now whenever I launch a program, let's say chromium, I would like the script to be executed on the newly generated/raised window.
For instance I would like top open chromium maximised by doing something like:
bindsym $mod+Control+i $nexec raiseorlaunch -c Chromium -W $ws1 -m browser & resize.py Full
Obviously the & resize.py Full
part doesn't work in the snippet above. Is there a way to achieve this? Note: that the script should only be applied when launching/raising a program and not when focusing it.
Thanks!
BTW: raiseorlaunch has been a life saver (coming from OSX and hammerspoon).
This syntax worked to raise Spotify if it was already running, but crashed instead of launching Spotify when it was not running. If I'm doing something invalid, it would be nice if it failed with a more helpful diagnostic message explaining what was invalid.
Thanks.
h> raiseorlaunch -r -c Spotify
expected string or bytes-like object
Traceback (most recent call last):
File "/usr/bin/raiseorlaunch", line 8, in <module>
sys.exit(main())
File "/usr/lib/python3.8/site-packages/raiseorlaunch/__main__.py", line 222, in main
rol.run()
File "/usr/lib/python3.8/site-packages/raiseorlaunch/raiseorlaunch.py", line 551, in run
self._handle_not_running()
File "/usr/lib/python3.8/site-packages/raiseorlaunch/raiseorlaunch.py", line 515, in _handle_not_running
self.i3.main(timeout=self.event_time_limit)
File "/usr/lib/python3.8/site-packages/i3ipc/connection.py", line 518, in main
raise loop_exception
File "/usr/lib/python3.8/site-packages/i3ipc/connection.py", line 497, in main
while not self._event_socket_poll():
File "/usr/lib/python3.8/site-packages/i3ipc/connection.py", line 477, in _event_socket_poll
raise e
File "/usr/lib/python3.8/site-packages/i3ipc/connection.py", line 474, in _event_socket_poll
self._pubsub.emit(event_name, event)
File "/usr/lib/python3.8/site-packages/i3ipc/_private/pubsub.py", line 28, in emit
s['handler'](self.conn, data)
File "/usr/lib/python3.8/site-packages/raiseorlaunch/raiseorlaunch.py", line 527, in _callback_new_window
if self._compare_running(window):
File "/usr/lib/python3.8/site-packages/raiseorlaunch/raiseorlaunch.py", line 180, in _compare_running
if pattern and not self._match_regex(pattern, value):
File "/usr/lib/python3.8/site-packages/raiseorlaunch/raiseorlaunch.py", line 163, in _match_regex
return True if re.match(*matchlist) else False
File "/usr/lib/python3.8/re.py", line 189, in match
return _compile(pattern, flags).match(string)
TypeError: expected string or bytes-like object
From #15:
I have now the following in my config file:
set $nexec exec --no-startup-id
bindsym $mod+Control+p $nexec raiseorlaunch -c Zathura -e \
"--no-startup-id i3-msg workspace "2" && zathura"
Now imagine that I have 3 Zathura windows opened: 2 in workspace "2" and 1 in workpsace "1". If run the binding then raiseorlaunch will switch focus between the 2 windows in workspace 2 and ignore the one in workspace 1. Is it possible to also include the window in workspace 1 when cycling?
Just like i3run, but I can't get it work for multiple monitors.
Since PyPI now supports markdown, we can move away from rst.
Hey!
I'd love to see support for applying and recalling a window based on con_mark (https://i3wm.org/docs/userguide.html#vim_like_marks). That would allow raiseorlaunch to be used in situations where the window title changes regularly, and the window class is not unique enough. A common situation would be webpages in a web browser. As a concrete example, I can do this:
raiseorlaunch -e "firefox inbox.google.com" -t ".*<email>.*" -i -c firefox
And things work as long as I don't navigate away from google inbox (which is fine). But if i try to do that with the aws console:
raiseorlaunch -e "firefox signin.aws.amazon.com" ...
The aws console does not provide a consistent window title, so there is no way to get the window back.
If raiseorlaunch supported con_marks we could do something like:
raiseorlaunch -e "firefox signin.aws.amazon.com" -m AWS
Then raiseorlaunch
would mark the window on launch and we could recall the window based on the con_mark.
Thanks so much!
Hi! I was wondering if you could add a flag to disable an existing fullscreen in the workspace where the application is going to be launched (if there is any).
Thanks!
Hi!
It looks like -w is not moving the window the the named workspace. Instead it opens the window on the current workspace and then switches the user to the named workspace (but not the window)
Thanks!
(sorry for all the tickets)
Hi! First all thanks for writing raiseorlaunch, it's super useful.
I have one question/request. I have the following binding in my config file:
set $ws1 "1"
bindsym $mod+Control+i $nexec raiseorlaunch -c Chromium -w $ws1
that will open Chromimum on in workspace 1. However if I now move the Chromium window to workspace 2 and then run the binding again then raiseorlaunch opens a new Chromium window/instance in workspace 1. I would like to know if it's possible to add a flag or something that will switch focus to the app if it's already running even if the -w
was specified: i.e focus Chromium window in workspace 1 instead of opening a new one in workspace 2.
Thanks in advance!
Consider the following binding:
set $ws1 "1"
bindsym $mod+Control+l $nexec raiseorlaunch -c Slack -w $ws1
If I run that binding and then switch focus to a workspace other than workspace 1 then Slack (which takes some time to load) actually open on the active workspace and not the the one defined by the -w
flag.
Can this be avoided? Thanks!
Since the main loop from i3ipc now has a timeout parameter we can get rid of the dirty hack to implement it on our side ๐
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.