You are not logged in.

#1 2024-04-01 11:30:50

ridbo
Member
Registered: 2024-03-31
Posts: 19

Setting up foot terminal in quake mode (drop and down) in labwc waylan

Please help me configure the foot terminal in the labwc wayland composer.
It is necessary to bind "foot" to a hotkey and make sure that it always and everywhere opens half the screen in a translucent form when this key is pressed.
If possible, then divided into two parts vertically and one part horizontally, as in tmux (3 sessions).

Last edited by ridbo (2024-04-01 11:42:45)

Offline

#2 2024-04-01 11:48:40

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 8,842
Website

Re: Setting up foot terminal in quake mode (drop and down) in labwc waylan

Use the alpha option in foot.ini to set transparency, use labwc's window rules to place the terminal and use tmux to split it.


Jin, Jîyan, Azadî

Offline

#3 2024-04-01 12:48:16

ridbo
Member
Registered: 2024-03-31
Posts: 19

Re: Setting up foot terminal in quake mode (drop and down) in labwc waylan

Head_on_a_Stick wrote:

Use the alpha option in foot.ini to set transparency, use labwc's window rules to place the terminal and use tmux to split it.

Is it possible to set this up without XWayland?

Offline

#4 2024-04-01 12:58:57

seth
Member
Registered: 2012-09-03
Posts: 64,563

Re: Setting up foot terminal in quake mode (drop and down) in labwc waylan

labwc is a wayland compositor (but has a hard dependency on xwayland) and foot is a wayland terminal - how do you infer an xwayland necessity in this specific case?

Online

#5 2024-04-02 11:23:08

ridbo
Member
Registered: 2024-03-31
Posts: 19

Re: Setting up foot terminal in quake mode (drop and down) in labwc waylan

Head_on_a_Stick wrote:

Use the alpha option in foot.ini to set transparency, use labwc's window rules to place the terminal and use tmux to split it.

I did it. But how can you make the foot disappear and appear when you press a hotkey?

I believe that it is probably possible to write a script that will check the position of the foot window and if the window is minimized, then the script expands it, and if it is in focus or expanded, then it is minimized.

Or can this be done some other way?

Offline

#6 2024-04-02 15:03:20

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 8,842
Website

Re: Setting up foot terminal in quake mode (drop and down) in labwc waylan

ridbo wrote:

how can you make the foot disappear and appear when you press a hotkey?

With some shell duct tape smile

Place this in an executable file at /usr/local/bin/quake:

#!/bin/sh
pkill -f 'foot --title=quake' || foot --title=quake "$@"

Then add this to rc.xml:

   <windowRules>
      <windowRule identifier="foot">
         <skipTaskbar>yes</skipTaskbar>
         <action name="MoveTo" x="500" y="500" />
         <action name="ToggleAlwaysOnTop" />
      </windowRule>
   </windowRules>

The MoveTo x & y co-ordinates are just examples, adjust them to your liking.

Unfortunately labwc's windowRule identifier doesn't seem to detect foot's custom title so the placement rule will apply to all instances of foot, which might not be what you want. The developer of labwc is a developer over at the BunsenLabs forums so perhaps consider taking this up with them. Tell them I said "hi" if you do.

Last edited by Head_on_a_Stick (2024-04-02 20:57:02)


Jin, Jîyan, Azadî

Offline

#7 2024-04-02 15:39:41

ridbo
Member
Registered: 2024-03-31
Posts: 19

Re: Setting up foot terminal in quake mode (drop and down) in labwc waylan

Head_on_a_Stick wrote:

Place this in an executable file at /usr/local/bin/quake:

#!/bin/sh
pkill -f 'foot --title=quake' || foot --title=quake

But I need the terminal session to be saved.
Ideally with tmux.

Offline

#8 2024-04-02 15:44:52

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 8,842
Website

Re: Setting up foot terminal in quake mode (drop and down) in labwc waylan


Jin, Jîyan, Azadî

Offline

#9 2024-04-03 14:13:30

ridbo
Member
Registered: 2024-03-31
Posts: 19

Re: Setting up foot terminal in quake mode (drop and down) in labwc waylan

if [ -x "$(command -v tmux)" ] && [ -n "${DISPLAY}" ] && [ -z "${TMUX}" ]; then
    exec tmux new-session -A -s ${USER} >/dev/null 2>&1
fi

If you add this code to /etc/X11/xinit/xinitrc.d/ then X will not load

Offline

#10 2024-04-03 14:15:18

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 24,477

Re: Setting up foot terminal in quake mode (drop and down) in labwc waylan

The context there is to run this from your bashrc (or whatever rc your shell is).

Offline

#11 2024-04-04 03:15:57

ridbo
Member
Registered: 2024-03-31
Posts: 19

Re: Setting up foot terminal in quake mode (drop and down) in labwc waylan

Thanks for answers!

Tell me also why in openbox I can’t configure the hot key: ` to drop out the terminal? Although it works fine in labwc.

    <keybind key="`">
    <action name="Execute">
    <command>tdrop -a -h 45% alacritty</command>
    </action>
    </keybind>

Offline

#12 2024-04-04 07:00:57

seth
Member
Registered: 2012-09-03
Posts: 64,563

Re: Setting up foot terminal in quake mode (drop and down) in labwc waylan

What is "tdrop" and try "grave" as key.

Online

#13 2024-04-04 13:03:56

ridbo
Member
Registered: 2024-03-31
Posts: 19

Re: Setting up foot terminal in quake mode (drop and down) in labwc waylan

seth wrote:

What is "tdrop" and try "grave" as key.

tdrop is used to hide and show a terminal emulator on different desktops/workspaces:

Offline

#14 2024-04-04 13:26:36

seth
Member
Registered: 2012-09-03
Posts: 64,563

Re: Setting up foot terminal in quake mode (drop and down) in labwc waylan

Ok, first make sure you can bind the "grave" key to anything, in doubt just starting another alacritty.
Then tackle tdrop.
Don't forget to reload the openbox config after editing it.

Online

#15 2024-04-04 13:27:57

ridbo
Member
Registered: 2024-03-31
Posts: 19

Re: Setting up foot terminal in quake mode (drop and down) in labwc waylan

seth wrote:

Ok, first make sure you can bind the "grave" key to anything, in doubt just starting another alacritty.
Then tackle tdrop.
Don't forget to reload the openbox config after editing it.

Thank you! "grave" works

Offline

#16 2024-04-04 13:29:00

seth
Member
Registered: 2012-09-03
Posts: 64,563

Re: Setting up foot terminal in quake mode (drop and down) in labwc waylan

\o/
Please always remember to mark resolved threads by editing your initial posts subject - so others will know that there's no task left, but maybe a solution to find.
Thanks.

(you'll likely have to shorten it…)

Online

#17 2024-04-04 13:32:38

ridbo
Member
Registered: 2024-03-31
Posts: 19

Re: Setting up foot terminal in quake mode (drop and down) in labwc waylan

Is it possible to somehow hide or reveal the terminal without terminating the process?

#!/bin/sh
pkill -f 'foot --title=quake' || foot --title=quake

I suspect that without terminating the process, the terminal would start faster. Or is that not true?

Offline

#18 2024-04-04 13:50:17

seth
Member
Registered: 2012-09-03
Posts: 64,563

Re: Setting up foot terminal in quake mode (drop and down) in labwc waylan

https://www.reddit.com/r/swaywm/comment … _a_window/ - but that depends on whether labwc has a scratchpad or supports swaymsg at all.

Online

#19 2024-04-04 14:53:09

ridbo
Member
Registered: 2024-03-31
Posts: 19

Re: Setting up foot terminal in quake mode (drop and down) in labwc waylan

seth wrote:

https://www.reddit.com/r/swaywm/comment … _a_window/ - but that depends on whether labwc has a scratchpad or supports swaymsg at all.

As far as I understand from this topic, labwc does not support this

Offline

#20 2024-04-04 15:16:56

seth
Member
Registered: 2012-09-03
Posts: 64,563

Re: Setting up foot terminal in quake mode (drop and down) in labwc waylan

It's generally true that there's no standardized protocol.
Afaiu the labwc homepage they seek compatibility w/ sway which is why I suggested trying swaymsg.
But you'll have to try and in doubt ask upstream on the state of IPC support, https://archlinux.org/packages/extra/x86_64/ydotool/ won't work.

Online

#21 2024-04-04 16:17:40

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 8,842
Website

Re: Setting up foot terminal in quake mode (drop and down) in labwc waylan

For foot try running this in ~/.config/labwc/autostart:

foot --server &

Then call footclient(1) in the toggle script.

And for an extra speed boost switch from bash to busybox ash :-)


Jin, Jîyan, Azadî

Offline

#22 2024-04-05 04:21:53

ridbo
Member
Registered: 2024-03-31
Posts: 19

Re: Setting up foot terminal in quake mode (drop and down) in labwc waylan

Head_on_a_Stick wrote:

For foot try running this in ~/.config/labwc/autostart:

foot --server &

Then call footclient(1) in the toggle script.

And for an extra speed boost switch from bash to busybox ash :-)

So I did. But I meant so as not to kill the footclient process every time using pkill.

I'll try to figure it out with swaymsg, but for me it's already complicated.

I'm using zsh)

Offline

#23 2024-04-09 04:53:51

jlindgren
Member
Registered: 2011-02-27
Posts: 260

Re: Setting up foot terminal in quake mode (drop and down) in labwc waylan

swaymsg will not work in labwc, since labwc does not support sway's IPC protocol. There are Iconify (a.k.a minimize) and Raise actions that you could use in labwc's rc.xml to hide/show a window, but it will still show up in the Alt-Tab list. I don't know of any generic way to completely hide a window (including from the Alt-Tab list) in labwc currently.

A lot of labwc discussion takes place on the GitHub site, and in my experience the developers are pretty friendly. You can start a discussion/ask a question there if you like: https://github.com/labwc/labwc/discussions

Offline

#24 2024-04-09 08:02:43

ridbo
Member
Registered: 2024-03-31
Posts: 19

Re: Setting up foot terminal in quake mode (drop and down) in labwc waylan

jlindgren wrote:

swaymsg will not work in labwc, since labwc does not support sway's IPC protocol. There are Iconify (a.k.a minimize) and Raise actions that you could use in labwc's rc.xml to hide/show a window, but it will still show up in the Alt-Tab list. I don't know of any generic way to completely hide a window (including from the Alt-Tab list) in labwc currently.

A lot of labwc discussion takes place on the GitHub site, and in my experience the developers are pretty friendly. You can start a discussion/ask a question there if you like: https://github.com/labwc/labwc/discussions

I found a script there:

echo '<openbox_pipe_menu id="window-list">'

wla=$(wlrctl toplevel list state:-minimized)

wlrctl toplevel list state:-minimized  |
while read line; 
do 

appid=$(echo $line | cut -d ':' -f1)
apptitle=$(echo $line | cut -d ':' -f2-| sed '1s/.//' | sed 's/\&/\&amp;/g')

echo "<item label="\""$appid $apptitle"\"">"
echo "<action name="\""Execute"\""><execute>"
echo "wlrctl window focus app_id:$appid `title:'$apptitle'` "
echo "</execute></action></item>"

done
if [ -z "$wla" ];
then 
echo "<item label='No open windows'></item>"
fi
echo "<separator/>"

wlrctl toplevel list state:minimized  |
while read line; 
do 
appid=$(echo $line | cut -d ':' -f1)
apptitle=$(echo $line | cut -d ':' -f2-| sed '1s/.//' )
echo "<item label="\""* $appid $apptitle"\"">"
echo "<action name="\""Execute"\""><execute>"
echo "wlrctl window focus app_id:$appid state:minimized `title:'$apptitle'`"
echo "</execute></action></item>"
done

echo '</openbox_pipe_menu>'

But I can't figure out how to use it. Can you help?

Offline

#25 2024-04-09 12:43:42

jlindgren
Member
Registered: 2011-02-27
Posts: 260

Re: Setting up foot terminal in quake mode (drop and down) in labwc waylan

If you have a specific question, I can try to answer it.

Offline

Board footer

Powered by FluxBB