From 0b3615c9f50967badb24e5cd890e747a0744dfb5 Mon Sep 17 00:00:00 2001 From: benex Date: Sat, 16 Nov 2024 22:46:19 +0300 Subject: [PATCH] feat: add default rofi themes --- fastanime/assets/rofi_theme.rasi | 84 ++++++++++++++++ fastanime/assets/rofi_theme_confirm.rasi | 55 ++++++++++ fastanime/assets/rofi_theme_input.rasi | 55 ++++++++++ fastanime/assets/rofi_theme_preview.rasi | 122 +++++++++++++++++++++++ fastanime/cli/config.py | 11 +- 5 files changed, 322 insertions(+), 5 deletions(-) create mode 100644 fastanime/assets/rofi_theme.rasi create mode 100644 fastanime/assets/rofi_theme_confirm.rasi create mode 100644 fastanime/assets/rofi_theme_input.rasi create mode 100644 fastanime/assets/rofi_theme_preview.rasi diff --git a/fastanime/assets/rofi_theme.rasi b/fastanime/assets/rofi_theme.rasi new file mode 100644 index 0000000..779078b --- /dev/null +++ b/fastanime/assets/rofi_theme.rasi @@ -0,0 +1,84 @@ +// https://github.com/Wraient/curd/blob/main/rofi/selectanime.rasi +// Go give there project a star! +// Was too lazy to make my own preview, so I just used theirs + + +configuration { + font: "Sans 12"; + line-margin: 10; + display-drun: ""; +} + +* { + background: #000000; /* Black background for everything */ + background-alt: #000000; /* Ensures no alternation */ + foreground: #CCCCCC; + selected: #3584E4; + active: #2E7D32; + urgent: #C62828; +} + +window { + fullscreen: false; + background-color: rgba(0, 0, 0, 1); /* Solid black background */ +} + +mainbox { + padding: 50px 100px; + background-color: rgba(0, 0, 0, 1); /* Ensures black background fills entire main area */ + children: [inputbar, listview]; + spacing: 20px; +} + +inputbar { + background-color: #333333; /* Dark gray background for input bar */ + padding: 8px; + border-radius: 8px; + children: [prompt, entry]; +} + +prompt { + enabled: true; + padding: 8px; + background-color: @selected; + text-color: #000000; + border-radius: 4px; +} + +entry { + padding: 8px; + background-color: #444444; /* Slightly lighter gray for visibility */ + text-color: #FFFFFF; /* White text to make typing visible */ + placeholder: "Search..."; + placeholder-color: rgba(255, 255, 255, 0.5); + border-radius: 6px; +} + +listview { + layout: vertical; + spacing: 8px; + lines: 10; + background-color: @background; /* Consistent black background for list items */ +} + +element { + padding: 12px; + border-radius: 4px; + background-color: @background; /* Uniform color for each list item */ + text-color: @foreground; +} + +element normal.normal { + background-color: @background; /* Ensures no alternating color */ +} + +element selected.normal { + background-color: @selected; + text-color: #FFFFFF; +} + +element-text { + background-color: transparent; + text-color: inherit; + vertical-align: 0.5; +} diff --git a/fastanime/assets/rofi_theme_confirm.rasi b/fastanime/assets/rofi_theme_confirm.rasi new file mode 100644 index 0000000..2c5425e --- /dev/null +++ b/fastanime/assets/rofi_theme_confirm.rasi @@ -0,0 +1,55 @@ +// https://github.com/Wraient/curd/blob/main/rofi/userinput.rasi +// Go give there project a star! +// Was too lazy to make my own preview, so I just used theirs + +configuration { + font: "Sans 12"; +} + +* { + background-color: rgba(0, 0, 0, 0.7); + text-color: #FFFFFF; +} + +window { + fullscreen: true; + transparency: "real"; + background-color: @background-color; +} + +mainbox { + children: [ message, listview, inputbar ]; + padding: 40% 30%; +} + +message { + border: 0; + padding: 10px; + margin: 0 0 20px 0; + font: "Sans Bold 24"; /* Increased font size and made it bold */ +} + +inputbar { + children: [ prompt, entry ]; + background-color: rgba(255, 255, 255, 0.1); + padding: 8px; + border-radius: 4px; +} + +prompt { + padding: 8px; +} + +entry { + padding: 8px; +} + +listview { + lines: 0; +} + +/* Style for the message text specifically */ +textbox { + horizontal-align: 0.5; /* Center the text */ + font: "Sans Bold 24"; /* Match message font */ +} diff --git a/fastanime/assets/rofi_theme_input.rasi b/fastanime/assets/rofi_theme_input.rasi new file mode 100644 index 0000000..2c5425e --- /dev/null +++ b/fastanime/assets/rofi_theme_input.rasi @@ -0,0 +1,55 @@ +// https://github.com/Wraient/curd/blob/main/rofi/userinput.rasi +// Go give there project a star! +// Was too lazy to make my own preview, so I just used theirs + +configuration { + font: "Sans 12"; +} + +* { + background-color: rgba(0, 0, 0, 0.7); + text-color: #FFFFFF; +} + +window { + fullscreen: true; + transparency: "real"; + background-color: @background-color; +} + +mainbox { + children: [ message, listview, inputbar ]; + padding: 40% 30%; +} + +message { + border: 0; + padding: 10px; + margin: 0 0 20px 0; + font: "Sans Bold 24"; /* Increased font size and made it bold */ +} + +inputbar { + children: [ prompt, entry ]; + background-color: rgba(255, 255, 255, 0.1); + padding: 8px; + border-radius: 4px; +} + +prompt { + padding: 8px; +} + +entry { + padding: 8px; +} + +listview { + lines: 0; +} + +/* Style for the message text specifically */ +textbox { + horizontal-align: 0.5; /* Center the text */ + font: "Sans Bold 24"; /* Match message font */ +} diff --git a/fastanime/assets/rofi_theme_preview.rasi b/fastanime/assets/rofi_theme_preview.rasi new file mode 100644 index 0000000..d1ea8c8 --- /dev/null +++ b/fastanime/assets/rofi_theme_preview.rasi @@ -0,0 +1,122 @@ +// Based on https://github.com/Wraient/curd/blob/main/rofi/selectanimepreview.rasi +// Go give there project a star! +// Was too lazy to make my own preview, so I just used theirs + +// Colours +* { + background-color: transparent; + background: #1D2330; + background-transparent: #1D2330A0; + text-color: #BBBBBB; + text-color-selected: #FFFFFF; + primary: #BB77BB; + important: #BF616A; +} + +configuration { + font: "Roboto 17"; + show-icons: true; +} + +window { + fullscreen: true; + height: 100%; + width: 100%; + transparency: "real"; + background-color: @background-transparent; + border: 0px; + border-color: @primary; +} + +mainbox { + children: [prompt, inputbar-box, listview]; + padding: 0px; +} + +prompt { + width: 100%; + margin: 10px 0px 0px 30px; + text-color: @important; + font: "Roboto Bold 27"; +} + +listview { + layout: vertical; + padding: 60px; + dynamic: true; + columns: 7; + spacing: 20px; + horizontal-align: center; /* Center the list items */ +} + +inputbar-box { + children: [dummy, inputbar, dummy]; + orientation: horizontal; + expand: false; +} + +inputbar { + children: [textbox-prompt, entry]; + margin: 0px; + background-color: @primary; + border: 4px; + border-color: @primary; + border-radius: 8px; +} + +textbox-prompt { + text-color: @background; + horizontal-align: 0.5; + vertical-align: 0.5; + expand: false; +} + +entry { + expand: false; + padding: 8px; + margin: -6px; + horizontal-align: 0; + width: 300; + background-color: @background; + border: 6px; + border-color: @primary; + border-radius: 8px; + cursor: text; +} + +element { + children: [dummy, element-box, dummy]; + padding: 5px; + orientation: vertical; + border: 0px; + border-radius: 16px; + background-color: transparent; /* Default background */ +} + +element selected { + background-color: @primary; /* Solid color for selected item */ +} + +element-box { + children: [element-icon, element-text]; + orientation: vertical; + expand: false; + cursor: pointer; +} + +element-icon { + padding: 10px; + cursor: inherit; + size: 33%; + margin: 10px; +} + +element-text { + horizontal-align: 0.5; + cursor: inherit; + text-color: @text-color; +} + +element-text selected { + text-color: @text-color-selected; +} diff --git a/fastanime/cli/config.py b/fastanime/cli/config.py index 3e4bd8f..b0fa0bc 100644 --- a/fastanime/cli/config.py +++ b/fastanime/cli/config.py @@ -8,6 +8,7 @@ from ..constants import ( USER_CONFIG_PATH, USER_DATA_PATH, USER_VIDEOS_DIR, + ASSETS_DIR, USER_WATCH_HISTORY_PATH, S_PLATFORM, ) @@ -52,10 +53,10 @@ class Config(object): "provider": "allanime", "quality": "1080", "recent": "50", - "rofi_theme": "", - "rofi_theme_preview": "", - "rofi_theme_confirm": "", - "rofi_theme_input": "", + "rofi_theme": os.path.join(ASSETS_DIR, "rofi_theme.rasi"), + "rofi_theme_preview": os.path.join(ASSETS_DIR, "rofi_theme_preview.rasi"), + "rofi_theme_confirm": os.path.join(ASSETS_DIR, "rofi_theme_confirm.rasi"), + "rofi_theme_input": os.path.join(ASSETS_DIR, "rofi_theme_input.rasi"), "server": "top", "skip": "false", "sort_by": "search match", @@ -393,7 +394,7 @@ use_rofi = {self.use_rofi} # by the way i recommend getting the rofi themes from this project; rofi_theme = {self.rofi_theme} -rofi_theme = {self.rofi_theme_preview} +rofi_theme_preview = {self.rofi_theme_preview} rofi_theme_input = {self.rofi_theme_input}