Code Monkey home page Code Monkey logo

raiseorlaunch's Introduction

I Are Programmer I Make Computer Beep Boop Beep Beep Boop

raiseorlaunch's People

Contributors

desbma avatar open-dynamix avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

desbma petreikis

raiseorlaunch's Issues

Can't specify chrome/brave geometry

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!

Window should not be moved to current workspace

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:

target_ws = self.target_workspace or self.current_ws.name

cannot run commands that contain a space

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:

  • /opt/Pulse SMS/pulse-sms
  • /opt/Pulse\ SMS/pulse-sms
  • '/opt/Pulse SMS/pulse-sms'
  • "/opt/Pulse SMS/pulse-sms"

Then I really went out on a limb and tried

  • /opt/Pulse\\ SMS/pulse-sms
  • "'/opt/Pulse SMS/pulse-sms'" (single quotes surrounded by double quotes)
  • '"/opt/Pulse SMS/pulse-sms"' (double quotes surrounded by single quotes)
  • '"/opt/Pulse SMS/pulse-sms"' (escaped double quotes surrounded by single quotes)
  • "'/opt/Pulse SMS/pulse-sms'" (escaped single quotes surrounded by double quotes)

Now, I agree that spaces in names are really horrible things :-) but sometimes I just need to work with them.

Thanks so much!

spotify steals/locks focus

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!

Don't cycle on initial focus

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!

Run script immediately after launching (raising) a program

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).

crashes when Spotify is closed but not when Spotify is open

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

Window cycling

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?

support for window selection based on con_mark

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!

Add flag to disable existing fullscreen

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!

Don't honor workspace flag if app is running

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!

Wait for app to actually open in specific workspace

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!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.