-
Notifications
You must be signed in to change notification settings - Fork 170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
hide or show a program #2318
Comments
You could minimize or restore an animation, is that what you're looking for? |
no not entirely, I really like drop-down terminals, on hyprland I was able to use hdrop. |
Ok, I see, you'll have to write a custom plugin for that. It shouldn't be too hard to implement, though. |
Well, I didn't succeed at the moment. it would be practical to be able to write the IPC rules more simply for noobs like me 😅 |
Do you use the minimization feature in general? |
very little, but it is present and works |
I think in general it would be cool to have a proper plugin which does this, in the meantime I hacked together a script to kind-of achieve what you want. The catch: in order to be able to easily recognize the terminal, make sure to use a terminal for the drop down that you don't usually use (in this example I used foot, feel free to customize the script): #!/usr/bin/python3
import json
import subprocess
import os
import time
from wayfire_socket import *
addr = os.getenv('WAYFIRE_SOCKET')
sock = WayfireSocket(addr)
TERMINAL_APPID = "foot"
TERMINAL_CMD = "foot"
def find_view():
hidden_view = None
shown_view = None
# First look for a view which is minimized and matches
views = sock.list_views()
for v in views:
if v['app-id'] == TERMINAL_APPID and v['minimized']:
hidden_view = v
elif v['app-id'] == TERMINAL_APPID:
shown_view = v
return hidden_view, shown_view
def show_view(hidden_view):
print("Showing view ", hidden_view)
# We have our view, just bring it to the front and center it
msg = get_msg_template('wm-actions/set-minimized')
msg['data']['view_id'] = hidden_view['id']
msg['data']['state'] = False
print(sock.send_json(msg))
msg = get_msg_template('window-rules/get-focused-output')
output = sock.send_json(msg)['info']
print(output)
msg = get_msg_template('window-rules/configure-view')
msg['data']['id'] = hidden_view['id']
msg['data']['output_id'] = output['id']
# Center on current output
msg['data']['geometry'] = {}
msg['data']['geometry']['x'] = output['workarea']['x'] + output['workarea']['width'] // 2 - hidden_view['geometry']['width'] // 2
msg['data']['geometry']['y'] = output['workarea']['y'] + output['workarea']['height'] // 2 - hidden_view['geometry']['height'] // 2
msg['data']['geometry']['width'] = hidden_view['geometry']['width']
msg['data']['geometry']['height'] = hidden_view['geometry']['height']
print("want to configure with ", json.dumps(msg,indent=4))
print(output['workarea'])
print(sock.send_json(msg))
def hide_view(shown_view):
print("Hiding view ", shown_view)
# Hide existing view
# We have our view, just bring it to the front and center it
msg = get_msg_template('wm-actions/set-minimized')
msg['data']['view_id'] = shown_view['id']
msg['data']['state'] = True
sock.send_json(msg)
hidden_view, shown_view = find_view()
if not shown_view and not hidden_view:
print("Starting a new view")
subprocess.Popen(TERMINAL_CMD, start_new_session=True)
time.sleep(1)
hidden_view, shown_view = find_view()
if shown_view:
show_view(shown_view)
else:
print("Failed to start new terminal!")
elif shown_view:
hide_view(shown_view)
else:
show_view(hidden_view) You also need the The script does the following:
|
oh this looks exactly like what I was looking for and my terminal happens to be foot I will try this as soon as possible, thank you very much 🤩 |
already a little feedback, I couldn't wait to try. On the other hand, it only opens on the first workspace, maybe add a sticky option? |
A little bit of shameless self-promotion here. While you develop the plugin, may be you can use the app I have built: DesQ Dropdown + DesQ Term. You can add a command+binding to wayfire config:
PS: If you're interested, I can also combine the two and make a single app for you without many extra dependencies |
I just had to add to fix the problem and it's totally functional
I don't know if wlroots allows it, but for future plugins add the possibility of not displaying an icon, would allow others not to touch the waybar or other config and maybe also being able to deactivate the window decoration could be useful |
Yeah if done with a plugin it will make it sticky by default and also won't show up in the taskbar, that's certain. About removing decoration, I would say that decorations are kind-of orthogonal issue, but the built-in decoration plugin has an option to disable decorations for a particular windows with a criteria, maybe take a look at that. |
I use tilda-wayland (fork of tilda) a s a dropdown terminal and it manages to do it well, without any effort from wayfire. https://github.com/shih-liang/tilda-wayland To make it look nice - adding config lines added in wayfire.ini for tilda only [animate] [firedecor] (hopefully same can be done with any other decorator as well) [window-rules] (adjust to the position you want) Also for toggle hide-unhide map key combination in [command ] section to the following command dbus-send --session --type=method_call --dest=com.github.lanoxx.tilda.Actions0 /com/github/lanoxx/tilda/Actions0 com.github.lanoxx.tilda.Actions.Toggle This fork is behind the main tilda tree - but it has Xorg stripped out and native wayland programmed in - so works very nice with all dropdown terminal features, tabs, nice customization options. And it is normal C program, not he python wrapper around something. |
and is it possible to show or hide an application, for example a terminal?
I would like to ideally reproduce hdrop (or tdrop) with foot or alacritty.
The text was updated successfully, but these errors were encountered: