scheme: new way of tracking

centralise the colours so all of them are kept here
This commit is contained in:
2 * r + 2 * t
2025-02-19 17:26:31 +11:00
parent bd45501b31
commit 066b9256b2
17 changed files with 188 additions and 288 deletions
-97
View File
@@ -1,97 +0,0 @@
/**
* @name Midnight (Caelestia)
* @description A dark, rounded discord theme. Caelestia dynamic colours.
* @author refact0r, esme, anubis
* @version 1.6.2
* @invite nz87hXyvcy
* @website https://github.com/refact0r/midnight-discord
* @authorId 508863359777505290
* @authorLink https://www.refact0r.dev
*/
@use "sass:color";
@use "colours" as c;
/* IMPORTANT: make sure to enable dark mode in discord settings for the theme to apply properly!!! */
@import url("https://refact0r.github.io/midnight-discord/midnight.css");
/* customize things here */
:root {
/* font, change to 'gg sans' for default discord font*/
--font: "figtree";
/* top left corner text */
--corner-text: "Caelestia";
/* thickness of messages divider */
--divider-thickness: 3px;
/* color of status indicators and window controls */
--online-indicator: #a6da95; /* change to #23a55a for default green */
--dnd-indicator: #ed8796; /* change to #f23f43 for default red */
--idle-indicator: #eed49f; /* change to #f0b232 for default yellow */
--streaming-indicator: #c6a0f6; /* change to #593695 for default purple */
/* accent colors */
--accent-1: #{c.$lavender}; /* links */
--accent-2: #{c.$lavender}; /* general unread/mention elements */
--accent-3: #{c.$lavender}; /* accent buttons */
--accent-4: #{color.change(c.$lavender, $saturation: 68%, $lightness: 77%)}; /* accent buttons when hovered */
--accent-5: #{color.change(c.$lavender, $saturation: 52%, $lightness: 69%)}; /* accent buttons when clicked */
--mention: #{color.change(c.$lavender, $saturation: 67%, $lightness: 77%, $alpha: 0.1)}; /* mentions & mention messages */
--mention-hover: #{color.change(c.$lavender, $saturation: 67%, $lightness: 77%, $alpha: 0.05)}; /* mentions & mention messages when hovered */
/* text colors */
--text-0: #{c.$text}; /* text on colored elements */
--text-1: #{color.change(c.$text, $lightness: 95%)}; /* bright text on colored elements */
--text-2: #{color.change(c.$text, $lightness: 88%)}; /* headings and important text */
--text-3: #{color.change(c.$text, $lightness: 80%)}; /* normal text */
--text-4: #{c.$overlay1}; /* icon buttons and channels */
--text-5: #{c.$subtext0}; /* muted channels/chats and timestamps */
/* background and dark colors */
--bg-1: #{c.$surface1}; /* dark buttons when clicked */
--bg-2: #{c.$surface0}; /* dark buttons */
--bg-3: #{c.$mantle}; /* spacing, secondary elements */
--bg-4: #{c.$base}; /* main background color */
--hover: #{color.change(c.$overlay1, $alpha: 0.1)}; /* channels and buttons when hovered */
--active: #{color.change(c.$overlay1, $alpha: 0.2)}; /* channels and buttons when clicked or selected */
--message-hover: rgba(0, 0, 0, 0.1); /* messages when hovered */
/* amount of spacing and padding */
--spacing: 12px;
/* animations */
/* ALL ANIMATIONS CAN BE DISABLED WITH REDUCED MOTION IN DISCORD SETTINGS */
--list-item-transition: 0.2s ease; /* channels/members/settings hover transition */
--unread-bar-transition: 0.2s ease; /* unread bar moving into view transition */
--moon-spin-transition: 0.4s ease; /* moon icon spin */
--icon-spin-transition: 1s ease; /* round icon button spin (settings, emoji, etc.) */
/* corner roundness (border-radius) */
--roundness-xl: 22px; /* roundness of big panel outer corners */
--roundness-l: 20px; /* popout panels */
--roundness-m: 16px; /* smaller panels, images, embeds */
--roundness-s: 12px; /* members, settings inputs */
--roundness-xs: 10px; /* channels, buttons */
--roundness-xxs: 8px; /* searchbar, small elements */
/* direct messages moon icon */
/* change to block to show, none to hide */
--discord-icon: none; /* discord icon */
--moon-icon: block; /* moon icon */
--moon-icon-url: url("https://upload.wikimedia.org/wikipedia/commons/c/c4/Font_Awesome_5_solid_moon.svg"); /* custom icon url */
--moon-icon-size: auto;
/* filter uncolorable elements to fit theme */
/* (just set to none, they're too much work to configure) */
--login-bg-filter: none; /* login background artwork */
--green-to-accent-3-filter: none; /* add friend page explore icon */
--blurple-to-accent-3-filter: none; /* add friend page school icon */
/* choose style for window control buttons (minimize-maximize-close) */
/* block to show, none to hide; choose only one to show!*/
--windows-nav: none; /* default windows-style buttons */
--custom-nav: none; /* custom mac-style buttons */
}
-36
View File
@@ -1,36 +0,0 @@
[cursor]
color=$crust $rosewater
[colors]
foreground=$text
background=$base
regular0=$surface1
regular1=$red
regular2=$green
regular3=$yellow
regular4=$blue
regular5=$pink
regular6=$teal
regular7=$subtext1
bright0=$surface2
bright1=$red
bright2=$green
bright3=$yellow
bright4=$blue
bright5=$pink
bright6=$teal
bright7=$subtext0
16=$peach
17=$rosewater
selection-foreground=$text
selection-background=$surface1
search-box-no-match=$crust $red
search-box-match=$text $surface0
jump-labels=$crust $peach
urls=$blue
-12
View File
@@ -1,12 +0,0 @@
[colors]
background=$baseff
text=$textff
prompt=$subtext1ff
placeholder=$overlay1ff
input=$textff
match=$lavenderff
selection=$surface2ff
selection-text=$textff
selection-match=$lavenderff
counter=$overlay1ff
border=$lavenderff
-40
View File
@@ -1,40 +0,0 @@
@define-color window_bg_color $base; /* The main background color used on GtkWindow */
@define-color window_fg_color $text; /* The main foreground text color */
@define-color view_bg_color $surface0; /* A secondary background color used in icon views, text fields, etc */
@define-color view_fg_color $text; /* Secondary foreground text color */
@define-color accent_bg_color $overlay1; /* Color to indicate that a widget is important, interactive, or currently active */
@define-color accent_fg_color $text; /* Color for text over widgets using accent_bg_color */
@define-color accent_color $overlay1; /* Mostly used for text labels. Can be the same as accent_bg_color */
@define-color headerbar_bg_color $base; /* The headerbar background */
@define-color headerbar_fg_color $text; /* The headerbar foreground text color */
@define-color headerbar_backdrop_color $base; /* The headerbar backdrop state background */
@define-color headerbar_border_color $surface1; /* Currently not used in adw-gtk3 */
@define-color headerbar_shade_color $surface1; /* The bottom border of the headerbar */
@define-color card_bg_color $base; /* The background color of lists */
@define-color card_fg_color $text; /* The text color on libhandy lists */
@define-color card_shade_color $surface1; /* List borders */
@define-color popover_bg_color $surface0; /* The background color of popovers and menus */
@define-color popover_fg_color $text; /* The text color on popovers */
@define-color dialog_bg_color $base; /* The background color of message dialogs */
@define-color dialog_fg_color $text; /* The foreground color of message dialogs */
@define-color sidebar_bg_color $base; /* Sidebar background color */
@define-color sidebar_fg_color $text; /* Sidebar foreground color */
@define-color sidebar_backdrop_color $base; /* Sidebar backdrop background color */
@define-color sidebar_shade_color $surface1; /* Sidebar shade color */
@define-color warning_bg_color $surface1; /* Background for widgets and elements that show a warning */
@define-color warning_fg_color $yellow; /* Foreground for widgets and elements that show a warning */
@define-color warning_color $surface1; /* Warning text label */
@define-color error_bg_color $surface1; /* Background for widgets and elements that show an error */
@define-color error_fg_color $red; /* Foreground for widgets and elements that show an error */
@define-color error_color $surface1; /* Error text label */
@define-color success_bg_color $surface1; /* Background for widgets and elements that show a successful action */
@define-color success_fg_color $green; /* Foreground for widgets and elements that show a successful action */
@define-color success_color $surface1; /* Success text label */
@define-color destructive_bg_color $surface1; /* The destructive color indicates a dangerous action, such as deleting a file */
@define-color destructive_fg_color $red; /* Destructive foreground color */
@define-color destructive_color $surface1; /* Destructive text label */
/* Custom colors (GTK3 only) */
@define-color panel_bg_color $base; /* Background for XFCE4 panel */
@define-color panel_fg_color $text; /* Foreground for XFCE4 panel */
+26
View File
@@ -0,0 +1,26 @@
rosewater CACEB2
flamingo C6C4AE
pink CAC0B0
mauve B0B0C8
red D599A3
maroon D5A0A5
peach DBB480
yellow D0CDA2
green A6CD9E
teal 94CBC9
sky 94C9D0
sapphire 84C0D0
blue 8EB7D2
lavender A9BBD2
text DCE5E6
subtext1 AABDC0
subtext0 889DA0
overlay2 6C8083
overlay1 556769
overlay0 3F4E50
surface2 333F40
surface1 263032
surface0 1E2728
base 161D1E
mantle 0F1516
crust 080C0D
+26
View File
@@ -0,0 +1,26 @@
rosewater f2d5cf
flamingo eebebe
pink f4b8e4
mauve ca9ee6
red e78284
maroon ea999c
peach ef9f76
yellow e5c890
green a6d189
teal 81c8be
sky 99d1db
sapphire 85c1dc
blue 8caaee
lavender babbf1
text c6d0f5
subtext1 b5bfe2
subtext0 a5adce
overlay2 949cbb
overlay1 838ba7
overlay0 737994
surface2 626880
surface1 51576d
surface0 414559
base 303446
mantle 292c3c
crust 232634
+26
View File
@@ -0,0 +1,26 @@
rosewater dc8a78
flamingo dd7878
pink ea76cb
mauve 8839ef
red d20f39
maroon e64553
peach fe640b
yellow df8e1d
green 40a02b
teal 179299
sky 04a5e5
sapphire 209fb5
blue 1e66f5
lavender 7287fd
text 4c4f69
subtext1 5c5f77
subtext0 6c6f85
overlay2 7c7f93
overlay1 8c8fa1
overlay0 9ca0b0
surface2 acb0be
surface1 bcc0cc
surface0 ccd0da
base eff1f5
mantle e6e9ef
crust dce0e8
+26
View File
@@ -0,0 +1,26 @@
rosewater f4dbd6
flamingo f0c6c6
pink f5bde6
mauve c6a0f6
red ed8796
maroon ee99a0
peach f5a97f
yellow eed49f
green a6da95
teal 8bd5ca
sky 91d7e3
sapphire 7dc4e4
blue 8aadf4
lavender b7bdf8
text cad3f5
subtext1 b8c0e0
subtext0 a5adcb
overlay2 939ab7
overlay1 8087a2
overlay0 6e738d
surface2 5b6078
surface1 494d64
surface0 363a4f
base 24273a
mantle 1e2030
crust 181926
+26
View File
@@ -0,0 +1,26 @@
rosewater f5e0dc
flamingo f2cdcd
pink f5c2e7
mauve cba6f7
red f38ba8
maroon eba0ac
peach fab387
yellow f9e2af
green a6e3a1
teal 94e2d5
sky 89dceb
sapphire 74c7ec
blue 89b4fa
lavender b4befe
text cdd6f4
subtext1 bac2de
subtext0 a6adc8
overlay2 9399b2
overlay1 7f849c
overlay0 6c7086
surface2 585b70
surface1 45475a
surface0 313244
base 1e1e2e
mantle 181825
crust 11111b
+26
View File
@@ -0,0 +1,26 @@
rosewater edcbc5
flamingo d3a4a4
pink d792c6
mauve c678dd
red be5046
maroon e06c75
peach d19a66
yellow e5c07b
green 98c379
teal 56b6c2
sky 90ccd7
sapphire 389dcc
blue 61afef
lavender 8e98d9
text abb2bf
subtext1 95a0b5
subtext0 838b9c
overlay2 767f8f
overlay1 666e7c
overlay0 5c6370
surface2 4b5263
surface1 3c414f
surface0 30343e
base 282c34
mantle 21242b
crust 1e2126
+15
View File
@@ -5,8 +5,23 @@
install-deps git adw-gtk-theme
set -l gtk $CONFIG/gtk
set -l systemd $CONFIG/../systemd/user
confirm-overwrite $gtk
git clone 'https://github.com/caelestia-dots/gtk.git' $gtk
# Install systemd service
if test -d $systemd
log 'Installing systemd service...'
echo "[Service]
Type=oneshot
ExecStart=$gtk/monitor/update.fish" > $systemd/gtk-monitor-scheme.service
cp $gtk/monitor/gtk-monitor-scheme.path $systemd/gtk-monitor-scheme.path
systemctl --user daemon-reload
systemctl --user enable --now gtk-monitor-scheme.path
systemctl --user start gtk-monitor-scheme.service
end
log 'Done.'
+1 -1
View File
@@ -32,7 +32,7 @@ for prog in code code-insiders codium
if which $prog &> /dev/null
log "Installing extensions for '$prog'"
$prog --install-extension catppuccin.catppuccin-vsc
$prog --install-extension $dist/caelestia-vscode-integration/caelestia-vscode-integration-0.0.1.vsix
$prog --install-extension $dist/caelestia-vscode-integration/caelestia-vscode-integration-*.vsix
end
end
+3 -3
View File
@@ -32,11 +32,11 @@ if test "$argv[1]" = workspace-action
end
if test "$argv[1]" = scheme
set -l valid_schemes dynamic mocha macchiato frappe latte
set -l valid_schemes (path change-extension '' $src/data/schemes/* | sed 's!.*/!!')
if contains -- "$argv[2]" $valid_schemes
mkdir -p $CACHE/scheme
echo -n $argv[2] > $CACHE/scheme/current.txt
test -f $CONFIG/gtk/update-scheme.fish && $CONFIG/gtk/update-scheme.fish
cp $src/data/schemes/$argv[2].txt $CACHE/scheme/current.txt
echo -n $argv[2] > $CACHE/scheme/current-name.txt
else
error "Invalid scheme: $argv[2]"
end
-91
View File
@@ -1,91 +0,0 @@
#!/bin/fish
function gen-hypr
for colour in $argv
set -l split (string split ' ' $colour)
echo "\$$split[1] = $split[2]"
end
end
function gen-scss
for colour in $argv
set -l split (string split ' ' $colour)
echo "\$$split[1]: #$split[2];"
end
end
function gen-ini -a program
cp (dirname (status filename))/../data/$program.template $CONFIG/../$program/schemes/dynamic.ini
for colour in $argv[2..]
set -l split (string split ' ' $colour)
sed -i "s/\$$split[1]/$split[2]/g" $CONFIG/../$program/schemes/dynamic.ini
end
end
function gen-json
set -e jq_args
for colour in $argv
set -l split (string split ' ' $colour)
set -a jq_args --arg $split[1] "#$split[2]"
end
jq -n $jq_args '$ARGS.named'
end
function gen-gtk
cp (dirname (status filename))/../data/gtk.template $CONFIG/gtk/schemes/dynamic.css
for colour in $argv
set -l split (string split ' ' $colour)
sed -i "s/\$$split[1]/#$split[2]/g" $CONFIG/gtk/schemes/dynamic.css
end
end
. (dirname (status filename))/../util.fish
set -l src (dirname (status filename))
set -l colours ($src/gen-scheme.fish $argv[1])
if test -d $CONFIG/../hypr/scheme
log 'Generating hypr scheme'
gen-hypr $colours > $CONFIG/../hypr/scheme/dynamic.conf
end
if test -d $CONFIG/shell
log 'Generating shell scheme'
gen-scss $colours > $CONFIG/shell/scss/scheme/_dynamic.scss
end
if test -d $CONFIG/safeeyes
log 'Generating SafeEyes scheme'
gen-scss $colours > $CONFIG/safeeyes/scheme/_dynamic.scss
end
if test -d $CONFIG/discord
log 'Generating discord scheme'
gen-scss $colours > /tmp/_colours.scss
sass --no-charset --no-source-map -I /tmp $src/../data/discord.template $CONFIG/discord/themes/dynamic.theme.css
end
if test -d $CONFIG/../foot/schemes
log 'Generating foot scheme'
gen-ini foot $colours
end
if test -d $CONFIG/../fuzzel/schemes
log 'Generating fuzzel scheme'
gen-ini fuzzel $colours
end
if test -d $CONFIG/vscode
log 'Generating VSCode scheme'
gen-json $colours > $CONFIG/vscode/schemes/dynamic.json
end
if test -d $CONFIG/gtk
log 'Generating GTK+ schemes'
gen-gtk $colours
end
# Reload programs if dynamic scheme
if test -f $CACHE/scheme/current.txt -a "$(cat $CACHE/scheme/current.txt)" = 'dynamic'
caelestia scheme dynamic
end
+3 -1
View File
@@ -31,6 +31,8 @@ test "$(cat $CACHE/scheme/current.txt)" = dynamic && gsettings set org.gnome.des
set -l names rosewater flamingo pink mauve red maroon peach yellow green teal sky sapphire blue lavender text subtext1 subtext0 overlay2 overlay1 overlay0 surface2 surface1 surface0 base mantle crust
set -l colours ($src/autoadjust.py $colour_scheme (okolors $img -k 15 -w 0 -l $light_vals))
for i in (seq 1 (count $colours))
set -l last (count $colours)
for i in (seq 1 (math $last - 1))
echo "$names[$i] $colours[$i]"
end
echo -n "$names[$last] $colours[$last]"
+6 -6
View File
@@ -3,21 +3,21 @@
. (dirname (status filename))/util.fish
mkdir -p "$CACHE/screenshots"
set tmp_file "$CACHE/screenshots/$(date +'%Y%m%d%H%M%S')"
set -l tmp_file "$CACHE/screenshots/$(date +'%Y%m%d%H%M%S')"
grim $argv $tmp_file; and wl-copy < $tmp_file; or exit 1
set action (notify-send -i 'image-x-generic-symbolic' -h "STRING:image-path:$tmp_file" \
set -l action (notify-send -i 'image-x-generic-symbolic' -h "STRING:image-path:$tmp_file" \
-a 'caelestia-screenshot' --action='open=Open' --action='save=Save' \
'Screenshot taken' "Screenshot stored in $tmp_file and copied to clipboard")
switch $action
case 'open'
uwsm app -- swappy -f $tmp_file & disown
case 'save'
set save_file (uwsm app -- zenity --file-selection --save --title='Save As')
[ -z $save_file ] && exit 0
if [ -f $save_file ]
set -l save_file (uwsm app -- zenity --file-selection --save --title='Save As')
test -z $save_file && exit 0
if test -f $save_file
uwsm app -- yad --image='abrt' --title='Warning!' --text-align='center' --buttons-layout='center' --borders=20 \
--text='<span size="x-large">Are you sure you want to overwrite this file?</span>' || exit 0
end
cp -f $tmp_file $save_file
cp $tmp_file $save_file
end
+4 -1
View File
@@ -112,7 +112,10 @@ else
# Generate colour scheme for wallpaper
set -l src (dirname (status filename))
$src/scheme/apply-scheme.fish $chosen_wallpaper
$src/scheme/gen-scheme.fish $chosen_wallpaper > $src/data/schemes/dynamic.txt
if test -f $CACHE/scheme/current.txt -a "$(cat $CACHE/scheme/current-name.txt)" = 'dynamic'
cp $src/data/schemes/dynamic.txt $CACHE/scheme/current.txt
end
# Store the wallpaper chosen
mkdir -p $cache_dir