mirror of
https://github.com/dylanaraps/pywal.git
synced 2024-11-25 17:33:09 +01:00
colors: Set colors in linux tty.
This commit is contained in:
parent
aadb470931
commit
dd17579437
@ -10,6 +10,14 @@ from .settings import CACHE_DIR, HOME, MODULE_DIR, OS
|
||||
from . import util
|
||||
|
||||
|
||||
def tty():
|
||||
"""Load colors in tty."""
|
||||
tty_script = os.path.join(CACHE_DIR, "colors-tty.sh")
|
||||
|
||||
if os.path.isfile(tty_script):
|
||||
subprocess.Popen([tty_script])
|
||||
|
||||
|
||||
def xrdb(xrdb_files=None):
|
||||
"""Merge the colors into the X db so new terminals use them."""
|
||||
xrdb_files = xrdb_files or \
|
||||
@ -77,3 +85,4 @@ def env(xrdb_file=None):
|
||||
sway()
|
||||
polybar()
|
||||
print("reload: Reloaded environment.")
|
||||
tty()
|
||||
|
22
pywal/templates/colors-tty.sh
Normal file
22
pywal/templates/colors-tty.sh
Normal file
@ -0,0 +1,22 @@
|
||||
#!/bin/sh
|
||||
if [ "${{TERM:-none}}" = "linux" ]; then
|
||||
printf "%b" "\\e]P0{color0.strip}"
|
||||
printf "%b" "\\e]P1{color1.strip}"
|
||||
printf "%b" "\\e]P2{color2.strip}"
|
||||
printf "%b" "\\e]P3{color3.strip}"
|
||||
printf "%b" "\\e]P4{color4.strip}"
|
||||
printf "%b" "\\e]P5{color5.strip}"
|
||||
printf "%b" "\\e]P6{color6.strip}"
|
||||
printf "%b" "\\e]P7{color7.strip}"
|
||||
printf "%b" "\\e]P8{color8.strip}"
|
||||
printf "%b" "\\e]P9{color9.strip}"
|
||||
printf "%b" "\\e]PA{color10.strip}"
|
||||
printf "%b" "\\e]PB{color11.strip}"
|
||||
printf "%b" "\\e]PC{color12.strip}"
|
||||
printf "%b" "\\e]PD{color13.strip}"
|
||||
printf "%b" "\\e]PE{color14.strip}"
|
||||
printf "%b" "\\e]PF{color15.strip}"
|
||||
|
||||
# Fix artifacting.
|
||||
clear
|
||||
fi
|
Loading…
Reference in New Issue
Block a user