From ecabff30f51b19f31fd71920290265d1752cfb4e Mon Sep 17 00:00:00 2001 From: Nulo Date: Sun, 10 Apr 2022 16:45:51 -0300 Subject: [PATCH] themer.lua --- .config/fnott/fnott.ini | 1 + .config/foot/foot.ini | 16 ++++ .config/sway/config | 18 ++-- .config/themer.lua | 1 + .config/themer/fnott.ini.sh | 62 ------------- .config/themer/foot.ini.sh | 113 ------------------------ .config/themer/fuzzel.sh | 64 -------------- .config/themer/gtk.sh | 44 --------- .config/themer/lock.sh | 42 --------- .config/themer/themes/mono-light.sh | 7 -- .config/themer/themes/mono.sh | 7 -- .config/themer/themes/rose-pine-dawn.sh | 17 ---- .config/themer/themes/rose-pine-moon.sh | 17 ---- .config/themer/themes/rose-pine.sh | 17 ---- .gitmodules | 3 + .local/bin/fuzzel-run | 18 ++++ .local/bin/themer | 11 ++- 17 files changed, 54 insertions(+), 404 deletions(-) create mode 120000 .config/fnott/fnott.ini create mode 100644 .config/foot/foot.ini create mode 160000 .config/themer.lua delete mode 100755 .config/themer/fnott.ini.sh delete mode 100755 .config/themer/foot.ini.sh delete mode 100755 .config/themer/fuzzel.sh delete mode 100755 .config/themer/gtk.sh delete mode 100755 .config/themer/lock.sh delete mode 100644 .config/themer/themes/mono-light.sh delete mode 100644 .config/themer/themes/mono.sh delete mode 100644 .config/themer/themes/rose-pine-dawn.sh delete mode 100644 .config/themer/themes/rose-pine-moon.sh delete mode 100644 .config/themer/themes/rose-pine.sh create mode 100755 .local/bin/fuzzel-run diff --git a/.config/fnott/fnott.ini b/.config/fnott/fnott.ini new file mode 120000 index 0000000..a6b50c7 --- /dev/null +++ b/.config/fnott/fnott.ini @@ -0,0 +1 @@ +/home/diablo/.cache/themer.lua/fnott \ No newline at end of file diff --git a/.config/foot/foot.ini b/.config/foot/foot.ini new file mode 100644 index 0000000..1e03340 --- /dev/null +++ b/.config/foot/foot.ini @@ -0,0 +1,16 @@ +[scrollback] +lines = 10000 + +[mouse] +hide-when-typing=yes + +[main] +font=monospace:pixelsize=22 +line-height=33px +vertical-letter-offset=3px + +pad=4x4 + +initial-window-size-chars=120x24 + +include = ~/.cache/themer.lua/foot diff --git a/.config/sway/config b/.config/sway/config index 0e5ea12..b8b1ead 100644 --- a/.config/sway/config +++ b/.config/sway/config @@ -1,3 +1,5 @@ +include ~/.cache/themer.lua/sway-colors + ### Variables # set $mod Mod4 @@ -197,17 +199,17 @@ bar { strip_workspace_numbers yes colors { - statusline #000000 - background #ffffff - focused_workspace #cf1bff #cf1bff #ffffff - active_workspace #eca6ff #eca6ff #ffffff - inactive_workspace #dfdfdf #dfdfdf #000000 + statusline $foreground + background $background + focused_workspace $accent $accent $background + active_workspace $accentish $accentish $background + inactive_workspace $background $background $foreground } } -client.focused #cf1bff #cf1bff #ffffff -client.focused_inactive #eca6ff #eca6ff #000000 -client.unfocused #cccccc #ffffff #000000 +client.focused $accent $accent $background +client.focused_inactive $accentish $accentish $foreground +client.unfocused $backgroundish $background $foreground titlebar_border_thickness 1 bindsym $mod+z exec fnottctl dismiss diff --git a/.config/themer.lua b/.config/themer.lua new file mode 160000 index 0000000..53b2f5c --- /dev/null +++ b/.config/themer.lua @@ -0,0 +1 @@ +Subproject commit 53b2f5caad07178e75a85464f4e6e059685bced7 diff --git a/.config/themer/fnott.ini.sh b/.config/themer/fnott.ini.sh deleted file mode 100755 index 7bce1f6..0000000 --- a/.config/themer/fnott.ini.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/bin/sh -set -e - -# https://github.com/jan-warchol/selenized/blob/e93e0d9fb47c7485f18fa16f9bdb70c2ee7fb5db/the-values.md - -echo "# Autogenerated by ~/.config/themer/fnott.ini.sh - -edge-margin-vertical=5 -edge-margin-horizontal=5 -padding-vertical=10 -padding-horizontal=10 -notification-margin=5 -selection-helper=fuzzel-run -d -play-sound=mpv \${filename} - -border-color=909090 -border-size=0 -title-font=sans serif:style=Italic:size=8 -summary-font=sans serif:style=Bold:size=16 -body-font=sans serif:size=12 -" > ~/.config/fnott/fnott.ini - -rose_pine () { - echo " - background=$base - title-color=$text - summary-color=$text - body-color=$text - " >> ~/.config/fnott/fnott.ini -} -mono () { - echo " - background=$backgroundish - title-color=$foreground - summary-color=$foreground - body-color=$foreground - " >> ~/.config/fnott/fnott.ini -} - -if test "$1" = rose-pine; then - . ~/.config/themer/themes/rose-pine.sh - rose_pine -elif test "$1" = rose-pine-dawn; then - . ~/.config/themer/themes/rose-pine-dawn.sh - rose_pine -elif test "$1" = rose-pine-moon; then - . ~/.config/themer/themes/rose-pine-moon.sh - rose_pine -elif test "$1" = mono; then - . ~/.config/themer/themes/mono.sh - mono -elif test "$1" = mono-light; then - . ~/.config/themer/themes/mono-light.sh - mono -else - if test -n "$1"; then - echo "I don't know that theme" - else - echo "No theme specified" - fi - exit 1 -fi diff --git a/.config/themer/foot.ini.sh b/.config/themer/foot.ini.sh deleted file mode 100755 index 3b5a8e3..0000000 --- a/.config/themer/foot.ini.sh +++ /dev/null @@ -1,113 +0,0 @@ -#!/bin/sh -set -e - -# https://github.com/jan-warchol/selenized/blob/e93e0d9fb47c7485f18fa16f9bdb70c2ee7fb5db/the-values.md - -echo "# Autogenerated by ~/.config/themer/foot.ini.sh -[scrollback] -lines = 10000 - -[mouse] -hide-when-typing=yes - -[main] -font=monospace:pixelsize=22 -line-height=33px -vertical-letter-offset=3px - -pad=4x4 - -initial-window-size-chars=120x24 -" > ~/.config/foot/foot.ini - -rose_pine () { - if $dark; then - alpha=1 - else - alpha=1 - fi - echo " - [cursor] - color = $inactive $text - - [colors] - background = $base - foreground = $text - alpha = $alpha - - selection-foreground = $text - selection-background = $highlight - - urls = $iris - - regular0 = $overlay - regular1 = $love - regular2 = $pine - regular3 = $gold - regular4 = $foam - regular5 = $iris - regular6 = $rose - regular7 = $text - - bright0 = $subtle - bright1 = $love - bright2 = $pine - bright3 = $gold - bright4 = $foam - bright5 = $iris - bright6 = $rose - bright7 = $text - " >> ~/.config/foot/foot.ini -} -mono () { - if $dark; then - echo "include = /usr/share/foot/themes/selenized-black" >> ~/.config/foot/foot.ini - else - echo " -[colors] -foreground=000000 -background=ffffff - -regular0=ffffff # black (or white in a bright theme) -regular1=7f1010 # red -regular2=009A57 # green -regular3=813e00 # yellow -regular4=0186C7 # blue -regular5=721045 # magenta -regular6=00538b # cyan -regular7=000000 # white (or black in a bright theme) - -bright0=e4e4e4 -bright1=ff8686 -bright2=bcd2aa -bright3=989838 -bright4=00AEFF -bright5=8888CC -bright6=4FA8A8 -bright7=000000" >> ~/.config/foot/foot.ini - fi -} - -if test "$1" = rose-pine; then - . ~/.config/themer/themes/rose-pine.sh - rose_pine -elif test "$1" = rose-pine-dawn; then - . ~/.config/themer/themes/rose-pine-dawn.sh - rose_pine -elif test "$1" = rose-pine-moon; then - . ~/.config/themer/themes/rose-pine-moon.sh - rose_pine -elif test "$1" = mono; then - . ~/.config/themer/themes/mono.sh - mono -elif test "$1" = mono-light; then - . ~/.config/themer/themes/mono-light.sh - mono -else - if test -n "$1"; then - echo "I don't know that theme" - else - echo "No theme specified" - fi - exit 1 -fi diff --git a/.config/themer/fuzzel.sh b/.config/themer/fuzzel.sh deleted file mode 100755 index 3631f2b..0000000 --- a/.config/themer/fuzzel.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/sh -set -e - -echo "#!/bin/sh -# Autogenerated by ~/.config/themer/fuzzel.sh -" > ~/.local/bin/fuzzel-run - -rose_pine () { - echo " -export background=$base -export foreground=$text -export selection_background=$highlight -export selection_foreground=$text -export border=$text -export accent=$iris -" >> ~/.local/bin/fuzzel-run -} -mono () { - echo " -export background=$background -export foreground=$foreground -export selection_background=$backgroundish -export selection_foreground=$foreground -export border=$foreground -export accent=$foreground -" >> ~/.local/bin/fuzzel-run -} - -if test "$1" = rose-pine; then - . ~/.config/themer/themes/rose-pine.sh - rose_pine -elif test "$1" = rose-pine-dawn; then - . ~/.config/themer/themes/rose-pine-dawn.sh - rose_pine -elif test "$1" = rose-pine-moon; then - . ~/.config/themer/themes/rose-pine-moon.sh - rose_pine -elif test "$1" = mono; then - . ~/.config/themer/themes/mono.sh - mono -elif test "$1" = mono-light; then - . ~/.config/themer/themes/mono-light.sh - mono -else - if test -n "$1"; then - echo "I don't know that theme" - else - echo "No theme specified" - fi - exit 1 -fi - -echo " -exec fuzzel --terminal=footclient --font='monospace:pixelsize=22' \ ---prompt='➦ ' \ ---no-icons \ ---width=40 \ ---background=\${background}ff --text-color=\${foreground}ff \ ---match-color=\${accent}ff \ ---selection-color=\${selection_background}ff --selection-text-color=\${selection_foreground}ff \ ---horizontal-pad=12 \ ---border-width=1 --border-color=\${border}ff --border-radius=2 \"\$@\" -" >> ~/.local/bin/fuzzel-run -chmod +x ~/.local/bin/fuzzel-run diff --git a/.config/themer/gtk.sh b/.config/themer/gtk.sh deleted file mode 100755 index aa996c3..0000000 --- a/.config/themer/gtk.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/sh -set -e - -dark_light () { - if "$dark"; then - gsettings set org.gnome.desktop.interface gtk-theme Adwaita - # gsettings set org.freedesktop.appearance color-scheme 1 - echo '# Autogenerated by ~/.config/themer/gtk.sh -gtk-theme-name="Adwaita-dark"' > ~/.gtkrc-2.0 - else - gsettings set org.gnome.desktop.interface gtk-theme Adwaita-light - # gsettings set org.freedesktop.appearance color-scheme 2 - echo '# Autogenerated by ~/.config/themer/gtk.sh -gtk-theme-name="Adwaita"' > ~/.gtkrc-2.0 - fi - echo "# Autogenerated by ~/.config/themer/gtk.sh -[Settings] -gtk-application-prefer-dark-theme = $dark -gtk-decoration-layout=menu:" > ~/.config/gtk-3.0/settings.ini -} - -if test "$1" = rose-pine; then - . ~/.config/themer/themes/rose-pine.sh - dark_light -elif test "$1" = rose-pine-dawn; then - . ~/.config/themer/themes/rose-pine-dawn.sh - dark_light -elif test "$1" = rose-pine-moon; then - . ~/.config/themer/themes/rose-pine-moon.sh - dark_light -elif test "$1" = mono; then - . ~/.config/themer/themes/mono.sh - dark_light -elif test "$1" = mono-light; then - . ~/.config/themer/themes/mono-light.sh - dark_light -else - if test -n "$1"; then - echo "I don't know that theme" - else - echo "No theme specified" - fi - exit 1 -fi diff --git a/.config/themer/lock.sh b/.config/themer/lock.sh deleted file mode 100755 index 88be741..0000000 --- a/.config/themer/lock.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh -set -e - -generate () { - echo "#!/bin/sh -# Autogenerated by ~/.config/themer/lock.sh -setsid -f swaylockd --color $background \ - --show-failed-attempts -sleep 1 -" > ~/.local/bin/lock -} - -rose_pine () { - background=$base generate -} -mono () { - generate -} - -if test "$1" = rose-pine; then - . ~/.config/themer/themes/rose-pine.sh - rose_pine -elif test "$1" = rose-pine-dawn; then - . ~/.config/themer/themes/rose-pine-dawn.sh - rose_pine -elif test "$1" = rose-pine-moon; then - . ~/.config/themer/themes/rose-pine-moon.sh - rose_pine -elif test "$1" = mono; then - . ~/.config/themer/themes/mono.sh - mono -elif test "$1" = mono-light; then - . ~/.config/themer/themes/mono-light.sh - mono -else - if test -n "$1"; then - echo "I don't know that theme" - else - echo "No theme specified" - fi - exit 1 -fi diff --git a/.config/themer/themes/mono-light.sh b/.config/themer/themes/mono-light.sh deleted file mode 100644 index 6e78782..0000000 --- a/.config/themer/themes/mono-light.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh -export background=ffffff -export backgroundish=dfdfdf -export foreground=000000 -export foregroundish=333333 -export accent=cf1bff -export dark=false diff --git a/.config/themer/themes/mono.sh b/.config/themer/themes/mono.sh deleted file mode 100644 index 77e44fd..0000000 --- a/.config/themer/themes/mono.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh -export background=000000 -export backgroundish=333333 -export foreground=bbbbbb -export foregroundish=777777 -export accent=907aa9 -export dark=true diff --git a/.config/themer/themes/rose-pine-dawn.sh b/.config/themer/themes/rose-pine-dawn.sh deleted file mode 100644 index 9f7ceec..0000000 --- a/.config/themer/themes/rose-pine-dawn.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh -export base=faf4ed -export surface=fffaf3 -export overlay=f2e9de -export inactive=9893a5 -export subtle=6e6a86 -export text=575279 -export love=b4637a -export gold=ea9d34 -export rose=d7827e -export pine=286983 -export foam=56949f -export iris=907aa9 -export highlight=eee9e6 -export highlightInactive=f2ede9 -export highlightOverlay=e4dfde -export dark=false diff --git a/.config/themer/themes/rose-pine-moon.sh b/.config/themer/themes/rose-pine-moon.sh deleted file mode 100644 index 2e26dae..0000000 --- a/.config/themer/themes/rose-pine-moon.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh -export base=232136 -export surface=2a273f -export overlay=393552 -export inactive=59546d -export subtle=817c9c -export text=e0def4 -export love=eb6f92 -export gold=f6c177 -export rose=ea9a97 -export pine=3e8fb0 -export foam=9ccfd8 -export iris=c4a7e7 -export highlight=312f44 -export highlightInactive=2a283d -export highlightOverlay=3f3c53 -export dark=true diff --git a/.config/themer/themes/rose-pine.sh b/.config/themer/themes/rose-pine.sh deleted file mode 100644 index af5334e..0000000 --- a/.config/themer/themes/rose-pine.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh -export base=191724 -export surface=1f1d2e -export overlay=26233a -export inactive=555169 -export subtle=6e6a86 -export text=e0def4 -export love=eb6f92 -export gold=f6c177 -export rose=ebbcba -export pine=31748f -export foam=9ccfd8 -export iris=c4a7e7 -export highlight=2a2837 -export highlightInactive=211f2d -export highlightOverlay=3a384a -export dark=true diff --git a/.gitmodules b/.gitmodules index 1d565b0..7374d1e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -10,3 +10,6 @@ [submodule ".config/vis/plugins/fzf-mru"] path = .config/vis/plugins/fzf-mru url = https://github.com/peaceant/vis-fzf-mru +[submodule "/home/diablo/.config/themer.lua"] + path = /home/diablo/.config/themer.lua + url = https://gitea.nulo.in/Nulo/themer.lua diff --git a/.local/bin/fuzzel-run b/.local/bin/fuzzel-run new file mode 100755 index 0000000..55b239d --- /dev/null +++ b/.local/bin/fuzzel-run @@ -0,0 +1,18 @@ +#!/bin/sh +. ~/.cache/themer.lua/fuzzel + +exec fuzzel \ +--terminal=footclient \ +--font='monospace:pixelsize=22' \ +--prompt='➦ ' \ +--no-icons \ +--width=40 \ +--background=${background}ff \ +--text-color=${foreground}ff \ +--match-color=${accent}ff \ +--selection-color=${selection_background}ff \ +--selection-text-color=${selection_foreground}ff \ +--horizontal-pad=12 \ +--border-width=1 \ +--border-color=${border}ff \ +--border-radius=2 "$@" diff --git a/.local/bin/themer b/.local/bin/themer index dbf8942..a7d4fe8 100755 --- a/.local/bin/themer +++ b/.local/bin/themer @@ -1,12 +1,11 @@ #!/bin/sh -set -e +set -ex if test -n "$1"; then - ~/.config/themer/foot.ini.sh "$1" - ~/.config/themer/fnott.ini.sh "$1" - ~/.config/themer/fuzzel.sh "$1" - ~/.config/themer/lock.sh "$1" - ~/.config/themer/gtk.sh "$1" + . ~/.config/themer/themes/"$1".sh + ~/.config/themer/fuzzel.sh + ~/.config/themer/lock.sh + ~/.config/themer/gtk.sh else echo "No theme specified" exit 1