Skip to content
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

Title bar for apps #294

Closed
Vosjedev opened this issue Dec 11, 2022 · 9 comments
Closed

Title bar for apps #294

Vosjedev opened this issue Dec 11, 2022 · 9 comments

Comments

@Vosjedev
Copy link

Hi! I realy enjoy this project, I am using it to manage my server via ssh.

Could you implement something like a titlebar-window to put apps in? currently i am using configurations like this:
<item id=htop label="Htop" type=DirectVT title="Htop" param="$0 -r term htop" notes=" Interactive process viewer "/>
to make an app have a titlebar.
I am thinking about a titlebar like the demo-apps, but with a custom terminal-command.
I also encounter some problems when I use this config from the preset in the readme:
<item id=mc label="mc" type=SHELL title="Midnight Commander" param="mc" notes=" run Midnight Commander in its own window "/>
or for lfm:
<item id=lfm label="LFM" type=DirectVT title="Last File Manager" param="lfm" notes=" run Last File Manager in its own window "/>
It just displays the midnight commander window, and I cant move/resize it. also, some apps using this configuration (like lfm) start a window, then disapear, and lfm ends up running in the background without a window. using
<item id=lfm label="LFM" type=DirectVT title="Last File Manager" param="$0 -r term lfm" notes=" run Last File Manager in its own window "/> fixes this.

Thanks!

@Vosjedev Vosjedev mentioned this issue Dec 11, 2022
Closed
@o-sdn-o
Copy link
Collaborator

o-sdn-o commented Dec 11, 2022

Hi! Thanks for feedback!

I also encounter some problems when I use this config from the preset in the readme:
<item id=mc label="mc" type=SHELL title="Midnight Commander" cmd="mc" notes=" run Midnight Commander in its own window "/>

UI controls (top/bottom bar + menu) that allow you to drag the window are provided by the built-in vtm terminal. They are only present (and work) if your application is running on top of the built-in vtm terminal that using DirectVT, like the following:

  • type=DirectVT cmd="$0 -r term _your_app_executable_path_".

Next, type=SHELL is used to run cmd='command' on top of the default system shell. So, the following entries will be equivalent:

  • type=SHELL cmd='mc'
  • type=ANSIVT cmd='bash -c mc'

In this case, there will be no UI controls from the vtm side.

type=DirectVT can only be used to run applications that support the DirectVT protocol (protocol is not documented yet). In the example, applications are launched on top of the built-in vtm terminal (which supports this terminal protocol). E.g., type=DirectVT cmd="$0 -r term mc". Here $0 will be replaced with the path to the current vtm instance.

The following entries will be suitable for your config:

  • <item id=mc label="mc" type=DirectVT title="Midnight Commander" cmd="$0 -r term mc" notes=" run Midnight Commander in its own window "/>
  • <item id=lfm label="LFM" type=DirectVT title="Last File Manager" cmd="$0 -r term lfm" notes=" run Last File Manager in its own window "/>

P.S.: I need to update the readme.

@o-sdn-o
Copy link
Collaborator

o-sdn-o commented Dec 11, 2022

Could you implement something like a titlebar-window to put apps in? currently i am using configurations like this:

to make an app have a titlebar.

Good idea, I'll add a type= that has a draggable title/bar, or just make an additional option titlebar to add a draggable bar under the title.

Something like ... type=TITLEBAR cmd='content_generator_command' or ... titlebar cmd='content_generator_command':

Window Title
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀     <-  draggable bar
- content - content - content - content -
- content - content - content - content -
- content - content - content - content -
- content - content - content - content -

@o-sdn-o
Copy link
Collaborator

o-sdn-o commented Dec 11, 2022

I'm currently implementing a configuration merge. This is when the DirectVT application receives a config patch at startup, this is the config subparameter inside item

<item ...>
     <config>
         <term>
             ...
         </term>
     </config>
</item>

When I'm done, you can say something like

<item ...>
    <config>
        <term>
            <selection mode=none/>
        </term>
    </config>
</item>

In this case, the window can be dragged with the mouse using its entire surface.

@Vosjedev
Copy link
Author

Vosjedev commented Dec 11, 2022

Nice! I think sometimes dragging a window using it's entire surface is not practical, but realy like the type=TITLEBAR idea. I guess I need to learn python3 (C is to difficult for me yet) now, so I can develop apps for your DE.😀 (see my comment on issue 'wow' #120 )

@o-sdn-o
Copy link
Collaborator

o-sdn-o commented Dec 11, 2022

I'm thinking of changing the DirectVT/ANSIVT/SHELL concept to make it easier and clearer than it is now. Each option will have a built-in terminal menu that can be customized.

@o-sdn-o
Copy link
Collaborator

o-sdn-o commented Dec 11, 2022

It should be like

SHELL=ANSIVT with prefix ‘bash -c ’ to ‘cmd’s value.

ANSIVT=DirectVT with prefix ‘$0 -r term ’ to ‘cmd’s value.

The following items are the same

<item …. type=SHELL cmd=‘mc’/>
<item …. type=ANSIVT cmd=‘bash -c mc’/>
<item …. type=DirectVT cmd=‘$0 -r term bash -c mc’/>

@o-sdn-o
Copy link
Collaborator

o-sdn-o commented Dec 11, 2022

After these changes, the need for a titlebar will probably disappear. It will have to be tested.

@o-sdn-o
Copy link
Collaborator

o-sdn-o commented Dec 25, 2022

@Vosjedev Now you can specify your own menu for the built-in terminal. See #304 for reference. Could you please check if this approach closes the titlebar issue?

~/.config/vtm/settings.xml:

<config>
    <menu selected=Term>
        <item*/>         <!-- Remove default item records. -->
        <item id=Term>   <!-- title=id type=SHELL cmd=os_default_shell by default-->
            <config>
                <term>
                    <menu> <!-- Menu with one item -->
                        <item*/> <!-- Zeroize existing menu. -->
                        <item label="ls /bin" action=TerminalSendKey data="ls /bin\n"/>
                    </menu>
                </term>
            </config>
        </item>
        <item id=htop label="htop" type=DirectVT cmd="$0 -r term htop" notes=" run htop ">
            <config>
                <term>
                    <menu> <!-- Empty menu -->
                        <item*/> <!-- Zeroize existing menu. -->
                    </menu>
                </term>
            </config>
        </item>
        <item id=lfm label="LFM" type=DirectVT title="Last File Manager" cmd="$0 -r term lfm" notes=" run Last File Manager in its own window "/>
        <autorun*/> <!-- Zeroize default autoruns. -->
    </menu>
</config>

@o-sdn-o
Copy link
Collaborator

o-sdn-o commented Jan 17, 2023

I close the issue. Please feel free to reopen if the problem still exists.

@o-sdn-o o-sdn-o closed this as completed Jan 17, 2023
@o-sdn-o o-sdn-o changed the title a titlebar for apps Titlebar for apps May 23, 2023
@o-sdn-o o-sdn-o changed the title Titlebar for apps Title bar for apps May 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants