2023-09-03 18:26:58 +02:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
|
|
|
|
# From Nightfox theme
|
|
|
|
# Upstream: https://github.com/edeneast/nightfox.nvim
|
|
|
|
|
|
|
|
import poezio.theming
|
|
|
|
from datetime import datetime
|
|
|
|
|
|
|
|
NFOX_BLACK = "#393b44"
|
|
|
|
NFOX_RED = "#c94f6d"
|
|
|
|
NFOX_GREEN = "#81b29a"
|
|
|
|
NFOX_YELLOW = "#dbc074"
|
|
|
|
NFOX_BLUE = "#719cd6"
|
|
|
|
NFOX_MAGENTA = "#9d79d6"
|
|
|
|
NFOX_CYAN = "#63cdcf"
|
|
|
|
NFOX_WHITE = "#dfdfe0"
|
|
|
|
NFOX_ORANGE = "#f4a261"
|
|
|
|
NFOX_PINK = "#d67ad2"
|
|
|
|
|
|
|
|
NFOX_COMMENT = "#738091"
|
|
|
|
|
|
|
|
NFOX_BG0 = "#131a24"
|
|
|
|
NFOX_BG1 = "#192330"
|
|
|
|
NFOX_BG2 = "#212e3f"
|
|
|
|
NFOX_BG3 = "#29394f"
|
|
|
|
NFOX_BG4 = "#39506d"
|
|
|
|
|
|
|
|
NFOX_FG0 = "#d6d6d7"
|
|
|
|
NFOX_FG1 = "#cdcecf"
|
|
|
|
NFOX_FG2 = "#aeafb0"
|
|
|
|
NFOX_FG3 = "#71839b"
|
|
|
|
|
|
|
|
NFOX_SEL0 = "#2b3b51"
|
|
|
|
NFOX_SEL1 = "#3c5372"
|
|
|
|
|
|
|
|
# Redefine with 256 colors until poezio manages 24 bits
|
|
|
|
|
|
|
|
NFOX_BLACK = 59
|
|
|
|
NFOX_RED = 167
|
|
|
|
NFOX_GREEN = 108
|
|
|
|
NFOX_YELLOW = 180
|
|
|
|
NFOX_BLUE = 39
|
|
|
|
NFOX_MAGENTA = 140
|
|
|
|
NFOX_CYAN = 80
|
|
|
|
NFOX_WHITE = 188
|
|
|
|
NFOX_ORANGE = 215
|
|
|
|
NFOX_PINK = 176
|
|
|
|
|
|
|
|
NFOX_COMMENT = 102
|
|
|
|
|
|
|
|
NFOX_BG0 = 232
|
|
|
|
NFOX_BG1 = 234
|
|
|
|
NFOX_BG2 = 236
|
|
|
|
NFOX_BG3 = 237
|
|
|
|
NFOX_BG4 = 59
|
|
|
|
|
|
|
|
NFOX_FG0 = 253
|
|
|
|
NFOX_FG1 = 188
|
|
|
|
NFOX_FG2 = 145
|
|
|
|
NFOX_FG3 = 67
|
|
|
|
|
|
|
|
NFOX_SEL0 = 24
|
|
|
|
NFOX_SEL1 = 67
|
|
|
|
|
|
|
|
class NightfoxTheme(poezio.theming.Theme):
|
|
|
|
SHORT_TIME_FORMAT = '%H:%M'
|
|
|
|
SHORT_TIME_FORMAT_LENGTH = len(datetime.now().strftime(SHORT_TIME_FORMAT))
|
|
|
|
|
|
|
|
LONG_TIME_FORMAT = '%Y-%m-%d %H:%M:%S'
|
|
|
|
LONG_TIME_FORMAT_LENGTH = len(datetime.now().strftime(LONG_TIME_FORMAT))
|
|
|
|
|
|
|
|
CHAR_TIME_LEFT = ''
|
|
|
|
CHAR_TIME_RIGHT = ''
|
|
|
|
CHAR_STATUS = '█'
|
|
|
|
CHAR_CHATSTATE_ACTIVE = 'A'
|
|
|
|
CHAR_CHATSTATE_COMPOSING = '…'
|
|
|
|
CHAR_CHATSTATE_PAUSED = 'p'
|
|
|
|
|
|
|
|
CHAR_AFFILIATION_OWNER = '♚'
|
|
|
|
CHAR_AFFILIATION_ADMIN = '♞'
|
|
|
|
CHAR_AFFILIATION_MEMBER = '♜'
|
|
|
|
CHAR_AFFILIATION_NONE = '♟'
|
|
|
|
CHAR_AFFILIATION_OUTCAST = '!'
|
|
|
|
|
|
|
|
CHAR_XML_IN = '←'
|
|
|
|
CHAR_XML_OUT = '→'
|
|
|
|
|
|
|
|
COLOR_OWN_NICK = (NFOX_CYAN, -1)
|
|
|
|
|
|
|
|
CHAR_BEFORE_NICK_ME = '@'
|
|
|
|
CHAR_AFTER_NICK_ME = ' '
|
|
|
|
CHAR_AFTER_NICK = ': '
|
|
|
|
CHAR_JOIN = '→'
|
|
|
|
CHAR_QUIT = '←'
|
|
|
|
CHAR_KICK = '-!-'
|
|
|
|
CHAR_NEW_TEXT_SEPARATOR = '┄'
|
2023-09-03 18:53:56 +02:00
|
|
|
CHAR_OK = 'OK'
|
2023-09-03 18:26:58 +02:00
|
|
|
CHAR_ERROR = '!'
|
|
|
|
CHAR_EMPTY = ' '
|
|
|
|
CHAR_ACK_RECEIVED = CHAR_OK
|
|
|
|
CHAR_NACK = CHAR_ERROR
|
|
|
|
CHAR_COLUMN_ASC = ' ↗'
|
|
|
|
CHAR_COLUMN_DESC = ' ↘'
|
|
|
|
CHAR_ROSTER_ERROR = CHAR_ERROR
|
|
|
|
CHAR_ROSTER_TUNE = '♪'
|
|
|
|
CHAR_ROSTER_ASKED = '?'
|
|
|
|
CHAR_ROSTER_ACTIVITY = 'A'
|
|
|
|
CHAR_ROSTER_MOOD = 'M'
|
|
|
|
CHAR_ROSTER_GAMING = 'G'
|
|
|
|
CHAR_ROSTER_FROM = '←'
|
|
|
|
CHAR_ROSTER_BOTH = ' '
|
|
|
|
CHAR_ROSTER_TO = '→'
|
|
|
|
CHAR_ROSTER_NONE = '¬'
|
|
|
|
|
|
|
|
COLOR_INFORMATION_BAR = (NFOX_FG3, NFOX_BG1)
|
|
|
|
COLOR_WARNING_PROMPT = (NFOX_ORANGE, NFOX_BG1, 'b')
|
|
|
|
|
|
|
|
COLOR_STATUS_XA = (NFOX_FG0, NFOX_BG1)
|
|
|
|
COLOR_STATUS_AWAY = (NFOX_PINK, NFOX_BG1)
|
|
|
|
COLOR_STATUS_DND = (NFOX_RED, NFOX_BG1)
|
|
|
|
COLOR_STATUS_CHAT = (NFOX_BLUE, NFOX_BG1)
|
|
|
|
COLOR_STATUS_UNAVAILABLE = (NFOX_COMMENT, NFOX_BG1)
|
|
|
|
COLOR_STATUS_ONLINE = (NFOX_GREEN, NFOX_BG1)
|
|
|
|
COLOR_STATUS_NONE = (NFOX_FG1, NFOX_BG1)
|
|
|
|
|
|
|
|
COLOR_VERTICAL_SEPARATOR = (NFOX_COMMENT, -1)
|
|
|
|
COLOR_NEW_TEXT_SEPARATOR = (NFOX_COMMENT, -1)
|
|
|
|
COLOR_MORE_INDICATOR = (NFOX_MAGENTA, -1)
|
|
|
|
|
|
|
|
COLOR_TAB_NORMAL = (-1, NFOX_BG1)
|
|
|
|
COLOR_TAB_NONEMPTY = (-1, NFOX_BG3)
|
|
|
|
COLOR_TAB_JOINED = (NFOX_YELLOW, NFOX_BG1)
|
|
|
|
COLOR_TAB_CURRENT = (-1, NFOX_SEL0)
|
|
|
|
COLOR_TAB_COMPOSING = (NFOX_GREEN, NFOX_BG1)
|
|
|
|
COLOR_TAB_NEW_MESSAGE = (NFOX_ORANGE, NFOX_BG1)
|
|
|
|
COLOR_TAB_HIGHLIGHT = (NFOX_CYAN, NFOX_BG1)
|
|
|
|
COLOR_TAB_ATTENTION = (NFOX_RED, NFOX_BG1)
|
|
|
|
COLOR_TAB_PRIVATE = (NFOX_BLUE, NFOX_BG1)
|
|
|
|
COLOR_TAB_DISCONNECTED = (NFOX_COMMENT, NFOX_BG1)
|
|
|
|
COLOR_TAB_SCROLLED = (NFOX_PINK, NFOX_BG1)
|
|
|
|
|
|
|
|
COLOR_TOPIC_BAR = (-1, NFOX_BG1)
|
2023-09-03 18:53:56 +02:00
|
|
|
COLOR_SCROLLABLE_NUMBER = (NFOX_BLUE, NFOX_BG1, 'b')
|
2023-09-03 18:26:58 +02:00
|
|
|
COLOR_SELECTED_ROW = (-1, NFOX_SEL0)
|
|
|
|
COLOR_PRIVATE_NAME = (NFOX_BLUE, NFOX_BG1)
|
|
|
|
COLOR_CONVERSATION_NAME = (NFOX_GREEN, NFOX_BG1)
|
|
|
|
COLOR_CONVERSATION_RESOURCE = (NFOX_YELLOW, NFOX_BG1)
|
|
|
|
COLOR_GROUPCHAT_NAME = (NFOX_FG1, NFOX_BG1)
|
|
|
|
COLOR_COLUMN_HEADER = (NFOX_CYAN, NFOX_BG3)
|
|
|
|
COLOR_COLUMN_HEADER_SEL = (NFOX_CYAN, NFOX_SEL0)
|
|
|
|
|
|
|
|
COLOR_VERTICAL_TAB_NORMAL = (NFOX_FG2, -1)
|
|
|
|
COLOR_VERTICAL_TAB_NONEMPTY = (-1, NFOX_BG3)
|
|
|
|
COLOR_VERTICAL_TAB_JOINED = (NFOX_YELLOW, -1)
|
|
|
|
COLOR_VERTICAL_TAB_SCROLLED = (NFOX_PINK, -1)
|
|
|
|
COLOR_VERTICAL_TAB_CURRENT = (-1, NFOX_SEL0)
|
|
|
|
COLOR_VERTICAL_TAB_NEW_MESSAGE = (NFOX_ORANGE, -1)
|
|
|
|
COLOR_VERTICAL_TAB_COMPOSING = (NFOX_GREEN, -1)
|
|
|
|
COLOR_VERTICAL_TAB_HIGHLIGHT = (NFOX_CYAN, -1)
|
|
|
|
COLOR_VERTICAL_TAB_PRIVATE = (NFOX_BLUE, -1)
|
|
|
|
COLOR_VERTICAL_TAB_ATTENTION = (NFOX_RED, -1)
|
|
|
|
COLOR_VERTICAL_TAB_DISCONNECTED = (NFOX_COMMENT, -1)
|
|
|
|
COLOR_VERTICAL_TAB_NUMBER = (NFOX_BLUE, -1)
|
|
|
|
|
|
|
|
COLOR_INFORMATION_TEXT = (NFOX_BLUE, -1)
|
|
|
|
COLOR_NORMAL_TEXT = (NFOX_FG1, -1)
|
|
|
|
COLOR_WARNING_TEXT = (NFOX_ORANGE, -1)
|
|
|
|
|
|
|
|
COLOR_LOG_MSG = (NFOX_COMMENT, -1)
|
|
|
|
COLOR_ERROR_MSG = (NFOX_RED, NFOX_BG2, 'b')
|
|
|
|
|
|
|
|
COLOR_HELP_COMMANDS = (NFOX_GREEN, -1)
|
|
|
|
COLOR_HIGHLIGHT_NICK = "reverse"
|
|
|
|
COLOR_MUC_JID = (NFOX_BLUE, -1)
|
|
|
|
|
|
|
|
COLOR_USER_VISITOR = (NFOX_FG1, -1)
|
|
|
|
COLOR_USER_PARTICIPANT = (NFOX_FG2, -1)
|
|
|
|
COLOR_USER_NONE = (NFOX_COMMENT, -1)
|
|
|
|
COLOR_USER_MODERATOR = (NFOX_MAGENTA, -1)
|
|
|
|
COLOR_REMOTE_USER = (NFOX_ORANGE, -1)
|
|
|
|
|
|
|
|
COLOR_XML_IN = (NFOX_BLUE, -1)
|
|
|
|
COLOR_XML_OUT = (NFOX_GREEN, -1)
|
|
|
|
|
|
|
|
COLOR_ME_MESSAGE = (NFOX_CYAN, -1)
|
|
|
|
|
|
|
|
COLOR_REVISIONS_MESSAGE = (NFOX_MAGENTA, -1, 'b')
|
|
|
|
|
|
|
|
COLOR_IMPORTANT_TEXT = (NFOX_RED, -1, 'b')
|
|
|
|
|
|
|
|
COLOR_TIME_STRING = (NFOX_COMMENT, -1)
|
|
|
|
|
|
|
|
COLOR_CHAR_ACK = (NFOX_GREEN, -1)
|
|
|
|
COLOR_CHAR_NACK = (NFOX_ORANGE, -1)
|
|
|
|
|
|
|
|
COLOR_ROSTER_GAMING = (NFOX_CYAN, -1)
|
|
|
|
COLOR_ROSTER_MOOD = (NFOX_PINK, -1)
|
|
|
|
COLOR_ROSTER_ACTIVITY = (NFOX_GREEN, -1)
|
|
|
|
COLOR_ROSTER_TUNE = (NFOX_BLUE, -1)
|
|
|
|
COLOR_ROSTER_ERROR = (NFOX_RED, -1)
|
|
|
|
COLOR_ROSTER_SUBSCRIPTION = (NFOX_FG1, -1)
|
|
|
|
|
|
|
|
COLOR_JOIN_CHAR = (NFOX_FG2, -1)
|
|
|
|
COLOR_QUIT_CHAR = (NFOX_FG2, -1)
|
|
|
|
COLOR_KICK_CHAR = (NFOX_RED, -1)
|
|
|
|
|
|
|
|
MODE_TAB_NORMAL = ''
|
|
|
|
MODE_TAB_IMPORTANT = ''
|
|
|
|
MODE_TAB_NAME = ''
|
|
|
|
|
|
|
|
INFO_COLORS = {
|
|
|
|
'info': (NFOX_BLUE, -1),
|
|
|
|
'error': (NFOX_RED, 7, 'b'),
|
|
|
|
'warning': (NFOX_ORANGE, -1),
|
|
|
|
'roster': (NFOX_FG1, -1),
|
|
|
|
'help': (NFOX_GREEN, -1),
|
|
|
|
'headline': (NFOX_FG2, -1, 'b'),
|
|
|
|
'tune': (NFOX_BLUE, -1),
|
|
|
|
'gaming': (NFOX_CYAN, -1),
|
|
|
|
'mood': (NFOX_PINK, -1),
|
|
|
|
'activity': (NFOX_GREEN, -1),
|
|
|
|
'default': (NFOX_FG1, -1),
|
|
|
|
}
|
|
|
|
|
|
|
|
LIST_COLOR_NICKNAMES = [
|
|
|
|
(1, -1), (2, -1), (3, -1), (4, -1), (5, -1), (6, -1), (9, -1),
|
|
|
|
(10, -1), (11, -1), (12, -1), (13, -1), (14, -1), (19, -1),
|
|
|
|
(20, -1), (21, -1), (22, -1), (23, -1), (24, -1), (25, -1),
|
|
|
|
(26, -1), (27, -1), (28, -1), (29, -1), (30, -1), (31, -1),
|
|
|
|
(32, -1), (33, -1), (34, -1), (35, -1), (36, -1), (37, -1),
|
|
|
|
(38, -1), (39, -1), (40, -1), (41, -1), (42, -1), (43, -1),
|
|
|
|
(44, -1), (45, -1), (46, -1), (47, -1), (48, -1), (49, -1),
|
|
|
|
(50, -1), (51, -1), (54, -1), (55, -1), (56, -1), (57, -1),
|
|
|
|
(58, -1), (60, -1), (61, -1), (62, -1), (63, -1), (64, -1),
|
|
|
|
(65, -1), (66, -1), (67, -1), (68, -1), (69, -1), (70, -1),
|
|
|
|
(71, -1), (72, -1), (73, -1), (74, -1), (75, -1), (76, -1),
|
|
|
|
(77, -1), (78, -1), (79, -1), (81, -1), (82, -1),
|
|
|
|
(83, -1), (84, -1), (85, -1), (86, -1), (87, -1), (88, -1),
|
|
|
|
(89, -1), (90, -1), (91, -1), (92, -1), (93, -1), (94, -1),
|
|
|
|
(95, -1), (96, -1), (97, -1), (98, -1), (99, -1), (100, -1),
|
|
|
|
(101, -1), (103, -1), (104, -1), (105, -1), (106, -1), (107, -1),
|
|
|
|
(108, -1), (109, -1), (110, -1), (111, -1), (112, -1), (113, -1),
|
|
|
|
(114, -1), (115, -1), (116, -1), (117, -1), (118, -1), (119, -1),
|
|
|
|
(120, -1), (121, -1), (122, -1), (123, -1), (124, -1), (125, -1),
|
|
|
|
(126, -1), (127, -1), (128, -1), (129, -1), (130, -1), (131, -1),
|
|
|
|
(132, -1), (133, -1), (134, -1), (135, -1), (136, -1), (137, -1),
|
|
|
|
(138, -1), (139, -1), (140, -1), (141, -1), (142, -1), (143, -1),
|
|
|
|
(144, -1), (145, -1), (146, -1), (147, -1), (148, -1), (149, -1),
|
|
|
|
(150, -1), (151, -1), (152, -1), (153, -1), (154, -1), (155, -1),
|
|
|
|
(156, -1), (157, -1), (158, -1), (159, -1), (160, -1), (161, -1),
|
|
|
|
(162, -1), (163, -1), (164, -1), (165, -1), (166, -1), (167, -1),
|
|
|
|
(168, -1), (169, -1), (170, -1), (171, -1), (172, -1), (173, -1),
|
|
|
|
(174, -1), (175, -1), (176, -1), (177, -1), (178, -1), (179, -1),
|
|
|
|
(180, -1), (181, -1), (182, -1), (183, -1), (184, -1), (185, -1),
|
|
|
|
(186, -1), (187, -1), (188, -1), (189, -1), (190, -1), (191, -1),
|
|
|
|
(192, -1), (193, -1), (196, -1), (197, -1), (198, -1), (199, -1),
|
|
|
|
(200, -1), (201, -1), (202, -1), (203, -1), (204, -1), (205, -1),
|
|
|
|
(206, -1), (207, -1), (208, -1), (209, -1), (210, -1), (211, -1),
|
|
|
|
(212, -1), (213, -1), (214, -1), (215, -1), (216, -1), (217, -1),
|
|
|
|
(218, -1), (219, -1), (220, -1), (221, -1), (222, -1), (223, -1),
|
|
|
|
(224, -1), (225, -1), (226, -1), (227, -1)]
|
|
|
|
|
|
|
|
theme = NightfoxTheme()
|