~atha/newm-atha#7: 
Better cmd client

I was wondering if the DBus interface and the cmd could be redesigned to obtain additional information, such as the title of the currently focused window and its current position.

It would be super useful for me to make a better "bar" for myself.

Status
REPORTED
Submitter
~sesajad
Assigned to
No-one
Submitted
1 year, 9 months ago
Updated
1 year, 6 months ago
Labels
feature request status: waiting on closure

~atha 1 year, 9 months ago

Absolutely, and I'll update it right away.

It'll probably include:

  • window title
  • window dimensions
  • window state (ex: floating, full screen, etc.)
  • window cooridnates
  • and number of open windows.

Do you think there is anything else it shoudl have?

~sesajad 1 year, 9 months ago

Wow, actually I didn't expect such a fast and open reply! I'll check Hyprland and Sway and actually i3, and then, I'll share what is on my mind.

~atha 1 year, 9 months ago

👍

~sesajad 1 year, 9 months ago*

Noting these

hyprctl --help                                                                                                                                                                                                      
usage: hyprctl [(opt)flags] [command] [(opt)args]

commands:
    monitors
    workspaces
    activeworkspace
    clients -> all of the windows
    activewindow
    layers -> I don't know
    devices
    binds
    dispatch -> runs any internal command (like switching workspace etc.)
    keyword
    version
    kill 
    splash
    hyprpaper -> it should be about wallpaper
    reload
    setcursor
    getoption
    cursorpos
    switchxkblayout
    seterror
    setprop
    plugin
    notify
    globalshortcuts

flags:
    -j -> output in JSON
    --batch -> execute a batch of commands, separated by ';'

and https://manpages.debian.org/experimental/sway/swaymsg.1.en.html and also https://git.sr.ht/~brocellous/wlrctl

My suggestions are these two options

  1. We can expose every command from the layout, why not :)))? https://git.sr.ht/~atha/newm-atha/tree/HEAD/item/doc/layout.md

  2. But if I want to be inclusive and pragmatic

getters:

  • window management
    • current window: (title, class, state, coordinates, etc)
    • list of all windows: (id, title, class)
    • current workspace (may be I am wrong about the code, but I think workspace is the model that contains the current view of the screen)
  • inputs
    • xkb_active_layout_name

listeners:

  • window management
    • change_focus
    • move (not now)
    • zoom_in/out (not now)

commands/setters:

  • window management
    • maybe move, focus, ....(not now)

~atha 1 year, 9 months ago

Absolutely! This is probably what I will base the implementation of off(with your aproval of course). Additionally, I think we should include layers - like hyprland, which gives info about the diffrent 'layers' on screen(layer-shell protocol is supported in newm and is essential to a lot of things). By the way, layers/layer-shell protocol defines the idea that there are multiple on screen layers with diffrent things being rendered on diffrent ones,i.e swaylock is rendered on the top one.

~sesajad 1 year, 9 months ago

Oh, I didn't know that concept. That would also be a thing. Tell me if there is something that I could do.

~atha 1 year, 9 months ago

hey ~sesajad, I implemented some of your ideas in this commit.

The specific ones are:

  • window title name
  • window ssd status
  • current workspace number

Can you take the for a spin ASAP and let me know how it goes? Let me know how it goes!

~sesajad 1 year, 9 months ago

yeah. right now. I think there is a typo (no semicolon) in https://git.sr.ht/~atha/pywm-atha/tree/cc5092882ecdcf33000aa1f0e393731a63bd6c26/item/src/wm/wm_seat.c#L158 which prevents me from a successful build from AUR. I'll try to ignore it somehow.

~sesajad 1 year, 9 months ago

update: It raises

{'exception': "'Layout' object has no attribute 'find_focused_window'"}

which seems to be from

https://git.sr.ht/~atha/newm-atha/tree/HEAD/item/newm/dbus/command.py#L37

Noting that we have find_focused_view(self) -> Optional[View] in layout class, it should be changed to that.

~sesajad 1 year, 9 months ago*

After solving that, I arrived at this (by replacing window with view)

{'exception': "'View' object has no attribute 'is_present'"}

~atha 1 year, 9 months ago

Ah.... I'm sorry for your troubles, I'm stupid.

~sesajad 1 year, 9 months ago

No worries, mate. It was ok. Tell me if I could do anything.

~atha 1 year, 8 months ago

so here's an update ~sesajad, out of the 3 new commands, current-window-title should work 100% of the time, and the other two are rather finiky and dont work. For current-window-title to work you should be based of off commit cacafde.

git has great commit hashes these days doesnt it?

~sesajad 1 year, 8 months ago

great. I will test it right now.

hahaha yeah. It reminded me of the famous covfefe.

~atha 1 year, 8 months ago

yes, thats a very similar message too. Let me know if current-window-title now works for you too, I will fix the others after this one is confirmed working.

~atha REPORTED CLOSED 1 year, 8 months ago

~atha CLOSED REPORTED 1 year, 8 months ago

~atha 1 year, 8 months ago

oops wrong button

touchscreen is hard

~sesajad 1 year, 8 months ago

Awesome. It was working properly. I forgot to send the message yesterday. Thanks

~atha 1 year, 8 months ago

OK, thank you! I'll commit ASAP making the other two work.

~atha 1 year, 8 months ago

btw ~sesajad, the experimental version with these commands is in newmctl not newm-cmd, so that extensive changes can be carried out without breaking peoples configs, especially the people who are rolling with git here. I forgot to let you know, sorry.

~sesajad 1 year, 8 months ago

great. I'll check it out.

Register here or Log in to comment, or comment via email.