dotfiles icon indicating copy to clipboard operation
dotfiles copied to clipboard

[BUG] Issue with --class Argument in Ghostty

Open zainsyedz opened this issue 1 year ago • 6 comments

Describe the bug

When using the --class argument with Ghostty to set the window class for managing windows in Hyprland, the argument is not correctly passed and results in an error. This issue prevents proper window management by Hyprland.

$(cat ~/.config/ml4w/settings/terminal.sh) --class dotfiles-floating -e nmtui

This is the command for any of the floating windows (mainly in waybar)

One, ghostty doesn't parse the arguements with this. Needs to be modified to $(cat ~/.config/ml4w/settings/terminal.sh) --class=dotfiles-floating -e nmtui

Secondly, the dotfiles-floating always get's incorrectly passed to hyprland, mostly doesn't follow the ..* syntax, if I'm not wrong.

Changing it to dotfiles.floating did get it to work, but the content didn't sit well within the floating window.

warning(gtk): invalid 'class' in config, ignoring

Steps to reproduce

Just change the terminal to ghostty via the settings in ml4w settings app. then click on any of the modules that require the floating window

Expected behavior

The --class argument should correctly set the window class to dotfiles-floating, allowing Hyprland to manage the window according to the specified rules.

Screenshots

No response

Distribution

Arch Linux

If Other, specify

No response

Additional context

No response

Code of Conduct

  • [x] I agree to follow this project's Code of Conduct

zainsyedz avatar Feb 24 '25 13:02 zainsyedz

Just pushed an update to the main branch to support ghostty. Please install it with yay and rebuild all packages. The of course run ml4w-hyprland-setup.

The new version of the settings app includes an new field "Install Updates Script" under System.

Image

The general syntax for class name doesn't work with ghostty. You need to define the class name with:

$(cat ~/.config/ml4w/settings/terminal.sh) --class=ml4w.dotfiles.floating -e ~/.config/ml4w/scripts/installupdates.sh

The new version of the dotfiles includes a floating window rule for ml4w.dotfiles.floating that is compatible with Ghostty.

Please share your feedback if it's working.

mylinuxforwork avatar Feb 24 '25 16:02 mylinuxforwork

This does work for ghostty. The class also works for kitty.

Issue is with nmtui not scaling properly with ghostty. Unsure why that is happening

Image

zainsyedz avatar Feb 25 '25 02:02 zainsyedz

Have the same on my system. But this is not a dotfiles issue. Can you open an issue on Ghostty GitHub. Maybe Ghosrry must be configured correctly.

You could link the issue then here as well.

mylinuxforwork avatar Feb 25 '25 06:02 mylinuxforwork

Awesome. I'll do that.

zainsyedz avatar Feb 25 '25 06:02 zainsyedz

Shouldn't the latest dotfiles have the new class as default since switching to any other terminal emulator (which uses GTK) will result in failure of opening of any of them in the terminal?

zainsyedz avatar Mar 03 '25 02:03 zainsyedz

I will check

mylinuxforwork avatar Mar 06 '25 17:03 mylinuxforwork