aboutsummaryrefslogtreecommitdiff
path: root/.local/share/mode/switch.d
diff options
context:
space:
mode:
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/kitty25
-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
10 files changed, 47 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/kitty b/.local/share/mode/switch.d/kitty
new file mode 100755
index 0000000..dddc41b
--- /dev/null
+++ b/.local/share/mode/switch.d/kitty
@@ -0,0 +1,25 @@
+#!/bin/sh
+mkcd "$XDG_CONFIG_HOME/kitty"
+
+cat << EOF > 'color.conf'
+background $bg
+foreground $fg
+
+color0 $color0
+color1 $color1
+color2 $color2
+color3 $color3
+color4 $color4
+color5 $color5
+color6 $color6
+color7 $color7
+color8 $color8
+color9 $color9
+color10 $color10
+color11 $color11
+color12 $color12
+color13 $color13
+color14 $color14
+color15 $color15
+EOF
+
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"