From 54cad7d62be5706cdb7ee09b582c9501a3113ae0 Mon Sep 17 00:00:00 2001 From: ksyasuda Date: Sun, 9 Jan 2022 12:34:21 -0800 Subject: [PATCH] small fixes and update to nord theme --- ani-cli | 2 ++ setup.sh | 10 ++++---- sql/file_history.sql | 4 ++-- sql/search_history_tbl.sql | 4 ++-- themes/aniwrapper-nord.rasi | 47 +++++++++++++++++++++++++++++-------- 5 files changed, 47 insertions(+), 20 deletions(-) diff --git a/ani-cli b/ani-cli index e8632a3..875994a 100755 --- a/ani-cli +++ b/ani-cli @@ -246,6 +246,7 @@ insert_history() { res="$?" if [[ $res -gt 0 ]]; then logger "Match found... Updating row in history db..." + wait # in case there's another insert/update still running in background update_date "$@" res=$? else @@ -265,6 +266,7 @@ insert_history() { VALUES('$1', '$2', '$datetime');" fi logger "INSERT STATEMENT -> $stmt" + wait # in case there's another insert/update still running in background run_stmt "$stmt" res=$? fi diff --git a/setup.sh b/setup.sh index 59144a7..04327b4 100755 --- a/setup.sh +++ b/setup.sh @@ -51,12 +51,10 @@ run_setup() { log "FINISHED CREATING DB" fi - if [[ ! -d "$DIR/themes" ]]; then - log "themes directory does not exist in filesystem... Creating and moving themes" - mkdir -p "$DIR/themes" - cp themes/* "$DIR/themes/" - log "Theme files moved..." - fi + # log "themes directory does not exist in filesystem... Creating and moving themes" + mkdir -p "$DIR/themes" + cp themes/* "$DIR/themes/" + log "Theme files moved..." log "Creating mpv/scripts/ directory if it doesn't exist..." mkdir -p "$MPV_DIR/scripts/" diff --git a/sql/file_history.sql b/sql/file_history.sql index 9c71d56..fe2b53c 100644 --- a/sql/file_history.sql +++ b/sql/file_history.sql @@ -1,4 +1,4 @@ -CREATE TABLE file_history ( +CREATE TABLE IF NOT EXISTS file_history ( id integer PRIMARY KEY AUTOINCREMENT, directory varchar(200) NOT NULL, filename varchar(200) NOT NULL, @@ -8,5 +8,5 @@ CREATE TABLE file_history ( UNIQUE (directory, filename) ); -CREATE UNIQUE INDEX dir_filename_idx ON file_history (directory, filename); +CREATE UNIQUE INDEX IF NOT EXISTS dir_filename_idx ON file_history (directory, filename); diff --git a/sql/search_history_tbl.sql b/sql/search_history_tbl.sql index 7854369..41f5eb5 100644 --- a/sql/search_history_tbl.sql +++ b/sql/search_history_tbl.sql @@ -1,4 +1,4 @@ -CREATE TABLE search_history ( +CREATE TABLE IF NOT EXISTS search_history ( id integer PRIMARY KEY AUTOINCREMENT, anime_name varchar(200) NOT NULL, search_date DATETIME NOT NULL, @@ -6,5 +6,5 @@ CREATE TABLE search_history ( UNIQUE (anime_name, search_date) ); -CREATE UNIQUE INDEX anime_search_idx ON search_history (anime_name, search_date); +CREATE UNIQUE INDEX IF NOT EXISTS anime_search_idx ON search_history (anime_name, search_date); diff --git a/themes/aniwrapper-nord.rasi b/themes/aniwrapper-nord.rasi index 8a4a9e7..432f1ce 100644 --- a/themes/aniwrapper-nord.rasi +++ b/themes/aniwrapper-nord.rasi @@ -50,7 +50,7 @@ element { border: 0; cursor: pointer; margin: 1px 0px; - border-radius: 12px; + border-radius: 6px; } element normal.normal { background-color: var(normal-background); @@ -139,18 +139,45 @@ button selected { background-color: var(selected-normal-background); text-color: var(selected-normal-foreground); } -inputbar { - padding: 7px; - margin: 7px; - spacing: 0; - text-color: var(normal-foreground); - background-color: var(nord3); - children: [ entry ]; - border-radius: 12px; -} + entry { spacing: 0; cursor: text; text-color: var(normal-foreground); background-color: var(nord3); } + +inputbar { + padding: 7px; + margin: 7px; + spacing: 0; + text-color: var(normal-foreground); + children: [ prompt,textbox-prompt-colon,entry,case-indicator ]; +} + +case-indicator { + spacing: 0; + text-color: var(nord15); + margin: 0 0 0 0.5%; +} + +entry { + padding: 4px 8px; + spacing: 0; + text-color: var(nord8); + border-radius: 6px; +} + +prompt { + spacing: 0; + text-color: var(nord15); + padding: 4px 0px; +} + +textbox-prompt-colon { + expand: false; + str: ":"; + margin: 0px 0.3em 0em 0em ; + text-color: var(nord15); + padding: 4px 0px; +}