aboutsummaryrefslogtreecommitdiff
path: root/.local/share/mode/switch.d
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2025-01-23 12:28:38 +0100
committerLoek Le Blansch <loek@pipeframe.xyz>2025-01-23 12:30:14 +0100
commitc7faac3480d2c52db7e952f638f7f162fb98eeec (patch)
tree32d112a9532bcf8391a47384b91f6ef4c729e88a /.local/share/mode/switch.d
parent95db61081c2555c069c3287fd30d9c8a1757acb1 (diff)
`mode` update
Diffstat (limited to '.local/share/mode/switch.d')
-rwxr-xr-x.local/share/mode/switch.d/chromium9
-rwxr-xr-x.local/share/mode/switch.d/discord3
-rwxr-xr-x.local/share/mode/switch.d/dunst3
-rwxr-xr-x.local/share/mode/switch.d/fcitx52
-rwxr-xr-x.local/share/mode/switch.d/mode10
-rwxr-xr-x.local/share/mode/switch.d/polybar3
-rwxr-xr-x.local/share/mode/switch.d/rofi8
-rwxr-xr-x.local/share/mode/switch.d/vim9
-rwxr-xr-x.local/share/mode/switch.d/zathura3
9 files changed, 22 insertions, 28 deletions
diff --git a/.local/share/mode/switch.d/chromium b/.local/share/mode/switch.d/chromium
index 9048b80..fb701a5 100755
--- a/.local/share/mode/switch.d/chromium
+++ b/.local/share/mode/switch.d/chromium
@@ -1,17 +1,16 @@
#!/bin/sh
-PREFIX="$XDG_CACHE_HOME/mode/chromium"
+mkcd "$XDG_CACHE_HOME/mode/chromium"
-mkdir -p "$PREFIX"
-rm -f "$PREFIX/Cached Theme.pak"
+rm -f 'Cached Theme.pak'
-magick -size 100x100 "xc:$bg" "$PREFIX/bg.png"
+magick -size 100x100 "xc:$bg" 'bg.png'
bg_alt=$(mix_rgb $color7 $bg 0.20)
fg_alt=$(mix_rgb $color15 $fg 0.60)
bg="$(hex_to_rgb_array "$bg")"
fg="$(hex_to_rgb_array "$fg")"
bg_alt="$(hex_to_rgb_array "$bg_alt")"
fg_alt="$(hex_to_rgb_array "$fg_alt")"
-cat << EOF > "$PREFIX/manifest.json"
+cat << EOF > 'manifest.json'
{
"description": "colorscheme generated by mode",
"manifest_version": 2,
diff --git a/.local/share/mode/switch.d/discord b/.local/share/mode/switch.d/discord
index f656783..5931dec 100755
--- a/.local/share/mode/switch.d/discord
+++ b/.local/share/mode/switch.d/discord
@@ -1,5 +1,6 @@
#!/bin/sh
-cat << EOF > "$XDG_CONFIG_HOME/BetterDiscord/themes/mode.theme.css"
+mkcd "$XDG_CONFIG_HOME/BetterDiscord/themes"
+cat << EOF > 'mode.theme.css'
/**
* @name mode
* @author mode
diff --git a/.local/share/mode/switch.d/dunst b/.local/share/mode/switch.d/dunst
index d4fd8dc..f863100 100755
--- a/.local/share/mode/switch.d/dunst
+++ b/.local/share/mode/switch.d/dunst
@@ -1,5 +1,6 @@
#!/bin/sh
-cat "$XDG_CONFIG_HOME/dunst/base" - << EOF > "$XDG_CONFIG_HOME/dunst/dunstrc"
+mkcd "$XDG_CONFIG_HOME/dunst"
+cat 'base' - << EOF > 'dunstrc'
frame_color = "$accent"
[urgency_low]
diff --git a/.local/share/mode/switch.d/fcitx5 b/.local/share/mode/switch.d/fcitx5
index 4b35478..71880a7 100755
--- a/.local/share/mode/switch.d/fcitx5
+++ b/.local/share/mode/switch.d/fcitx5
@@ -1,5 +1,5 @@
#!/bin/sh
-cd "$XDG_DATA_HOME/fcitx5/themes/default"
+mkcd "$XDG_DATA_HOME/fcitx5/themes/default"
rounding=6
size=$(( 2 * $rounding + 4 ))
margin_h=6
diff --git a/.local/share/mode/switch.d/mode b/.local/share/mode/switch.d/mode
index 3b58fa6..f4c916e 100755
--- a/.local/share/mode/switch.d/mode
+++ b/.local/share/mode/switch.d/mode
@@ -1,8 +1,8 @@
#!/bin/sh
-PREFIX="$XDG_CACHE_HOME/mode/state"
-rm -rf "$PREFIX"/*
-mkdir -p "$PREFIX"
+mkcd "$XDG_CACHE_HOME/mode/state"
-echo "$mode" > "$PREFIX/mode"
-ln -sf "$theme" "$PREFIX/theme"
+echo "$mode" > mode
+rm theme
+ln -sf "$theme" theme
+echo "#!/bin/sh$vars" > vars
diff --git a/.local/share/mode/switch.d/polybar b/.local/share/mode/switch.d/polybar
index b7e752a..17fcee2 100755
--- a/.local/share/mode/switch.d/polybar
+++ b/.local/share/mode/switch.d/polybar
@@ -1,5 +1,6 @@
#!/bin/sh
-cat << EOF > "$XDG_CONFIG_HOME/polybar/colors.ini"
+mkcd "$XDG_CONFIG_HOME/polybar"
+cat << EOF > 'colors.ini'
[color]
bg = \${xrdb:background:$bg}
fg = \${xrdb:foreground:$fg}
diff --git a/.local/share/mode/switch.d/rofi b/.local/share/mode/switch.d/rofi
deleted file mode 100755
index 19b9008..0000000
--- a/.local/share/mode/switch.d/rofi
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-cat << EOF > "$XDG_CONFIG_HOME/rofi/colors"
-export background="$bg"
-export foreground="$fg"
-export accent="$accent"
-export accent_text="$accent_text"
-EOF
-
diff --git a/.local/share/mode/switch.d/vim b/.local/share/mode/switch.d/vim
index 6c83f9f..7c2bbf6 100755
--- a/.local/share/mode/switch.d/vim
+++ b/.local/share/mode/switch.d/vim
@@ -1,9 +1,8 @@
#!/bin/sh
-PREFIX="$XDG_CONFIG_HOME/nvim/mode"
-mkdir -p "$PREFIX"
+mkcd "$XDG_CONFIG_HOME/nvim/mode"
# lightline
-cat << EOF > "$PREFIX/lightline.vim"
+cat << EOF > 'lightline.vim'
let s:bg = [ '$bg', 'NONE' ]
let s:fg = [ '$fg', 'NONE' ]
let s:mode = [ '$color0', 'NONE' ]
@@ -32,7 +31,7 @@ let g:lightline#colorscheme#auto#palette = lightline#colorscheme#flatten(s:p)
EOF
# terminal colors
-cat << EOF > "$PREFIX/termcolors.vim"
+cat << EOF > 'termcolors.vim'
let g:terminal_color_0 = '$color0'
let g:terminal_color_1 = '$color1'
let g:terminal_color_2 = '$color2'
@@ -52,7 +51,7 @@ let g:terminal_color_15 = '$color15'
EOF
# color scheme
-cat << EOF > "$PREFIX/colorscheme.vim"
+cat << EOF > 'colorscheme.vim'
colorscheme $vim_theme_name
EOF
diff --git a/.local/share/mode/switch.d/zathura b/.local/share/mode/switch.d/zathura
index c0687df..e1a15e7 100755
--- a/.local/share/mode/switch.d/zathura
+++ b/.local/share/mode/switch.d/zathura
@@ -1,5 +1,6 @@
#!/bin/sh
-cat << EOF > "$XDG_CONFIG_HOME/zathura/colors"
+mkcd "$XDG_CONFIG_HOME/zathura"
+cat << EOF > 'colors'
set completion-bg "$bg"
set completion-fg "$fg"
set completion-highlight-bg "$accent"