ivanp7 commented on 2021-05-20 11:35 (edited on 2021-09-25 01:37 by ivanp7)
To enable 256 color mode properly, do export TERM=fbterm-256color AFTER fbterm
starts and then attach to a tmux session. If TERM is not linux upon fbterm launch,
it will fail. Tmux is needed because fbterm provides escape codes that differ from
broadly used codes, so tmux serves as an abstraction layer.
This is what worked for me:
- Boot arch
- Login to the linux console
- Run start_fbterm.sh
- export TERM=fbterm
- tmux
Notice that I dont do "export TERM=fbterm-256color". I simply do "export TERM=fbterm" If I choose the 256color version it messes everything. Vim, with or without tmux etc.
Notice that I also dont do "tmux -2". Just tmux.
And I do get 256 colors this way.
After 10 years of using tmux and messing with terminals, I found that the best for me is to never touch any settings in tmux or vim etc that might mess with the terminal. So, I also dont do this in tmux.conf:
# set -g default-terminal "tmux-256color"
Let it do and pick whatever it wants to do. If this terminfo/ncurses/termcap database thingy is broken and missing, thats the job of the developers. Linux is 30 years old. These things should work out of the box, without any need for a PhD in ncurses/terminals/escape_sequences etc.
start_fbterm.sh
#!/usr/bin/env sh
#
# start_fbterm.sh
#
export XDG_CONFIG_HOME=~/.config
# hide cursor
echo -ne "\e[?25l"
# Finding wallpaper
bg_wallpaper=${FBTMUX_WALLPAPER:-$(find "$HOME/Pictures" -name 'wallpaper.*' | head -1)}
# Set wallpaper with fbv
if command -v fbv > /dev/null 2>&1 && [ -n "$bg_wallpaper" ]; then
bg_framebuffer=$bg_wallpaper
# regenerate darkened image for framebuffer with convert
if command -v convert > /dev/null 2>&1; then
bg_framebuffer=/tmp/$USER.framebuffer.${bg_wallpaper##*.}
# Compare modified time, only update when needed
# use stat instead of test -nt/-ot command which dereferences links
script_time=$(stat -Lc %Y "$0")
bg_wallpaper_time=$(stat -c %Y "$bg_wallpaper")
[ -e "$bg_framebuffer" ] && bg_framebuffer_time=$(stat -c %Y "$bg_framebuffer")
if [ ! -e "$bg_framebuffer" ] \
|| [ "$bg_framebuffer_time" -lt "$bg_wallpaper_time" ] \
|| [ "$bg_framebuffer_time" -lt "$script_time" ]; then
# convert -modulate brightness,saturation
convert "$bg_wallpaper" -modulate 15,40 -blur 0x4 "$bg_framebuffer"
fi
fi
# start fbterm/yaft with background using fbv
fbv -ciuker "$bg_framebuffer" << EOF
q
EOF
export FBTERM_BACKGROUND_IMAGE=1
fi
fbterm
I'm in in no way a "eye candy" guy or like to waste much time with "themes" and "ricing" or customizing desktops. I actually never used wallpapers before.
But that script just gives you a gorgeous background, rotating pictures, and darkening them, so it doesnt get in your way.It uses "convert" from the ImageMagick package which is standard stuff in Archlinux
I got it from this guy, https://github.com/OliverLew/dotfiles Very much worth checking out
- He is a power user of tmux and fbterm, with a very interesting 'fbtmux' script, completely mimicking a desktop manager (ex. dwm).
- Asian user, so has also configurations for CJK asian fonts and input methods fcitx
The only thing I cant manage to work is changing the color pallete. I do get 256 colors. But no matter how much I google and search git hub, I cant manage to change that horrible deep blue default of fbterm. Tried many "escape sequences" in .profile and .bashrc, but seems like fbterm is a different beast. Not sure of the color syntax to use also . RGB ??? SGR ??? Escape Sequences ? (man console_codes)
This has no effect:
# color-foreground=a6a19b
# color-background=212121
# color-0=303030
# color-1=826023
# color-2=618231
# color-3=7e7b28
# color-4=3e825c
# color-5=82685c
# color-6=749cb3
# color-7=a6a19b
# color-8=484848
# color-9=b48430
# color-10=86b443
# color-11=b0ab37
# color-12=55b47f
# color-13=b4907f
# color-14=9bb4c8
# color-15=d8d1c9
Pinned Comments
ivanp7 commented on 2022-01-16 16:27 (UTC) (edited on 2022-01-16 18:24 (UTC) by ivanp7)
I have applied the proposed "configurable color palette" patch. Now the colors may be specified in the configuration file using numbered parameters
color-num=RRGGBB
.ivanp7 commented on 2021-11-27 21:50 (UTC)
I changed my mind.
$XDG_CONFIG_HOME/fbterm/fbtermrc
is now an allowed configuration location along with the old$XDG_CONFIG_HOME/fbtermrc
. Old location is used only when$XDG_CONFIG_HOME/fbterm/
does not exist.ivanp7 commented on 2021-05-20 11:46 (UTC) (edited on 2021-05-20 13:13 (UTC) by ivanp7)
To set a wallpaper in fbterm, you'll need
fbv
package (framebuffer image viewer). Execute the following instructions right before launching fbterm (works in POSIX-compliant shell like dash):ivanp7 commented on 2021-05-20 11:35 (UTC) (edited on 2021-09-25 01:37 (UTC) by ivanp7)
To enable 256 color mode properly, do
export TERM=fbterm-256color
AFTER fbterm starts and then attach to a tmux session. IfTERM
is notlinux
upon fbterm launch, it will fail. Tmux is needed because fbterm provides escape codes that differ from broadly used codes, so tmux serves as an abstraction layer.Unlike vanilla fbterm, in this version the configuration file is located at
$XDG_CONFIG_HOME/fbtermrc
or$HOME/.config/fbtermrc
ifXDG_CONFIG_HOME
is unset or empty (the original placement is$HOME/.fbtermrc
). Also, the configuration file is not forcibly recreated anymore. For default configuration, see/etc/fbterm/fbtermrc.example
.