apognu / tuigreet

Graphical console greeter for greetd
GNU General Public License v3.0
977 stars 45 forks source link

/etc/issue coloring not showing #150

Closed TeakKey7 closed 3 months ago

TeakKey7 commented 3 months ago

Describe the bug When using issue in tuigreet, ANSI color coding is not supported

Expected behavior When using ANSI in /etc/issue, you can normally see the color of your greeting when logging into a TTY

System information:

Additional context /etc/issue:

                                                             \e[1;30m| \e[34m\r \s
      \e[36;1m/\\\\                        \e[37m||      \e[36m| =                 \e[30m|
     \e[36m/  \\\\                       \e[37m||      \e[36m|                   \e[30m| \e[32m\t
    \e[1;36m/ \e[0;36m.. \e[1m\\\\   \e[37m//==\\\\\\ ||/= /==\\\\ ||/=\\\\  \e[36m| | |/\\\\ |  | \\\\ /  \e[30m| \e[32m\d
   \e[0;36m/ .  . \\\\ \e[37m||    || ||  ||     ||  ||  \e[36m| | |  | |  |   X   \e[1;30m|
  \e[0;36m/  .  .  \\\\ \e[37m\\\\\\==/| ||   \\\\==/ ||  ||  \e[36m| | |  |\  \\/|  / \\\\ \e[1;30m| \e[31m\U
 \e[0;36m/ ..    .. \\\\   \e[0;37mA simple, lightweight linux distribution.   \e[1;30m|
\e[0;36m/_'        `_\\\\                                              \e[1;30m| \e[35m\l \e[0mon \e[1;33m\n
\e[0m

Debug log Run tuigreet with the -d [FILE] option to log tracing information into the specified file, to append here. I could not get tuigreet to give a deubg file after restarting the greetd service multiple times with -d in the config file's command

fbgrab

apognu commented 3 months ago

As of now, this is indeed not supported.

I'm not closing the door to implementing this, but I will need to look into it. There is a crate that can turn a byte slice containing ANSI escape codes into Text that can be displayed by ratatui, but I don't think it supports \e, so I would need to do some replacements to make it work.

I will have a good at it.

apognu commented 3 months ago

@TeakKey7, I started implementing this in #151, could you have a go at the binary in this action and tell me if it works properly for your use case?

I have some more testing to do on my side, but your feedback would go a long way.

Thank you.

TeakKey7 commented 3 months ago

greeter tty I appreciate the assistance. Here is what I get.

apognu commented 3 months ago

Can you try running tuigreet with the following option: --greet-align left? I believe the weird offsets we see are because it is centered by default.

In case it doesn't work, could you provide the exact issue file (with all the spaces intact) so I can reproduce?

Scratch that. I was able to edit your initial message to show spaces, please tell me if the align option works. :)

apognu commented 3 months ago

There is still something wrong with the display, even when aligned left. Good news is I think I know how to fix that. There will also most probably be a width issue, where broad issue content will be too long to be displayed in the container.

apognu commented 3 months ago

I am at a state where things look quite good (not perfect, though):

tuigreet-ansi

apognu commented 3 months ago

Hey, can you try out the build from this action? I think it is looking quite okay (with --width 90 --greet-align left).

Thanks.

TeakKey7 commented 3 months ago

secondtry I was able to replicate your view! \U is also working. I apologize for going unresponsive over the weekend. Thanks for your help! I will keep an eye on it if you have any other tests for me. :)

TeakKey7 commented 3 months ago

I am curious, how are you getting a seemingly emulated console on yours? Your font looks very pretty compared to default Linux console. I am torn on raw hardware look vs pretty and polished

apognu commented 3 months ago

No problem, we all need our weekends.

Yeah I also took the opportunity to implement some of the missing escape sequences. Glad to know it looks good.

For your other question, I am afraid there is no magic, the screenshot comes from tuigreet running from a terminal emulator in my user session, not from a Linux console. I also wish it looked like that. 😅

apognu commented 3 months ago

This is merged on the main branch and will be included in the next tagged release.

LittFlower commented 1 month ago

I apologize for reopening this thread... But I'm still experiencing the problem (I've added --width 90 --greet-align left), and I'm still not able to draw this graphic correctly at my tuigreet, but I'm already able to see it correctly in tty, which suggests that my /etc/issue settings should be fine.

我的配置命令如下:

command = "tuigreet --asterisks --issue -t --remember --width 90 --greet-align left --theme 'border=magenta;text=cyan;prompt=green;time=red;button=lavender;container=black;input=red'"
apognu commented 1 month ago

Which version of tuigreet are you running? This change has not been released in a tagged version yet, so is only available when compiling from the main branch.

LittFlower commented 1 month ago

the version about greetd and tuigreet as follows:

apognu commented 1 month ago

You do not have the version where this is released, you either have to wait until the release or compile from source.