Skip to content

Instantly share code, notes, and snippets.

@jessedavidd
Last active May 4, 2026 21:13
Show Gist options
  • Select an option

  • Save jessedavidd/dd3b3a6a4b922d611006d194e82e7103 to your computer and use it in GitHub Desktop.

Select an option

Save jessedavidd/dd3b3a6a4b922d611006d194e82e7103 to your computer and use it in GitHub Desktop.
Guide: How to change the colors of Ly (display manager)

How to change background color of Ly

The background color cannot be changed by editing the Ly config file at /etc/ly/config.ini. The bg variable in that config file refers only to the dialog box and the 'menu bar' at the top. The actual background of the entire screen will always be black no matter the bg value.

Somewhat confusing, I know.

There are a couple of ways we can edit the background (and foreground) colors. To better understand how we can achieve these goals, it's important to understand that we're actually not modifying the behavior of ly per se, but changing the colors of the tty session itself.

Solution 1: printf

First, edit the file at /lib/systemd/system/ly.service and add the following in:

ExecStartPre=/usr/bin/printf '%%b' '\e]P0FFC5C4\e]P7FFFFFF\ec'

Like so:

[Unit]
Description=TUI display manager
After=systemd-user-sessions.service plymouth-quit-wait.service
[email protected]
[Service]
Type=idle
ExecStartPre=/usr/bin/printf '%%b' '\e]P0FFC5C4\e]P7FFFFFF\ec'
ExecStart=/usr/bin/ly
StandardInput=tty
TTYPath=/dev/tty2
TTYReset=yes
TTYVHangup=yes
[Install]
Alias=display-manager.service

The above example sets color0(bg) to #FFC5C4 and color7(fg) to #FFFFFF.

Now if you reboot your machine, the colors should've changed. However, when logging out, the colors will revert back to the defaults. To fix this, we need to modify another file and add in the same printf command.

In /etc/ly/config.ini uncomment term_reset_cmd and add the following:

/usr/bin/printf '%b' '\e]P0FFC5C4\e]P7FFFFFF\ec'

Like so:

term_reset_cmd = /usr/bin/tput reset; /usr/bin/printf '%%b' '\e]P0FFC5C4\e]P7FFFFFF\ec'

Now reboot and you should be good to go! 🤩

Solution 2: echo

We can achieve the same thing by using the echo command. The steps are exactly the same, only difference being the command used. If you want to use this method instead, just replace the printf command with the following:

echo -en "\e]P0FFC5C4"; echo -en "\e]P7FFFFFF\ec"; clear

Source

@michael-kudrik
Copy link
Copy Markdown

Couldn't get this to work for me :/

@jessedavidd
Copy link
Copy Markdown
Author

@michael-kudrik hmm… it’s been a while since I last used Ly so I’m not sure if something’s changed since I posted this. I’ll try to find some time to test this and see if I can get it to work.

@m3h3d1ha2an
Copy link
Copy Markdown

@michael-kudrik hmm… it’s been a while since I last used Ly so I’m not sure if something’s changed since I posted this. I’ll try to find some time to test this and see if I can get it to work.

thanks I am waiting

@jessedavidd
Copy link
Copy Markdown
Author

jessedavidd commented Feb 1, 2025

@michael-kudrik @thecodermehedi I was able to figure it out. What I should've specified in the post itself is that when you make these changes, you're actually never changing the behavior of ly itself, you're actually changing the color of the tty session. Either way, here are a couple of solutions:

Solution 1:
If you want to use the same solution as in the post, you need to remove one of the % from this line in /etc/ly/config.ini:

/usr/bin/printf '%%b' '\e]P0FFC5C4\e]P7FFFFFF\ec

I'm actually not sure why this fixes the issue, but it does. If you know, feel free to enlighten me!

Solution 2:
While troubleshooting this I stumbled across another method of achieving the same thing. You might want to give this one a go if you struggle to get the first one to work properly!

Essentially, all you need to do is instead of using printf, you use the humble echo. Edit the file at /lib/systemd/system/ly.service and edit the ExecStartPre line like so:

ExecStartPre=echo -en "\e]P0FFC5C4"; echo -en "\e]P7FFFFFF\ec"; clear

And then in /etc/ly/config.ini modify term_reset_cmd like so:

term_reset_cmd = /usr/bin/tput reset; echo -en "\e]P0FFC5C4"; echo -en "\e]P7FFFFFF\ec"; clear

@glxguard
Copy link
Copy Markdown

glxguard commented Apr 11, 2025

If answers above didn't help you then try this:
My DINIT service(you can just copy command to systemd ly.service):

type = process
restart = true
smooth-recovery = true
command += /usr/bin/bash "/boot/colorchange.sh"
depends-on = loginready
termsignal = HUP
options = shares-console

And my script that you need to write to /boot/colorchange.sh:
# !/bin/bash
/usr/bin/printf '%b' '\e]P0141624\e]P7FFFFFF\ec'
/usr/bin/ly-dm

@grgmiranda
Copy link
Copy Markdown

grgmiranda commented Mar 6, 2026

Thanks for the gist, it's quite confusing indeed!

The solution in the md file worked for me for the background, but not the foreground.

I fussed around and discovered that in my case (in CachyOS), I had to change the TTY white color (F) and not the lightgrey color (7).

That's the line that worked in my /lib/systemd/system/[email protected] file:

ExecStartPre=/usr/bin/printf '%%b' '\e]P0282828\e]PFe8d196\ec'

I hadn't had to change anything in the ly config file, though.

Maybe that's a correction to make in the instructions: In TTY, if I understood correctly, color 0 and 7 doesn't represent bg and fg, exactly, but black and lightgrey colors. In my case, fg was set as white. This blog post and askubuntu question was helpful for debugging that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment