You are not logged in.
So, my linux tty theme is a cyan foreground on black background, the problems I'm facing right now is agetty having the cursor to grey on login while everything else is cyan and bash prompt resetting to the default grey on black colour whenever you use commands like vim or pacman -Syu.
Any way to change the cursor color to blue on login as well as prompt? and making the foreground color persistent across commands or setting it as default?
Things I tried: setterm didn't help, passing -I "\e]12;cyan\a" on aggety@.service.d/config.conf didn't help. Any help is appreciated, thanks!
Last edited by Erwin Iosef (2025-01-28 18:23:19)
Offline
How do you set the color scheme? Sth. like
#!/bin/sh
if [ "$TERM" = "linux" ]; then
/bin/echo -e "
\e]P0282a2e
\e]P1a54242
\e]P28c9440
\e]P3de935f
\e]P45f819d
\e]P585678f
\e]P65e8d87
\e]P7707880
\e]P8373b41
\e]P9cc6666
\e]PAb5bd68
\e]PBf0c674
\e]PC81a2be
\e]PDb294bb
\e]PE8abeb7
\e]PFc5c8c6
"
# get rid of artifacts
clear
fi
Offline
How do you set the color scheme?
I just wrote PS1='\e]12;cyan\a[\u@\h \W]\$ ' in bash.bashrc.
Offline
That just sets the current color code and (as you figured) is not going to work - the moment anything runs "\e[0m" (your line looks wrong btw?) this is lost.
If you want to change the terminal colors and make white cyan, see the posted approach and terminal.sexy to easily generate yourself a colorscheme you like.
Offline
That just sets the current color code and (as you figured) is not going to work - the moment anything runs "\e[0m" (your line looks wrong btw?) this is lost
I noticed how the wiki doesn't make any mention of this issue in its bash color prompting article for some reason and didn't provide any alternatives unless I'm wrong. I'll check the link out meantime, thank you very much.
(your line looks wrong btw?)
I made the line up from scratch because I was away from my machine to copy, the line that is correct works on my machine, don't worry about it.
Offline
Yeah, but that's about making the priompt look fancy - not change the global textcolor.
It's to do stuff like this:
Offline
How do you set the color scheme? Sth. like
#!/bin/sh if [ "$TERM" = "linux" ]; then /bin/echo -e " \e]P0282a2e \e]P1a54242 \e]P28c9440 \e]P3de935f \e]P45f819d \e]P585678f \e]P65e8d87 \e]P7707880 \e]P8373b41 \e]P9cc6666 \e]PAb5bd68 \e]PBf0c674 \e]PC81a2be \e]PDb294bb \e]PE8abeb7 \e]PFc5c8c6 " # get rid of artifacts clear fi
Wait so I just choose the font and color on the site and then export and download right?
How do I implement a Linux console theme then?
Offline
Yeah, but that's about making the priompt look fancy - not change the global textcolor.
It's to do stuff like this:
https://images.hanselman.com/blog/Windo … 5e6d9d.png
Ahh I see but still it does mention changing foregorund.
Last edited by Erwin Iosef (2025-01-28 14:25:08)
Offline
You put that into an executable script or your bashrc, executing that echo command will alter the colors likey you'd point-and-click configure them in a GUI.
Please don't bump (edit your previous post if nobody has yet replied) and also avoid bloating the thread with pointless full-quotes.
Thanks.
Offline
Of course, my bad and got it! Thanks for your help!
Offline
@seth I put it inside bashrc and tried it in a tty but didn't work after doing `ls -l` command. It went back to a grey.
Last edited by Erwin Iosef (2025-01-28 14:41:42)
Offline
What script did you generate at terminal.sexy?
And what happens if you remove the color code from your prompt?
Offline
#!/bin/sh
if [ "$TERM" = "linux" ]; then
/bin/echo -e "
\e]P0282a2e
\e]P1a54242
\e]P28c9440
\e]P3de935f
\e]P45f819d
\e]P585678f
\e]P65e8d87
\e]P7707880
\e]P8373b41
\e]P9cc6666
\e]PAb5bd68
\e]PBf0c674
\e]PC00ffff
\e]PDb294bb
\e]PE8abeb7
\e]PFc5c8c6
"
# get rid of artifacts
clear
fi
This one.
The background is a lighter black/greyish with the colours looking more modern and not the full contrast ones, if you understand.
Last edited by Erwin Iosef (2025-01-28 16:22:10)
Offline
Please use [code][/code] tags, not "quote" tags. Edit your post in this regard.
That's the sites default scheme and you just changed blue to cyan?
Try changing colors 7 & 15 to what you want to use as standard foreground.
Offline
Alright now it works and I understood how the colours work now, I thought it was just a pallet of colours to choose from. I checked with `pacman -Syu` and `ls -l`, it works on both occassions.
I want to keep the background black though, is removing all the colours except for 7 and 15 sufficient or should I change the background(0 and 8 maybe)?
Offline
Alright changing 0 and 8 worked and the theme looks excellent and as I want it to be, thank you so much @seth.
Last edited by Erwin Iosef (2025-01-28 16:33:34)
Offline
There're just 16 colors, https://wiki.archlinux.org/title/Color_ … _with_tput
They're then invoked by stuff™ by printing special-secret escape sequences to tell the terminal to now please use this kind of color.
More modern/GUI TEs support more colors, so you can have shades of gray and all sorts of nice things.
The colors are arbitrary, but if you set all (but black) to the same value, you end up with a monochromatic display.
Please always remember to mark resolved threads by editing your initial posts subject - so others will know that there's no task left, but maybe a solution to find.
Thanks.
Offline
@seth is the `clear` really necessary because I don't want my issue to dissapear but not doing so sends the prompt down some lines after login.
Offline
You'd make sure to run this before the issue but it's not strictly necessary and whether you get any remaining artifacts you'll have to try and see.
Offline
Adding `> /dev/null` to the echo command solved it. Currently testing things right now.
EDIT: That brought back the issue of the prompt losing color changes after command.
Last edited by Erwin Iosef (2025-01-28 17:37:32)
Offline
Alright so I used the blank lines produced by the escape characters printing to my advantage and produced something like this:
# /etc/profile
echo -e " \e]P0000000
$(fortune) \e]P700ffff"
# get rid of artifacts
#clear
BTW how would you execute code before /etc/issue? Something like rc scripts?
Last edited by Erwin Iosef (2025-01-28 18:13:04)
Offline
Alright so I think I solved my problems for the bash color change and cursor color, with this summary:
# /etc/profile
echo -e " \e]P0000000 \e]P700ffff" #or you can use above code for profile
# get rid of artifacts
#clear
and
# /etc/issue
\e]P0000000 // your issue here//
EDIT: ALSO if you have multiple escape lines and want to avoid the blank lines being created, try joining all of them in a single line separated by spaces, like this:
echo -e "\e]P0000000 \e]P0000001"
Integrates seamlessly with everything almost.
Thank you @seth for your help. Marking as solved.
Last edited by Erwin Iosef (2025-01-28 18:29:27)
Offline
Note that the systemd log lines will show blue with these configs, don't know a fix yet but post if you(the reader) has one.
Offline