From f40d34aa5fad5204f98b65e647a0450cf275f2e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Czy=C5=BC?= Date: Fri, 22 Sep 2023 17:25:55 +0200 Subject: [PATCH] finished theme changer and wallpaper changer --- cava/.config/cava/config | 4 +- cava/.config/cava/nohup.out | 0 desktop/.colormode | 1 + desktop/.dwm | 2 +- desktop/.xinitrc | 2 +- .../themes/pywal-discord-default.theme.css | 14 +- mako/.config/mako/config | 4 +- picom/.config/picom.conf | 3 +- rofi/.config/rofi/scripts/theme | 51 +++++ rofi/.config/rofi/scripts/wallpaper | 29 ++- .../.config/spicetify/Themes/Pywal/color.ini | 20 +- .../spicetify/Themes/Pywal/update-colors.sh | 4 +- theme/dark | 4 + theme/light | 4 + wal/.config/wal/templates/bar.sh | 179 ++++++++++++++++++ 15 files changed, 291 insertions(+), 30 deletions(-) create mode 100644 cava/.config/cava/nohup.out create mode 100644 desktop/.colormode create mode 100755 rofi/.config/rofi/scripts/theme create mode 100755 theme/dark create mode 100755 theme/light create mode 100755 wal/.config/wal/templates/bar.sh diff --git a/cava/.config/cava/config b/cava/.config/cava/config index 927175f..16634a1 100644 --- a/cava/.config/cava/config +++ b/cava/.config/cava/config @@ -1,7 +1,7 @@ [color] -; background = #0b0c16 -; foreground = #c2c2c4 +; background = #f5f5f8 +; foreground = #3d3d3e gradient = 1 gradient_count = 4 diff --git a/cava/.config/cava/nohup.out b/cava/.config/cava/nohup.out new file mode 100644 index 0000000..e69de29 diff --git a/desktop/.colormode b/desktop/.colormode new file mode 100644 index 0000000..7619dd1 --- /dev/null +++ b/desktop/.colormode @@ -0,0 +1 @@ +isLight=1 diff --git a/desktop/.dwm b/desktop/.dwm index ffb8017..08c9078 160000 --- a/desktop/.dwm +++ b/desktop/.dwm @@ -1 +1 @@ -Subproject commit ffb8017550a2a4d4e4f513c106e2d10bf4a7ddb8 +Subproject commit 08c907868537577bc4f39cfcfe9c1fb384b11516 diff --git a/desktop/.xinitrc b/desktop/.xinitrc index 984bf2a..3ef4245 100755 --- a/desktop/.xinitrc +++ b/desktop/.xinitrc @@ -110,7 +110,7 @@ xsettingsd & hash dockd && dockd --daemon & # status bar -$HOME/.dwm/bar.sh & +bash $HOME/.cache/wal/bar.sh & disown # dbus-update-activation-environment --systemd DBUS_SESSION_BUS_ADDRESS DISPLAY XAUTHORITY diff --git a/discord/.config/BetterDiscord/themes/pywal-discord-default.theme.css b/discord/.config/BetterDiscord/themes/pywal-discord-default.theme.css index aa98c34..f4dcd73 100644 --- a/discord/.config/BetterDiscord/themes/pywal-discord-default.theme.css +++ b/discord/.config/BetterDiscord/themes/pywal-discord-default.theme.css @@ -12,27 +12,27 @@ --wallpaper: url("/home/mike/Wallpapers/bigsur.jpeg"); /* Special */ - --background: #0b0c16; - --foreground: #c2c2c4; - --cursor: #c2c2c4; + --background: #f5f5f8; + --foreground: #3d3d3e; + --cursor: #3d3d3e; /* Colors */ - --color0: #0b0c16; + --color0: #f5f5f8; --color1: #0c5484; --color2: #3f3969; --color3: #7a2761; --color4: #1b618d; --color5: #216b98; --color6: #3e81ab; - --color7: #85858a; - --color8: #484850; + --color7: #7a7a7c; + --color8: #b7b7ba; --color9: #1171B0; --color10: #554D8D; --color11: #A33582; --color12: #2482BC; --color13: #2D8FCB; --color14: #53ACE4; - --color15: #c2c2c4; + --color15: #3d3d3e; } /** colors will come from .cache/wal/colors.css as variables defined in :root * see: cat $HOME/.cache/wal/colors.css diff --git a/mako/.config/mako/config b/mako/.config/mako/config index ef44f67..763465e 100644 --- a/mako/.config/mako/config +++ b/mako/.config/mako/config @@ -1,10 +1,10 @@ sort=-time layer=overlay -background-color=#0b0c16 +background-color=#f5f5f8 width=300 height=110 border-size=3 -text-color=#c2c2c4 +text-color=#3d3d3e border-color=#2D8FCB border-radius=10 icons=1 diff --git a/picom/.config/picom.conf b/picom/.config/picom.conf index bb67f49..ef90584 100644 --- a/picom/.config/picom.conf +++ b/picom/.config/picom.conf @@ -164,11 +164,12 @@ opacity-rule = [ "88:class_g = 'discord'", "85:class_g = 'Emacs'", "95:class_g = 'Signal'", - "90:class_g = 'Telegram'", + "85:class_g = 'TelegramDesktop'", "90:class_g = 'Spotify'", "90:class_g = 'notion-app'", "90:class_g = 'easyeffects'", "85:class_g = 'kitty'", + "85:class_g = 'Nemo'" # "85:class_g = 'firefox'", ] diff --git a/rofi/.config/rofi/scripts/theme b/rofi/.config/rofi/scripts/theme new file mode 100755 index 0000000..dacb911 --- /dev/null +++ b/rofi/.config/rofi/scripts/theme @@ -0,0 +1,51 @@ +#!/bin/bash + +export PATH="${PATH}:${HOME}/.local/bin/" + +dir="$HOME/.config/rofi/launchers/type-1" +rofitheme='style-1' + +themes=$HOME/.dots/theme +option="$(ls $themes | rofi -dmenu -i -p " Select theme: " -theme ${dir}/${rofitheme}.rasi)" +theme=$themes/$option + +if [[ -d $themes/$option ]]; then + echo "$themes/$option is a directory" + exit 1 +elif [[ -f $themes/$option ]]; then + echo "$themes/$option is a file" + . $themes/$option +else + echo "$themes/$option is not valid" + exit 1 +fi + +source ~/.colormode + +wallight="" +gtktheme=Macchiato +gtktype=dark + +if [[ $isLight -eq 1 ]]; then + wallight="-l" + gtktheme=Latte + gtktype=light +fi + +wal $wallight -i "$(cat $HOME/.cache/wal/wal)" --cols16 +# pywalfox update +pywal-discord -t default +wal-telegram --wal + +. $HOME/.config/mako/update-colors.sh +. $HOME/.config/spicetify/Themes/Pywal/update-colors.sh +. $HOME/.config/cava/scripts/update-colors.sh + +echo "Net/ThemeName \"Catppuccin-$gtktheme-Standard-Blue-$gtktype\"" > $HOME/.xsettingsd +killall -HUP xsettingsd +xsettingsd & + +kill -HUP $(pgrep -f 'bar.sh') +bash $HOME/.cache/wal/bar.sh & disown + +killall -HUP dwm diff --git a/rofi/.config/rofi/scripts/wallpaper b/rofi/.config/rofi/scripts/wallpaper index ca8163e..b28b0c9 100755 --- a/rofi/.config/rofi/scripts/wallpaper +++ b/rofi/.config/rofi/scripts/wallpaper @@ -24,13 +24,32 @@ fi # swww img $wallpaper --transition-type grow --transition-fps 60 --transition-duration 1.0 --transition-bezier 0.65,0,0.35,1 --transition-step 255 feh --bg-fill $wallpaper -wal -i $wallpaper --cols16 -pywalfox update +source ~/.colormode + +wallight="" +gtktheme=Macchiato +gtktype=dark + +if [[ $isLight -eq 1 ]]; then + wallight="-l" + gtktheme=Latte + gtktype=light +fi + +wal $wallight -i $wallpaper --cols16 +# pywalfox update pywal-discord -t default wal-telegram --wal -kill -HUP $(pgrep dwm) - . $HOME/.config/mako/update-colors.sh . $HOME/.config/spicetify/Themes/Pywal/update-colors.sh -. $HOME/.config/cava/scripts/update-colors.sh \ No newline at end of file +. $HOME/.config/cava/scripts/update-colors.sh + +echo "Net/ThemeName \"Catppuccin-$gtktheme-Standard-Blue-$gtktype\"" > $HOME/.xsettingsd +killall -HUP xsettingsd +xsettingsd & + +kill -HUP $(pgrep -f 'bar.sh') +bash $HOME/.cache/wal/bar.sh & disown + +killall -HUP dwm diff --git a/spicetify/.config/spicetify/Themes/Pywal/color.ini b/spicetify/.config/spicetify/Themes/Pywal/color.ini index 5fe9fd7..84e047d 100644 --- a/spicetify/.config/spicetify/Themes/Pywal/color.ini +++ b/spicetify/.config/spicetify/Themes/Pywal/color.ini @@ -1,16 +1,16 @@ [Dynamic] -text = c2c2c4 -subtext = c2c2c4 -main = 0b0c16 -sidebar = 0b0c16 -player = 0b0c16 -card = 0b0c16 -shadow = 0b0c16 +text = 3d3d3e +subtext = 3d3d3e +main = f5f5f8 +sidebar = f5f5f8 +player = f5f5f8 +card = f5f5f8 +shadow = f5f5f8 selected-row = 53ACE4 button = 1171B0 button-active = 53ACE4 -button-disabled = 484850 +button-disabled = b7b7ba tab-active = 1171B0 -notification = 0b0c16 +notification = f5f5f8 notification-error = 1171B0 -misc = 0b0c16 \ No newline at end of file +misc = f5f5f8 \ No newline at end of file diff --git a/spicetify/.config/spicetify/Themes/Pywal/update-colors.sh b/spicetify/.config/spicetify/Themes/Pywal/update-colors.sh index cec4a9a..1c5578d 100755 --- a/spicetify/.config/spicetify/Themes/Pywal/update-colors.sh +++ b/spicetify/.config/spicetify/Themes/Pywal/update-colors.sh @@ -2,4 +2,6 @@ cp -r $HOME/.cache/wal/colors-spicetify.ini $HOME/.config/spicetify/Themes/Pywal cd $HOME/.config/spicetify/Themes/Pywal -mv colors-spicetify.ini color.ini \ No newline at end of file +mv colors-spicetify.ini color.ini + +spicetify apply \ No newline at end of file diff --git a/theme/dark b/theme/dark new file mode 100755 index 0000000..527684b --- /dev/null +++ b/theme/dark @@ -0,0 +1,4 @@ +#!/bin/bash + +echo "dark" +echo "isLight=0" > ~/.colormode \ No newline at end of file diff --git a/theme/light b/theme/light new file mode 100755 index 0000000..d091841 --- /dev/null +++ b/theme/light @@ -0,0 +1,4 @@ +#!/bin/bash + +echo "light" +echo "isLight=1" > ~/.colormode \ No newline at end of file diff --git a/wal/.config/wal/templates/bar.sh b/wal/.config/wal/templates/bar.sh new file mode 100755 index 0000000..2a4f3b0 --- /dev/null +++ b/wal/.config/wal/templates/bar.sh @@ -0,0 +1,179 @@ +#!/bin/bash + +function lighten_color() {{ + offset=20 + + hex_color=$1 + hex_color=${{hex_color:1}} + + red=${{hex_color:0:2}} + green=${{hex_color:2:2}} + blue=${{hex_color:4:2}} + + red_dec=$(printf "%d" 0x$red) + green_dec=$(printf "%d" 0x$green) + blue_dec=$(printf "%d" 0x$blue) + + if [[ $red_dec -lt 128 ]]; then + red_dec_l=$((red_dec+offset)) + green_dec_l=$((green_dec+offset)) + blue_dec_l=$((blue_dec+offset)) + else + red_dec_l=$((red_dec-offset)) + green_dec_l=$((green_dec-offset)) + blue_dec_l=$((blue_dec-offset)) + fi + + red=$(printf "%02X" $red_dec_l) + green=$(printf "%02X" $green_dec_l) + blue=$(printf "%02X" $blue_dec_l) + + echo "#$red$green$blue" +}} + +# ^c$var^ = fg color +# ^b$var^ = bg color + +interval=0 + +# load colors +# . ~/.config/bar_themes/onedark + +# colors + +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 + +# Special +background={color0} +foreground={color15} +cursor={color15} + +# Colors +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} + +background0=$(lighten_color $background) +background1=$(lighten_color $background0) +background2=$(lighten_color $background1) + +pulse () {{ + VOL=$(pamixer --get-volume) + STATE=$(pamixer --get-mute) + + printf "%s" "$SEP1" + if [ "$STATE" = "true" ] || [ "$VOL" -eq 0 ]; then + printf "AMUT%%" + elif [ "$VOL" -gt 0 ] && [ "$VOL" -le 33 ]; then + printf "A%s%%" "$VOL" + elif [ "$VOL" -gt 33 ] && [ "$VOL" -le 66 ]; then + printf "A%s%%" "$VOL" + else + printf "A%s%%" "$VOL" + fi + printf "%s\n" "$SEP2" +}} + +cpu() {{ + cpu_val=$(grep -o "^[^ ]*" /proc/loadavg) + + printf "^c$background^ ^b$yellow^ 󰇄 " + printf "^c$background^ ^b$yellow^$cpu_val" +}} + +battery() {{ + capacity_0="$(cat /sys/class/power_supply/BAT0/capacity)" + capacity_1="$(cat /sys/class/power_supply/BAT1/capacity)" + + capacity="$capacity_0+$capacity_1" + # capacity=$(((capacity_0 + capacity_1) / 2)) + + printf " B$capacity%% " +}} + +brightness() {{ + value=$(cat /sys/class/backlight/*/brightness) + percentage=$(echo "scale=2; $value / 8.54" | bc) + printf "L%.0f%%" "$percentage" +}} + +mem() {{ + printf "^c$background^^b$green^  " + printf "^c$background^^b$green^ $(free -h | awk '/^Mem/ {{ print $3 }}' | sed s/i//g)" +}} + +wlan() {{ + case "$(cat /sys/class/net/wl*/operstate 2>/dev/null)" in + up) printf "^c$background^ ^b$blue^ 󰤨 ^c$background^ ^b$blue^Connected" ;; + down) printf "^c$background^ ^b$blue^ 󰤭 ^c$background^ ^b$blue^Disconnected" ;; + esac +}} + +clock() {{ + printf " $(date '+%I:%M %P') " +}} + +today() {{ + printf " $(date '+%b %e') " +}} + +net() {{ + if nc -zw1 google.com 443; then + printf "^c$background^^b$green^ i " + else + printf "^c$background^^b$red^ ! " + fi +}} + +while true; do + + # [ $interval = 0 ] || [ $(($interval % 3600)) = 0 ] && updates=$(pkg_updates) + # interval=$((interval + 1)) + + # sleep 1 && xsetroot -name "$updates $(battery) $(brightness) $(cpu) $(mem) $(wlan) $(clock)" + # sleep 1 && xsetroot -name "$(battery) $(brightness) $(cpu) $(mem) $(wlan) $(clock)" + if hash dockd 2>/dev/null; then + sleep 1 && xsetroot -name "^c$foreground^^b$background1^ $(brightness) ^b$background0^ $(battery) $(net)^c$foreground^^b$background0^ $(today) ^b$background1^ $(clock) ^b$background2^ $(pulse) " + else + sleep 1 && xsetroot -name "^c$foreground^$(net)^c$foreground^^b$background0^ $(today) ^b$background1^ $(clock) ^b$background2^ $(pulse) " + fi + +done