From 5bf25117b940c9442ddfa3b6f63dd99d84a76819 Mon Sep 17 00:00:00 2001 From: Ari Archer Date: Wed, 17 Aug 2022 01:03:01 +0300 Subject: [PATCH] Improve bash generation in ttytheme Signed-off-by: Ari Archer --- content/js/ttytheme/menu.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/content/js/ttytheme/menu.js b/content/js/ttytheme/menu.js index 407f230..7bcb9ef 100644 --- a/content/js/ttytheme/menu.js +++ b/content/js/ttytheme/menu.js @@ -62,11 +62,11 @@ export function generate_theme(query = "#theme-output") { # Installation: Just add these lines to your ~/.bashrc __tty_theme() { - [ "$TERM" != 'linux' ] && return # Only run in a TTY + [ "$TERM" = 'linux' ] || return # Only run in a TTY `; - for (const key in tty_clrs) { + for (let key in tty_clrs) { let key_rgb = tty_clrs[key].rgb; let key_hex = rgb_to_hex(key_rgb); let rgb_str = `rgb(${key_rgb.join(", ")})`; @@ -148,7 +148,7 @@ function main() { load_from_localtorage(); let menu = document.getElementById("menu"); - for (const key in tty_clrs) { + for (let key in tty_clrs) { let [r, g, b] = tty_clrs[key].rgb; let picker = new_colourpicker(key, [r, g, b]);