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

just an question about the TTY #194

Open
tryedandcatched opened this issue Jan 26, 2024 · 9 comments
Open

just an question about the TTY #194

tryedandcatched opened this issue Jan 26, 2024 · 9 comments
Labels
bug Something isn't working

Comments

@tryedandcatched
Copy link

Hi. thanks for reading my issues i mean its more an question than an issues but maybe it is so :
i made an custom build of lemurs with custom color the build went perfectly and when i use --preview it's work perfectly
image
but when i log using the TTY ony the orange is showing everything else is black so idk.
Thanks have a nice day

@amsyarzero
Copy link

Could you post the contents of your config.toml and variables.toml?

@amsyarzero
Copy link

I finished making my config file and the same thing is happening too. Seems that running lemurs -c <path/to/config.toml> as shown in README.md simply spawns a new Lemurs instance in the terminal instead of saving the config file.

@coastalwhite sorry for the ping, but is there any way to save the config.toml and variables.toml inside Lemurs?

@coastalwhite
Copy link
Owner

I am not sure I understand the question correctly @amsyarzero.

The easiest way to use a config.toml is to put it at /etc/lemurs/config.toml (same for variables: /etc/lemurs/variables.toml).

@amsyarzero
Copy link

@WyeneCloud seems that this also affects me. After saving my config.toml and variables.toml, running lemurs --preview shows this:
Lemurs in preview mode, showing the right colors

However, after rebooting, besides the border and password replacement character (the #), everything else is colored back to the default colors instead. For reference, here are my two TOML files.

variables.toml
#  ____ ____ ____ ____ ____ ____ 
# ||L |||e |||m |||u |||r |||s ||
# ||__|||__|||__|||__|||__|||__||
# |/__\|/__\|/__\|/__\|/__\|/__\|

# variables.toml file
# based on Catppuccin Mocha

######################################
# Color variables
background="#1E1E2E"
text="#CDD6F4"
subtext="#6C7086"
highlight="#F5C2E7"
error="#F38BA8"
######################################
config.toml
#  ____ ____ ____ ____ ____ ____ 
# ||L |||e |||m |||u |||r |||s ||
# ||__|||__|||__|||__|||__|||__||
# |/__\|/__\|/__\|/__\|/__\|/__\|

# config.toml file
# Contains all the customization options of lemurs.
# Note: that as of now you need to have all options in the selected
# configuration file. Otherwise Lemurs will not work.

# Predefined colors from original config.toml:
# - black
# - white
# - (dark) gray
# - (light) red
# - (light) blue
# - (light) green
# - (light) magenta
# - (light) cyan
# - (light) yellow
# - orange

# Text modifiers:
# - bold
# - dim
# - italic
# - underlined
# - reverse
# - crossed out
# - hidden

# Values imported from variables.toml:
# - background
# - text
# - subtext
# - highlight
# - error
# Note: put a $ before the variable name to call the variable (e.g. ""$background")
######################################

######################################
# General setup
# The tty which contains lemurs. This has to be mirrored in the lemurs.service
tty = 2

# The value of the `DISPLAY` environment variable for X11 sessions
x11_display = ":1"

# How many seconds to give the X server to start. To make it infinitely, put it
# to 0.
xserver_timeout_secs = 60

# Where to log the main lemurs control flow.
main_log_path = "/var/log/lemurs.log"

# Where to log to for the client. The Client is the Desktop Environment or
# Window Manager for Xorg, the Compositor for Wayland and the Shell for TTY.
client_log_path = "/var/log/lemurs.client.log"

# Where to log to for the XServer.
xserver_log_path = "/var/log/lemurs.xorg.log"

# Disable all logging. This is overwritten by the `--no-log` flag.
do_log = true

# The PAM service that should be used to login
pam_service = "lemurs"

# The type flag that will be appended to the shell that calls the session
# environment. This may depend on your shell. Options:
# - 'none'. Disables calling a login shell
# - 'short'. Produces the `-l` flag. Supported by most shells.
# - 'long'. This produces the `--login` flag and is suited for bash and zsh.
shell_login_flag = "short"

# Focus behaviour of fields when Lemurs is initially started
# 
# Possible values:
# - default: Initially focus on first non-cached value
# - no-focus: No initial focus
# - environment: Initially focus on the environment selector
# - username: Initially focus on the username field
# - password: Initially focus on the password field
focus_behaviour = "default"
######################################

######################################
# Background setup
[background]

# Control whether to render background widget or not
show_background = true

[background.style]
# Allow to set the default background color for the login shell
color = "$background"
# Settings for the background block's borders
show_border = true
border_color = "$text"
######################################

######################################
# Power controls
[power_controls]

# The margin between hints
hint_margin = 2

# There are no additional entries by default
entries = []

# Example
# Reboot to another os option
#[[power_controls.entries]]
## The text in the top-left to display how to reboot.
#hint = "Reboot to OS"
#
## The color and modifiers of the hint in the top-left corner
#hint_color = "dark gray"
#hint_modifiers = ""
#
## The key used to reboot. Possibilities are F1 to F12.
#key = "F3"
## The command that is executed when the key is pressed
#cmd = "efibootmgr -n0 && systemctl reboot -l"


# If you want to remove the base_entries
# base_entries = []

# Shutdown option
[[power_controls.base_entries]]
# The text in the top-left to display how to shutdown.
hint = "Shutdown"

# The color and modifiers of the hint in the top-left corner
hint_color = "$subtext"
hint_modifiers = ""

# The key used to shutdown. Possibilities are F1 to F12.
key = "F1"
# The command that is executed when the key is pressed
cmd = "systemctl poweroff -l"

# Reboot option
[[power_controls.base_entries]]
# The text in the top-left to display how to reboot.
hint = "Reboot"

# The color and modifiers of the hint in the top-left corner
hint_color = "$subtext"
hint_modifiers = ""

# The key used to reboot. Possibilities are F1 to F12.
key = "F2"
# The command that is executed when the key is pressed
cmd = "systemctl reboot -l"
######################################

######################################

# Setting for the selector of the desktop environment you are using.
[environment_switcher]
# Terms:
# ---------
# Movers: indicators which show which direction one can move whilst selecting
# the desktop environment
# Selected: The currently selected desktop environment.
# Neighbours: The adjacent desktop environment to the one current selected
#
# Visualisation:
#
#    <     i3       bspwm     awesome   >
#
#    ^      ^         ^          ^      ^
#    |      |         |          |      |
#  mover    |      selected      |    mover
#           |                    |      
#       neighbour            neighbour
# ---------
#

# Control the visiblity of the switcher
# Options:
# - "visible" - Always show the switcher [default]
# - "hidden"  - Always hide the switcher
# - [key]     - F1-F12 to be able to toggle the visiblity
switcher_visibility = "visible"

# The text in the top-left to display how to toggle the switcher. The text
# '%key%' will be replaced with the switcher_visibility key. This is not shown
# if switcher_visiblity is set to "visible" or "hidden".
toggle_hint = "Switcher %key%"

# The color and modifiers of the hint in the top-left corner
toggle_hint_color = "$subtext"
toggle_hint_modifiers = ""


# Show an option for the TTY shell when logging in as one of the environments. 
# NOTE: it is always shown when no viable options are found. 
include_tty_shell = false

# Remember the selected environment after logging in for the next time
remember = true

# Enables showing the movers
show_movers = true

# Mover's color and modifiers whilst the selector is unfocused
mover_color = "$subtext" 
mover_modifiers = ""

# Mover's color and modifiers whilst the selector is focused
mover_color_focused = "$highlight"
mover_modifiers_focused = "bold" 

# The characters used to display the movers. Suggestions are:
# -  "<"  ">"
# - "<-"  "->"
# - "<<"  ">>"
# -  "["  "]"
left_mover = "<"
right_mover = ">"

# The margin between the movers and the neighbours or selected (depending on
# `show_neighbours`)
mover_margin = 1

# Enables showing the neighbours
show_neighbours = true

# Neighbours' color and modifiers whilst the selector is unfocused
neighbour_color = "$subtext"
neighbour_modifiers = ""

# Neighbours' color and modifiers whilst the selector is focused
neighbour_color_focused = "$subtext"
neighbour_modifiers_focused = ""

# Margin between neighbours and selected
neighbour_margin = 1

# Selected's color and modifiers whilst the selector is unfocused
selected_color = "$text"
selected_modifiers = "underlined"

# Selected's color and modifiers whilst the selector is focused
selected_color_focused = "$highlight"
selected_modifiers_focused = "bold"

# The length of the name of the desktop environment which is displayed.
max_display_length = 8

# The text used when no desktop environments are available
no_envs_text = "No environments..."

# The color and modifiers of the 'no desktop environments available text'
# whilst the selector is unfocused
no_envs_color = "$subtext"
no_envs_modifiers = ""

# The color and modifiers of the 'no desktop environments available text'
# whilst the selector is focused
no_envs_color_focused = "$error"
no_envs_modifiers_focused = ""
######################################

######################################
# Username
[username_field]

# Remember the username for the next time after a successful login attempt.
remember = true

[username_field.style]
# Enables showing a title
show_title = true
# The text used within the title
title = "Username"

# The title's color and modifiers whilst the username field is unfocused
title_color = "$text"
content_color = "$text"

# The title's color and modifiers whilst the username field is focused
title_color_focused = "$highlight"
content_color_focused = "$highlight"

# Enables showing the borders
show_border = true
# The borders' color and modifiers whilst the username field is unfocused
border_color = "$text"
# The borders' color and modifiers whilst the username field is focused
border_color_focused = "$highlight"

# Constrain the width of the username field
use_max_width = true
# The contraint of the username field's width
max_width = 48
######################################

######################################
# Password
[password_field]

# The character used for replacement when typing a password. Leave empty for no
# feedback.
# Note: Only one character is accepted.
content_replacement_character = "#"

[password_field.style]
# Enables showing a title
show_title = true
# The text used within the title
title = "Password"

# The title's color and modifiers whilst the password field is unfocused
title_color = "$text"
content_color = "$text"

# The title's color and modifiers whilst the password field is focused
title_color_focused = "$highlight"
content_color_focused = "$highlight"

# Enables showing the borders
show_border = true
# The borders' color and modifiers whilst the username field is unfocused
border_color = "$text"
# The borders' color and modifiers whilst the username field is focused
border_color_focused = "$highlight"

# Constrain the width of the password field
use_max_width = true
# The contraint of the password field's width
max_width = 48
######################################

@amsyarzero
Copy link

amsyarzero commented Jan 31, 2024

I read a bit more about tty (the text-only part we interact with before logging in) and it seems that tty only supports 16 colors. There is a way to change it, but it requires a bit more fiddling with the built-in colors.

@coastalwhite , sorry for ping again, but could you confirm whether Lemurs, in tty, uses 16 or 256 colors?

@coastalwhite
Copy link
Owner

Yeah, this seems like a mess up on my part. As mentioned in the crossterm docs. It seems that only a small selection of the colors that are settable in lemurs is actually visible in the TTY. Lemurs in the TTY uses 256 colors.

@amsyarzero
Copy link

Thank you for the confirmation, coastalwhite. After changing the colors to the options provided in extra/config.toml:

  • black
  • white
  • (dark) gray
  • (light) red
  • (light) blue
  • (light) green
  • (light) magenta
  • (light) cyan
  • (light) yellow
  • orange

I can confirm that the colors display properly now.

@WyeneCloud unfortunately, this is a limitation of the tty itself, which Lemurs uses during bootup, so you can only use these colors.

@tryedandcatched
Copy link
Author

Thanks you.
sorry for the late response, are you sure there is no work around?

@amsyarzero
Copy link

amsyarzero commented Feb 12, 2024

Thanks you. sorry for the late response, are you sure there is no work around?

Unfortunately, there is no workaround for now. Unless you manage to change the tty itself to something that can support 256-bit colors.

EDIT: Check out this fork of kmscon, which allows for 256-bit support in tty. However, anything related to that is beyond the scope of this issue.

@coastalwhite coastalwhite added the bug Something isn't working label Mar 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants