diff --git a/Configs/.config/dunst/dunstrc b/Configs/.config/dunst/dunstrc index 53e609d084..497b94a170 100644 --- a/Configs/.config/dunst/dunstrc +++ b/Configs/.config/dunst/dunstrc @@ -451,15 +451,15 @@ #default_icon = /path/to/icon [urgency_low] - background = "#253845" - foreground = "#3F4252" - frame_color = "#3F4252" + background = "#22232A" + foreground = "#E2DFD1" + frame_color = "#262C48" icon = "~/.config/dunst/icons/hyprdots.svg" timeout = 10 [urgency_normal] - background = "#1D202E" - foreground = "#AD584F" - frame_color = "#AD584F" + background = "#4D5C78" + foreground = "#E2DFD1" + frame_color = "#622D28" icon = "~/.config/dunst/icons/hyprdots.svg" timeout = 10 diff --git a/Configs/.config/hypr/scripts/spotifyvolumecontrol.sh b/Configs/.config/hypr/scripts/spotifyvolumecontrol.sh index 5fc26aa1d2..094c05ab88 100755 --- a/Configs/.config/hypr/scripts/spotifyvolumecontrol.sh +++ b/Configs/.config/hypr/scripts/spotifyvolumecontrol.sh @@ -5,12 +5,16 @@ PLAYER="spotify" # function to increase Spotify volume increase_volume() { - playerctl --player="$PLAYER" volume 0.05+ + playerctl --player="$PLAYER" volume 0.05+ + VOLUME=$(playerctl volume --player $PLAYER) + dunstify -a Spotify -r 2 -t 1500 -i /usr/share/icons/Tela-circle-black/scalable/apps/com.spotify.Client.svg "Volume increased" "$VOLUME" } # function to decrease Spotify volume decrease_volume() { - playerctl --player="$PLAYER" volume 0.05- + playerctl --player="$PLAYER" volume 0.05- + VOLUME=$(playerctl volume --player $PLAYER) + dunstify -a Spotify -r 2 -t 1500 -i /usr/share/icons/Tela-circle-black/scalable/apps/com.spotify.Client.svg "Volume decreased" "$VOLUME" } # check for the argument and perform the corresponding action diff --git a/Configs/.config/hypr/scripts/swwwallbash.sh b/Configs/.config/hypr/scripts/swwwallbash.sh index 134aaebe41..cf1b673501 100755 --- a/Configs/.config/hypr/scripts/swwwallbash.sh +++ b/Configs/.config/hypr/scripts/swwwallbash.sh @@ -6,7 +6,7 @@ export ScrDir=`dirname $(realpath $0)` source $ScrDir/globalcontrol.sh dcoDir="$HOME/.config/hypr/wallbash" input_wall="$1" -cacheImg=$(basename "${input_wall}") +export cacheImg=$(basename "${input_wall}") if [ -z "${input_wall}" ] || [ ! -f "${input_wall}" ] ; then echo "Error: Input wallpaper not found!" @@ -14,34 +14,93 @@ if [ -z "${input_wall}" ] || [ ! -f "${input_wall}" ] ; then fi -# extract dcols +# color conversion functions + +hex_conv() { + rgb_val=$(echo "$1" | sed 's/[-srgb()%]//g ; s/,/ /g') + red=$(echo "$rgb_val * 255 / 100" | awk '{printf "%d", $1}') + green=$(echo "$rgb_val * 255 / 100" | awk '{printf "%d", $2}') + blue=$(echo "$rgb_val * 255 / 100" | awk '{printf "%d", $3}') + printf "%02X%02X%02X\n" "$red" "$green" "$blue" +} + +dark_light () { + inCol="$1" + red=$(printf "%d" "0x${inCol:1:2}") + green=$(printf "%d" "0x${inCol:3:2}") + blue=$(printf "%d" "0x${inCol:5:2}") + brightness=$((red + green + blue)) + [ "$brightness" -lt 300 ] +} + + +# extract 3 dominant colors from input wall if [ ! -f "${cacheDir}/${gtkTheme}/${cacheImg}.dcol" ] ; then - magick "${input_wall}" -colors 4 -define histogram:unique-colors=true -format "%c" histogram:info: > "${cacheDir}/${gtkTheme}/${cacheImg}.dcol" -fi + mkdir -p "${cacheDir}/${gtkTheme}" + dcol=(`magick "${input_wall}" -colors 3 -define histogram:unique-colors=true -format "%c" histogram:info: | awk '{print substr($3,2,6)}' | awk '{printf "%d %s\n", "0x"$1, $0}' | sort -n | awk '{print $2}'`) + for (( i = 1; i < 3; i++ )) ; do + [ -z "${dcol[i]}" ] && dcol[i]=${dcol[i-1]} + done -declare -x x_dcol=$(mktemp) -awk '{print substr($3,1,7)}' "${cacheDir}/${gtkTheme}/${cacheImg}.dcol" | sort > "${x_dcol}" + # generate palette based on 3 primary color + + for (( j = 0; j < 3; j++ )) ; do + r_swatch=$(echo "#${dcol[j]}" | sed 's/#//g') + echo "dcol_pry${j}=\"${r_swatch}\"" >> "${cacheDir}/${gtkTheme}/${cacheImg}.dcol" + r_swatch=$(hex_conv `convert xc:"#${dcol[j]}" -negate -format "%c" histogram:info: | awk '{print $4}'`) + echo "dcol_txt${j}=\"${r_swatch}\"" >> "${cacheDir}/${gtkTheme}/${cacheImg}.dcol" + z=0 + + if dark_light "#${dcol[j]}" ; then + #echo "Generate accent colors for lighter shades..." + for t in 30 50 70 90 ; do + z=$(( z + 1 )) + r_swatch=$(hex_conv `convert xc:"#${dcol[j]}" -modulate 200,"$(awk "BEGIN {print $t * 1.5}")" -channel RGB -evaluate multiply 1.$t -format "%c" histogram:info: | awk '{print $4}'`) + echo "dcol_${j}xa${z}=\"${r_swatch}\"" >> "${cacheDir}/${gtkTheme}/${cacheImg}.dcol" + done + else + #echo "Generate accent colors for darker shades..." + for t in 15 35 55 75 ; do + z=$(( z + 1 )) + r_swatch=$(hex_conv `convert xc:"#${dcol[j]}" -modulate 80,"$(awk "BEGIN {print $t * 1.5}")" -channel RGB -evaluate multiply 1.$t -format "%c" histogram:info: | awk '{print $4}'`) + echo "dcol_${j}xa${z}=\"${r_swatch}\"" >> "${cacheDir}/${gtkTheme}/${cacheImg}.dcol" + done + fi + done +fi -# loop thru templates +# wallbash fn to apply colors to templates fn_wallbash () { local tplt="${1}" - local dcol=(`cat ${x_dcol}`) - local dcolct=$(head -1 "${tplt}" | cut -d '|' -f 1) - eval target=$(head -1 "${tplt}" | cut -d '|' -f 2) - eval appexe=$(head -1 "${tplt}" | cut -d '|' -f 3) + eval target=$(head -1 "${tplt}" | awk -F '|' '{print $1}') + eval appexe=$(head -1 "${tplt}" | awk -F '|' '{print $2}') + source "${ScrDir}/globalcontrol.sh" + source "${cacheDir}/${gtkTheme}/${cacheImg}.dcol" sed '1d' "${tplt}" > "${target}" - for (( i=0; i < dcolct; i++ )) ; do - if [ -z "${dcol[i]}" ] ; then - dcol[i]=${dcol[i-1]} - fi - sed -i "s//${dcol[i]}/g" "${target}" - done - - if [ ! -z "${appexe}" ]; then + sed -i "s//${dcol_pry0}/g + s//${dcol_txt0}/g + s//${dcol_0xa1}/g + s//${dcol_0xa2}/g + s//${dcol_0xa3}/g + s//${dcol_0xa4}/g + s//${dcol_pry1}/g + s//${dcol_txt1}/g + s//${dcol_1xa1}/g + s//${dcol_1xa2}/g + s//${dcol_1xa3}/g + s//${dcol_1xa4}/g + s//${dcol_pry2}/g + s//${dcol_txt2}/g + s//${dcol_2xa1}/g + s//${dcol_2xa2}/g + s//${dcol_2xa3}/g + s//${dcol_2xa4}/g" "${target}" + + if [ ! -z "${appexe}" ] ; then "${appexe}" fi } @@ -49,9 +108,7 @@ fn_wallbash () { export -f fn_wallbash -# Process templates in parallel +# exec wallbash fn in parallel find "$dcoDir" -type f -name "*.dcol" | parallel -j 0 fn_wallbash -rm ${x_dcol} - diff --git a/Configs/.config/hypr/scripts/swwwallpaper.sh b/Configs/.config/hypr/scripts/swwwallpaper.sh index 2cc056eacd..f6698e76e7 100755 --- a/Configs/.config/hypr/scripts/swwwallpaper.sh +++ b/Configs/.config/hypr/scripts/swwwallpaper.sh @@ -4,27 +4,28 @@ Wall_Update() { - local x_wall="$1" - local x_update="${x_wall/$HOME/"~"}" - cacheImg=$(basename "$x_wall") - $ScrDir/swwwallbash.sh "$x_wall" - if [ ! -d "${cacheDir}/${curTheme}" ] ; then mkdir -p "${cacheDir}/${curTheme}" fi + local x_wall="$1" + local x_update="${x_wall/$HOME/"~"}" + cacheImg=$(basename "$x_wall") + $ScrDir/swwwallbash.sh "$x_wall" & + if [ ! -f "${cacheDir}/${curTheme}/${cacheImg}" ] ; then - convert -strip "$x_wall" -thumbnail 500x500^ -gravity center -extent 500x500 "${cacheDir}/${curTheme}/${cacheImg}" + convert -strip "$x_wall" -thumbnail 500x500^ -gravity center -extent 500x500 "${cacheDir}/${curTheme}/${cacheImg}" & fi if [ ! -f "${cacheDir}/${curTheme}/${cacheImg}.rofi" ] ; then - convert -strip -resize 2000 -gravity center -extent 2000 -quality 90 "$x_wall" "${cacheDir}/${curTheme}/${cacheImg}.rofi" + convert -strip -resize 2000 -gravity center -extent 2000 -quality 90 "$x_wall" "${cacheDir}/${curTheme}/${cacheImg}.rofi" & fi if [ ! -f "${cacheDir}/${curTheme}/${cacheImg}.blur" ] ; then - convert -strip -scale 10% -blur 0x3 -resize 100% "$x_wall" "${cacheDir}/${curTheme}/${cacheImg}.blur" + convert -strip -scale 10% -blur 0x3 -resize 100% "$x_wall" "${cacheDir}/${curTheme}/${cacheImg}.blur" & fi + wait sed -i "/^1|/c\1|${curTheme}|${x_update}" "$ctlFile" ln -fs "$x_wall" "$wallSet" ln -fs "${cacheDir}/${curTheme}/${cacheImg}.rofi" "$wallRfi" diff --git a/Configs/.config/hypr/scripts/themeswitch.sh b/Configs/.config/hypr/scripts/themeswitch.sh index a9691ab6d7..eec297781d 100755 --- a/Configs/.config/hypr/scripts/themeswitch.sh +++ b/Configs/.config/hypr/scripts/themeswitch.sh @@ -71,11 +71,11 @@ fi # swwwallpaper getWall=`grep '^1|' $ThemeCtl | cut -d '|' -f 3` -getWall=`eval echo $getWall` -getName=`basename $getWall` -ln -fs $getWall $ConfDir/swww/wall.set -ln -fs $cacheDir/${ThemeSet}/${getName}.rofi $ConfDir/swww/wall.rofi -ln -fs $cacheDir/${ThemeSet}/${getName}.blur $ConfDir/swww/wall.blur +getWall=`eval echo "$getWall"` +getName=`basename "$getWall"` +ln -fs "$getWall" "$ConfDir/swww/wall.set" +ln -fs "$cacheDir/${ThemeSet}/${getName}.rofi" "$ConfDir/swww/wall.rofi" +ln -fs "$cacheDir/${ThemeSet}/${getName}.blur" "$ConfDir/swww/wall.blur" ${ScrDir}/swwwallpaper.sh if [ $? -ne 0 ] ; then @@ -119,5 +119,5 @@ hyprctl reload # rofi & waybar -${ScrDir}/swwwallbash.sh $getWall +${ScrDir}/swwwallbash.sh "$getWall" diff --git a/Configs/.config/hypr/scripts/wallbashspotify.sh b/Configs/.config/hypr/scripts/wallbashspotify.sh index e2421597bd..9316854a80 100755 --- a/Configs/.config/hypr/scripts/wallbashspotify.sh +++ b/Configs/.config/hypr/scripts/wallbashspotify.sh @@ -22,6 +22,6 @@ if pkg_installed spotify && pkg_installed spicetify-cli ; then spicetify -q watch -s & fi - sed 's/#//g' $dcol > $scol + cp "$dcol" "$scol" fi diff --git a/Configs/.config/hypr/scripts/wallbashtoggle.sh b/Configs/.config/hypr/scripts/wallbashtoggle.sh index a5bb886305..03aafc1fc0 100755 --- a/Configs/.config/hypr/scripts/wallbashtoggle.sh +++ b/Configs/.config/hypr/scripts/wallbashtoggle.sh @@ -16,10 +16,10 @@ else fi # reset the colors -grep -m 1 '.' $DcoDir/*.dcol | cut -d '|' -f 3 | while read wallbash +grep -m 1 '.' $DcoDir/*.dcol | awk -F '|' '{print $2}' | while read wallbash do if [ ! -z "$wallbash" ] ; then - sh -c "ScrDir=`dirname $(realpath $0)` && $wallbash" + eval "${wallbash}" fi done diff --git a/Configs/.config/hypr/scripts/wallbashypr.sh b/Configs/.config/hypr/scripts/wallbashypr.sh index 9cbfdd6960..edc75650dc 100755 --- a/Configs/.config/hypr/scripts/wallbashypr.sh +++ b/Configs/.config/hypr/scripts/wallbashypr.sh @@ -9,7 +9,7 @@ hypDir="$HOME/.config/hypr/themes" # regen color conf if [ "$EnableWallDcol" -eq 1 ] ; then - sed 's/#//g' ${hypDir}/Wall-Dcol.conf > ${hypDir}/colors.conf + cp ${hypDir}/Wall-Dcol.conf ${hypDir}/colors.conf else > ${hypDir}/colors.conf fi diff --git a/Configs/.config/hypr/themes/Wall-Dcol.conf b/Configs/.config/hypr/themes/Wall-Dcol.conf index 511955b5e7..c7830bd397 100644 --- a/Configs/.config/hypr/themes/Wall-Dcol.conf +++ b/Configs/.config/hypr/themes/Wall-Dcol.conf @@ -1,11 +1,11 @@ general { - col.active_border = rgba(#1D202Eff) rgba(#3F4252ff) 45deg - col.inactive_border = rgba(#253845cc) rgba(#AD584Fcc) 45deg + col.active_border = rgba(AD584Fff) rgba(1D202Eff) 45deg + col.inactive_border = rgba(312A29ff) rgba(622D28ff) 45deg } group { - col.border_active = rgba(#1D202Eff) rgba(#3F4252ff) 45deg - col.border_inactive = rgba(#253845cc) rgba(#AD584Fcc) 45deg - col.border_locked_active = rgba(#1D202Eff) rgba(#3F4252ff) 45deg - col.border_locked_inactive = rgba(#253845cc) rgba(#AD584Fcc) 45deg + col.border_active = rgba(312A29ff) rgba(622D28ff) 45deg + col.border_inactive = rgba(22232Acc) rgba(262C48cc) 45deg + col.border_locked_active = rgba(3F2C2Aff) rgba(502E2Aff) 45deg + col.border_locked_inactive = rgba(242733cc) rgba(262A3Dcc) 45deg } diff --git a/Configs/.config/hypr/wallbash/dunst.dcol b/Configs/.config/hypr/wallbash/dunst.dcol index ebbefc2994..bc5e16e9cb 100644 --- a/Configs/.config/hypr/wallbash/dunst.dcol +++ b/Configs/.config/hypr/wallbash/dunst.dcol @@ -1,15 +1,15 @@ -4|~/.config/dunst/Wall-Dcol.conf|$ScrDir/wallbashdunst.sh +$HOME/.config/dunst/Wall-Dcol.conf|${ScrDir}/wallbashdunst.sh [urgency_low] - background = "" - foreground = "" - frame_color = "" + background = "#" + foreground = "#" + frame_color = "#" icon = "~/.config/dunst/icons/hyprdots.svg" timeout = 10 [urgency_normal] - background = "" - foreground = "" - frame_color = "" + background = "#" + foreground = "#" + frame_color = "#" icon = "~/.config/dunst/icons/hyprdots.svg" timeout = 10 diff --git a/Configs/.config/hypr/wallbash/hypr.dcol b/Configs/.config/hypr/wallbash/hypr.dcol index 9b87b33896..b927b0d5ed 100644 --- a/Configs/.config/hypr/wallbash/hypr.dcol +++ b/Configs/.config/hypr/wallbash/hypr.dcol @@ -1,12 +1,12 @@ -4|~/.config/hypr/themes/Wall-Dcol.conf|$ScrDir/wallbashypr.sh +$HOME/.config/hypr/themes/Wall-Dcol.conf|${ScrDir}/wallbashypr.sh general { - col.active_border = rgba(ff) rgba(ff) 45deg - col.inactive_border = rgba(cc) rgba(cc) 45deg + col.active_border = rgba(ff) rgba(ff) 45deg + col.inactive_border = rgba(ff) rgba(ff) 45deg } group { - col.border_active = rgba(ff) rgba(ff) 45deg - col.border_inactive = rgba(cc) rgba(cc) 45deg - col.border_locked_active = rgba(ff) rgba(ff) 45deg - col.border_locked_inactive = rgba(cc) rgba(cc) 45deg + col.border_active = rgba(ff) rgba(ff) 45deg + col.border_inactive = rgba(cc) rgba(cc) 45deg + col.border_locked_active = rgba(ff) rgba(ff) 45deg + col.border_locked_inactive = rgba(cc) rgba(cc) 45deg } diff --git a/Configs/.config/hypr/wallbash/icons/hyprdots.dcol b/Configs/.config/hypr/wallbash/icons/hyprdots.dcol index 90d625cead..6e2e727088 100644 --- a/Configs/.config/hypr/wallbash/icons/hyprdots.dcol +++ b/Configs/.config/hypr/wallbash/icons/hyprdots.dcol @@ -1,4 +1,4 @@ -4|~/.config/dunst/icons/hyprdots.svg +$HOME/.config/dunst/icons/hyprdots.svg - + \ No newline at end of file diff --git a/Configs/.config/hypr/wallbash/icons/muted-speaker.dcol b/Configs/.config/hypr/wallbash/icons/muted-speaker.dcol index 561d5ce249..368826abb0 100644 --- a/Configs/.config/hypr/wallbash/icons/muted-speaker.dcol +++ b/Configs/.config/hypr/wallbash/icons/muted-speaker.dcol @@ -1,3 +1,3 @@ -4|~/.config/dunst/icons/vol/muted-speaker.svg +$HOME/.config/dunst/icons/vol/muted-speaker.svg - \ No newline at end of file + \ No newline at end of file diff --git a/Configs/.config/hypr/wallbash/icons/unmuted-mic.dcol b/Configs/.config/hypr/wallbash/icons/unmuted-mic.dcol index 46f8cef582..ee8efd9268 100644 --- a/Configs/.config/hypr/wallbash/icons/unmuted-mic.dcol +++ b/Configs/.config/hypr/wallbash/icons/unmuted-mic.dcol @@ -1,6 +1,6 @@ -4|~/.config/dunst/icons/vol/unmuted-mic.svg +$HOME/.config/dunst/icons/vol/unmuted-mic.svg - + \ No newline at end of file diff --git a/Configs/.config/hypr/wallbash/icons/unmuted-speaker.dcol b/Configs/.config/hypr/wallbash/icons/unmuted-speaker.dcol index 8310f984cd..78b07016da 100644 --- a/Configs/.config/hypr/wallbash/icons/unmuted-speaker.dcol +++ b/Configs/.config/hypr/wallbash/icons/unmuted-speaker.dcol @@ -1,3 +1,3 @@ -4|~/.config/dunst/icons/vol/unmuted-speaker.svg +$HOME/.config/dunst/icons/vol/unmuted-speaker.svg - \ No newline at end of file + \ No newline at end of file diff --git a/Configs/.config/hypr/wallbash/icons/vol-0.dcol b/Configs/.config/hypr/wallbash/icons/vol-0.dcol index 6decc14812..51b47a3583 100644 --- a/Configs/.config/hypr/wallbash/icons/vol-0.dcol +++ b/Configs/.config/hypr/wallbash/icons/vol-0.dcol @@ -1,4 +1,4 @@ -4|~/.config/dunst/icons/vol/vol-0.svg +$HOME/.config/dunst/icons/vol/vol-0.svg diff --git a/Configs/.config/hypr/wallbash/icons/vol-100.dcol b/Configs/.config/hypr/wallbash/icons/vol-100.dcol index 6793273b2f..49672bf073 100644 --- a/Configs/.config/hypr/wallbash/icons/vol-100.dcol +++ b/Configs/.config/hypr/wallbash/icons/vol-100.dcol @@ -1,4 +1,4 @@ -4|~/.config/dunst/icons/vol/vol-100.svg +$HOME/.config/dunst/icons/vol/vol-100.svg diff --git a/Configs/.config/hypr/wallbash/icons/vol-20.dcol b/Configs/.config/hypr/wallbash/icons/vol-20.dcol index 5c74035a06..fa14f1a8e1 100644 --- a/Configs/.config/hypr/wallbash/icons/vol-20.dcol +++ b/Configs/.config/hypr/wallbash/icons/vol-20.dcol @@ -1,4 +1,4 @@ -4|~/.config/dunst/icons/vol/vol-20.svg +$HOME/.config/dunst/icons/vol/vol-20.svg diff --git a/Configs/.config/hypr/wallbash/icons/vol-25.dcol b/Configs/.config/hypr/wallbash/icons/vol-25.dcol index 22654a3fce..0c5e0648db 100644 --- a/Configs/.config/hypr/wallbash/icons/vol-25.dcol +++ b/Configs/.config/hypr/wallbash/icons/vol-25.dcol @@ -1,4 +1,4 @@ -4|~/.config/dunst/icons/vol/vol-25.svg +$HOME/.config/dunst/icons/vol/vol-25.svg diff --git a/Configs/.config/hypr/wallbash/icons/vol-30.dcol b/Configs/.config/hypr/wallbash/icons/vol-30.dcol index 8fd0d56195..4a4dd3951f 100644 --- a/Configs/.config/hypr/wallbash/icons/vol-30.dcol +++ b/Configs/.config/hypr/wallbash/icons/vol-30.dcol @@ -1,4 +1,4 @@ -4|~/.config/dunst/icons/vol/vol-30.svg +$HOME/.config/dunst/icons/vol/vol-30.svg diff --git a/Configs/.config/hypr/wallbash/icons/vol-35.dcol b/Configs/.config/hypr/wallbash/icons/vol-35.dcol index 7dc7b412d5..96c77690d7 100644 --- a/Configs/.config/hypr/wallbash/icons/vol-35.dcol +++ b/Configs/.config/hypr/wallbash/icons/vol-35.dcol @@ -1,4 +1,4 @@ -4|~/.config/dunst/icons/vol/vol-35.svg +$HOME/.config/dunst/icons/vol/vol-35.svg diff --git a/Configs/.config/hypr/wallbash/icons/vol-40.dcol b/Configs/.config/hypr/wallbash/icons/vol-40.dcol index 582880fb5d..81e49cf349 100644 --- a/Configs/.config/hypr/wallbash/icons/vol-40.dcol +++ b/Configs/.config/hypr/wallbash/icons/vol-40.dcol @@ -1,4 +1,4 @@ -4|~/.config/dunst/icons/vol/vol-40.svg +$HOME/.config/dunst/icons/vol/vol-40.svg diff --git a/Configs/.config/hypr/wallbash/icons/vol-45.dcol b/Configs/.config/hypr/wallbash/icons/vol-45.dcol index 104770546d..0edf21584d 100644 --- a/Configs/.config/hypr/wallbash/icons/vol-45.dcol +++ b/Configs/.config/hypr/wallbash/icons/vol-45.dcol @@ -1,4 +1,4 @@ -4|~/.config/dunst/icons/vol/vol-45.svg +$HOME/.config/dunst/icons/vol/vol-45.svg diff --git a/Configs/.config/hypr/wallbash/icons/vol-5.dcol b/Configs/.config/hypr/wallbash/icons/vol-5.dcol index 1c3b73912e..e33c68280b 100644 --- a/Configs/.config/hypr/wallbash/icons/vol-5.dcol +++ b/Configs/.config/hypr/wallbash/icons/vol-5.dcol @@ -1,4 +1,4 @@ -4|~/.config/dunst/icons/vol/vol-5.svg +$HOME/.config/dunst/icons/vol/vol-5.svg diff --git a/Configs/.config/hypr/wallbash/icons/vol-50.dcol b/Configs/.config/hypr/wallbash/icons/vol-50.dcol index 731ec8de05..183ad20510 100644 --- a/Configs/.config/hypr/wallbash/icons/vol-50.dcol +++ b/Configs/.config/hypr/wallbash/icons/vol-50.dcol @@ -1,4 +1,4 @@ -4|~/.config/dunst/icons/vol/vol-50.svg +$HOME/.config/dunst/icons/vol/vol-50.svg diff --git a/Configs/.config/hypr/wallbash/icons/vol-55.dcol b/Configs/.config/hypr/wallbash/icons/vol-55.dcol index 4768f29585..5e2e96f255 100644 --- a/Configs/.config/hypr/wallbash/icons/vol-55.dcol +++ b/Configs/.config/hypr/wallbash/icons/vol-55.dcol @@ -1,4 +1,4 @@ -4|~/.config/dunst/icons/vol/vol-55.svg +$HOME/.config/dunst/icons/vol/vol-55.svg diff --git a/Configs/.config/hypr/wallbash/icons/vol-60.dcol b/Configs/.config/hypr/wallbash/icons/vol-60.dcol index 1f03da6458..e3d8adaa21 100644 --- a/Configs/.config/hypr/wallbash/icons/vol-60.dcol +++ b/Configs/.config/hypr/wallbash/icons/vol-60.dcol @@ -1,4 +1,4 @@ -4|~/.config/dunst/icons/vol/vol-60.svg +$HOME/.config/dunst/icons/vol/vol-60.svg diff --git a/Configs/.config/hypr/wallbash/icons/vol-65.dcol b/Configs/.config/hypr/wallbash/icons/vol-65.dcol index 04156c99f8..f0e6ea5145 100644 --- a/Configs/.config/hypr/wallbash/icons/vol-65.dcol +++ b/Configs/.config/hypr/wallbash/icons/vol-65.dcol @@ -1,4 +1,4 @@ -4|~/.config/dunst/icons/vol/vol-65.svg +$HOME/.config/dunst/icons/vol/vol-65.svg diff --git a/Configs/.config/hypr/wallbash/icons/vol-70.dcol b/Configs/.config/hypr/wallbash/icons/vol-70.dcol index bca59a541b..a88ae9d17a 100644 --- a/Configs/.config/hypr/wallbash/icons/vol-70.dcol +++ b/Configs/.config/hypr/wallbash/icons/vol-70.dcol @@ -1,4 +1,4 @@ -4|~/.config/dunst/icons/vol/vol-70.svg +$HOME/.config/dunst/icons/vol/vol-70.svg diff --git a/Configs/.config/hypr/wallbash/icons/vol-75.dcol b/Configs/.config/hypr/wallbash/icons/vol-75.dcol index ba0c18ef6d..bd446bf1ed 100644 --- a/Configs/.config/hypr/wallbash/icons/vol-75.dcol +++ b/Configs/.config/hypr/wallbash/icons/vol-75.dcol @@ -1,4 +1,4 @@ -4|~/.config/dunst/icons/vol/vol-75.svg +$HOME/.config/dunst/icons/vol/vol-75.svg diff --git a/Configs/.config/hypr/wallbash/icons/vol-80.dcol b/Configs/.config/hypr/wallbash/icons/vol-80.dcol index 3fda4c689b..17f4ad17df 100644 --- a/Configs/.config/hypr/wallbash/icons/vol-80.dcol +++ b/Configs/.config/hypr/wallbash/icons/vol-80.dcol @@ -1,4 +1,4 @@ -4|~/.config/dunst/icons/vol/vol-80.svg +$HOME/.config/dunst/icons/vol/vol-80.svg diff --git a/Configs/.config/hypr/wallbash/icons/vol-85.dcol b/Configs/.config/hypr/wallbash/icons/vol-85.dcol index 85dfa315ee..3032b3c11b 100644 --- a/Configs/.config/hypr/wallbash/icons/vol-85.dcol +++ b/Configs/.config/hypr/wallbash/icons/vol-85.dcol @@ -1,4 +1,4 @@ -4|~/.config/dunst/icons/vol/vol-85.svg +$HOME/.config/dunst/icons/vol/vol-85.svg diff --git a/Configs/.config/hypr/wallbash/icons/vol-90.dcol b/Configs/.config/hypr/wallbash/icons/vol-90.dcol index ea70c887bc..d55bf3115d 100644 --- a/Configs/.config/hypr/wallbash/icons/vol-90.dcol +++ b/Configs/.config/hypr/wallbash/icons/vol-90.dcol @@ -1,4 +1,4 @@ -4|~/.config/dunst/icons/vol/vol-90.svg +$HOME/.config/dunst/icons/vol/vol-90.svg diff --git a/Configs/.config/hypr/wallbash/icons/vol-95.dcol b/Configs/.config/hypr/wallbash/icons/vol-95.dcol index 421b9408b7..9486d8ea16 100644 --- a/Configs/.config/hypr/wallbash/icons/vol-95.dcol +++ b/Configs/.config/hypr/wallbash/icons/vol-95.dcol @@ -1,4 +1,4 @@ -4|~/.config/dunst/icons/vol/vol-95.svg +$HOME/.config/dunst/icons/vol/vol-95.svg diff --git a/Configs/.config/hypr/wallbash/palette.dcol b/Configs/.config/hypr/wallbash/palette.dcol new file mode 100644 index 0000000000..564c6e29d8 --- /dev/null +++ b/Configs/.config/hypr/wallbash/palette.dcol @@ -0,0 +1,178 @@ +$HOME/.config/hypr/wallbash/palette.svg + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Configs/.config/hypr/wallbash/palette.svg b/Configs/.config/hypr/wallbash/palette.svg new file mode 100755 index 0000000000..25aff5be8d --- /dev/null +++ b/Configs/.config/hypr/wallbash/palette.svg @@ -0,0 +1,177 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Configs/.config/hypr/wallbash/rofi.dcol b/Configs/.config/hypr/wallbash/rofi.dcol index d0578275e4..eb792bec6b 100644 --- a/Configs/.config/hypr/wallbash/rofi.dcol +++ b/Configs/.config/hypr/wallbash/rofi.dcol @@ -1,9 +1,9 @@ -4|~/.config/rofi/themes/Wall-Dcol.rasi|$ScrDir/wallbashrofi.sh +$HOME/.config/rofi/themes/Wall-Dcol.rasi|${ScrDir}/wallbashrofi.sh * { - main-bg: E6; - main-fg: ; - main-br: ; - main-ex: ; - select-bg: ; - select-fg: ; + main-bg: #E6; + main-fg: #; + main-br: #; + main-ex: #; + select-bg: #; + select-fg: #; } diff --git a/Configs/.config/hypr/wallbash/spotify.dcol b/Configs/.config/hypr/wallbash/spotify.dcol index 359738e8ff..eaa41720cf 100644 --- a/Configs/.config/hypr/wallbash/spotify.dcol +++ b/Configs/.config/hypr/wallbash/spotify.dcol @@ -1,24 +1,24 @@ -4|~/.config/spicetify/Themes/Sleek/Wall-Dcol.ini|$ScrDir/wallbashspotify.sh +$HOME/.config/spicetify/Themes/Sleek/Wall-Dcol.ini|${ScrDir}/wallbashspotify.sh [Wallbash] -text = -subtext = -nav-active-text = -main = -sidebar = -player = -card = -shadow = -main-secondary = -button = -button-secondary = -button-active = -button-disabled = -nav-active = -play-button = -tab-active = -notification = -notification-error = -playback-bar = -misc = +text = +subtext = +nav-active-text = +main = +sidebar = +player = +card = +shadow = +main-secondary = +button = +button-secondary = +button-active = +button-disabled = +nav-active = +play-button = +tab-active = +notification = +notification-error = +playback-bar = +misc = diff --git a/Configs/.config/hypr/wallbash/waybar.dcol b/Configs/.config/hypr/wallbash/waybar.dcol index 61d6f188d1..5549c88258 100644 --- a/Configs/.config/hypr/wallbash/waybar.dcol +++ b/Configs/.config/hypr/wallbash/waybar.dcol @@ -1,8 +1,8 @@ -4|~/.config/waybar/themes/Wall-Dcol.css|$ScrDir/wbarconfgen.sh +$HOME/.config/waybar/themes/Wall-Dcol.css|${ScrDir}/wbarconfgen.sh @define-color bar-bg rgba(0, 0, 0, 0); -@define-color main-bg ; -@define-color main-fg ; -@define-color wb-act-bg ; -@define-color wb-act-fg ; -@define-color wb-hvr-bg ; -@define-color wb-hvr-fg ; +@define-color main-bg #; +@define-color main-fg #; +@define-color wb-act-bg #; +@define-color wb-act-fg #; +@define-color wb-hvr-bg #; +@define-color wb-hvr-fg #; diff --git a/Configs/.config/rofi/config.rasi b/Configs/.config/rofi/config.rasi index 1fc4c37669..c4064338ce 100644 --- a/Configs/.config/rofi/config.rasi +++ b/Configs/.config/rofi/config.rasi @@ -43,7 +43,7 @@ mainbox { // Inputs // inputbar { enabled: true; - width: 25%; + width: 640px; children: [ "mode-switcher" , "entry" ]; background-color: transparent; background-image: url("~/.config/swww/wall.rofi", height); diff --git a/Configs/.config/rofi/styles/style_1.rasi b/Configs/.config/rofi/styles/style_1.rasi index 1fc4c37669..c4064338ce 100644 --- a/Configs/.config/rofi/styles/style_1.rasi +++ b/Configs/.config/rofi/styles/style_1.rasi @@ -43,7 +43,7 @@ mainbox { // Inputs // inputbar { enabled: true; - width: 25%; + width: 640px; children: [ "mode-switcher" , "entry" ]; background-color: transparent; background-image: url("~/.config/swww/wall.rofi", height); diff --git a/Configs/.config/rofi/themes/Wall-Dcol.rasi b/Configs/.config/rofi/themes/Wall-Dcol.rasi index e7814e52b3..ec7d10cc92 100644 --- a/Configs/.config/rofi/themes/Wall-Dcol.rasi +++ b/Configs/.config/rofi/themes/Wall-Dcol.rasi @@ -1,10 +1,8 @@ * { - main-bg: #1D212FE6; - main-fg: #9A4D4A; - main-br: #43404F; - main-ex: #263745; - select-bg: #9A4D4A; - select-fg: #1D212F; - separatorcolor: transparent; - border-color: transparent; + main-bg: #1D202EE6; + main-fg: #AD584F; + main-br: #373F4E; + main-ex: #3E4248; + select-bg: #4D5C78; + select-fg: #E2DFD1; } diff --git a/Configs/.config/waybar/config.jsonc b/Configs/.config/waybar/config.jsonc index cba8ad9305..136241ee54 100644 --- a/Configs/.config/waybar/config.jsonc +++ b/Configs/.config/waybar/config.jsonc @@ -16,7 +16,7 @@ "modules-left": ["custom/padd","custom/l_end","custom/power","custom/cliphist","custom/wbar","custom/mode","custom/wallchange","custom/r_end","custom/l_end","wlr/taskbar","custom/spotify","custom/r_end","","custom/padd"], "modules-center": ["custom/padd","custom/l_end","idle_inhibitor","clock","custom/r_end","custom/padd"], - "modules-right": ["custom/padd","custom/l_end","tray","battery","custom/r_end","custom/l_end","network","bluetooth","pulseaudio","pulseaudio#microphone","custom/r_end","custom/padd"], + "modules-right": ["custom/padd","custom/l_end","tray","battery","custom/r_end","custom/l_end","backlight","network","bluetooth","pulseaudio","pulseaudio#microphone","custom/r_end","custom/padd"], // sourced from modules based on config.ctl // @@ -87,11 +87,12 @@ "custom/spotify": { "exec": "/usr/bin/python3 /home/tittu/.config/waybar/modules/mediaplayer.py --player spotify", - "format": "{} ", + "format": "{}", "return-type": "json", "on-click": "playerctl play-pause --player spotify", "on-scroll-up": "playerctl next", - "on-scroll-down": "playerctl previous" + "on-scroll-down": "playerctl previous", + "escape": true }, "idle_inhibitor": { @@ -144,6 +145,15 @@ "format-icons": ["󰂎", "󰁺", "󰁻", "󰁼", "󰁽", "󰁾", "󰁿", "󰂀", "󰂁", "󰂂", "󰁹"] }, + "backlight": { + "device": "intel_backlight", + "format": "{icon} {percent}%", + "format-icons": ["", "", "", "", "", "", "", "", ""], + "on-scroll-up": "brightnessctl set 1%+", + "on-scroll-down": "brightnessctl set 1%-", + "min-length": 6 + }, + "network": { // "interface": "wlp2*", // (Optional) To force the use of this interface "format-wifi": "󰤨 {essid}", diff --git a/Configs/.config/waybar/modules/backlight.jsonc b/Configs/.config/waybar/modules/backlight.jsonc index a8bda4caaa..f3e5b4c2ca 100644 --- a/Configs/.config/waybar/modules/backlight.jsonc +++ b/Configs/.config/waybar/modules/backlight.jsonc @@ -1,4 +1,4 @@ -"backlight": { + "backlight": { "device": "intel_backlight", "format": "{icon} {percent}%", "format-icons": ["", "", "", "", "", "", "", "", ""], @@ -6,3 +6,4 @@ "on-scroll-down": "brightnessctl set 1%-", "min-length": 6 }, + diff --git a/Configs/.config/waybar/modules/clock.jsonc b/Configs/.config/waybar/modules/clock.jsonc index b057c053a7..32501df00f 100644 --- a/Configs/.config/waybar/modules/clock.jsonc +++ b/Configs/.config/waybar/modules/clock.jsonc @@ -20,4 +20,4 @@ "on-scroll-up": "shift_up", "on-scroll-down": "shift_down" } - }, + }, \ No newline at end of file diff --git a/Configs/.config/waybar/modules/idle_inhibitor.jsonc b/Configs/.config/waybar/modules/idle_inhibitor.jsonc index d1ca6ff2b1..fec194b33d 100644 --- a/Configs/.config/waybar/modules/idle_inhibitor.jsonc +++ b/Configs/.config/waybar/modules/idle_inhibitor.jsonc @@ -5,3 +5,4 @@ "deactivated": "" } }, + diff --git a/Configs/.config/waybar/modules/mpris.jsonc b/Configs/.config/waybar/modules/mpris.jsonc index 356ee4bf01..58db9fd70c 100644 --- a/Configs/.config/waybar/modules/mpris.jsonc +++ b/Configs/.config/waybar/modules/mpris.jsonc @@ -9,6 +9,7 @@ "paused": "⏸" }, // "ignored-players": ["firefox"] - "max-length": 1000 + "max-length": 1000, + "interval": 1 }, diff --git a/Configs/.config/waybar/modules/spotify.jsonc b/Configs/.config/waybar/modules/spotify.jsonc index b6f9b4895f..0ad0f70d29 100644 --- a/Configs/.config/waybar/modules/spotify.jsonc +++ b/Configs/.config/waybar/modules/spotify.jsonc @@ -1,9 +1,13 @@ "custom/spotify": { "exec": "/usr/bin/python3 $HOME/.config/waybar/modules/mediaplayer.py --player spotify", - "format": "{} ", + "format": " {}", "return-type": "json", "on-click": "playerctl play-pause --player spotify", - "on-scroll-up": "playerctl next", - "on-scroll-down": "playerctl previous" + "on-click-right": "playerctl next --player spotify", + "on-click-middle": "playerctl previous --player spotify", + "on-scroll-up": "~/.config/hypr/scripts/spotifyvolumecontrol.sh up", + "on-scroll-down": "~/.config/hypr/scripts/spotifyvolumecontrol.sh down", + "max-length": 25, + "escape": true }, diff --git a/Configs/.config/waybar/modules/workspaces.jsonc b/Configs/.config/waybar/modules/workspaces.jsonc index 7d9afa96ef..92cb1cfc40 100644 --- a/Configs/.config/waybar/modules/workspaces.jsonc +++ b/Configs/.config/waybar/modules/workspaces.jsonc @@ -4,6 +4,6 @@ "active-only": false, "on-click": "activate", "persistent-workspaces": { - "1": [] } }, + diff --git a/Configs/.config/waybar/style.css b/Configs/.config/waybar/style.css index 5c55182126..2a9d486f07 100644 --- a/Configs/.config/waybar/style.css +++ b/Configs/.config/waybar/style.css @@ -88,6 +88,7 @@ tooltip { transition: all 0.3s cubic-bezier(.55,-0.68,.48,1.682); } +#backlight, #battery, #bluetooth, #custom-cliphist, diff --git a/Configs/.config/waybar/themes/Wall-Dcol.css b/Configs/.config/waybar/themes/Wall-Dcol.css index 0aba94b632..0bea63358b 100644 --- a/Configs/.config/waybar/themes/Wall-Dcol.css +++ b/Configs/.config/waybar/themes/Wall-Dcol.css @@ -1,7 +1,7 @@ @define-color bar-bg rgba(0, 0, 0, 0); @define-color main-bg #1D202E; @define-color main-fg #AD584F; -@define-color wb-act-bg #AD584F; -@define-color wb-act-fg #1D202E; -@define-color wb-hvr-bg #253845; -@define-color wb-hvr-fg #3F4252; +@define-color wb-act-bg #622D28; +@define-color wb-act-fg #22232A; +@define-color wb-hvr-bg #373F4E; +@define-color wb-hvr-fg #4D5C78; diff --git a/Configs/.zshrc b/Configs/.zshrc index 77184d4c9a..d57fe9863b 100644 --- a/Configs/.zshrc +++ b/Configs/.zshrc @@ -1,103 +1,14 @@ -# If you come from bash you might have to change your $PATH. -# export PATH=$HOME/bin:/usr/local/bin:$PATH - # Path to your oh-my-zsh installation. ZSH=/usr/share/oh-my-zsh/ -# Set name of the theme to load --- if set to "random", it will -# load a random theme each time oh-my-zsh is loaded, in which case, -# to know which specific one was loaded, run: echo $RANDOM_THEME -# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes +# Path to powerlevel10k theme source /usr/share/zsh-theme-powerlevel10k/powerlevel10k.zsh-theme -# Set list of themes to pick from when loading at random -# Setting this variable when ZSH_THEME=random will cause zsh to load -# a theme from this variable instead of looking in $ZSH/themes/ -# If set to an empty array, this variable will have no effect. -# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" ) - -# Uncomment the following line to use case-sensitive completion. -# CASE_SENSITIVE="true" - -# Uncomment the following line to use hyphen-insensitive completion. -# Case-sensitive completion must be off. _ and - will be interchangeable. -# HYPHEN_INSENSITIVE="true" - -# Uncomment one of the following lines to change the auto-update behavior -# zstyle ':omz:update' mode disabled # disable automatic updates -# zstyle ':omz:update' mode auto # update automatically without asking -# zstyle ':omz:update' mode reminder # just remind me to update when it's time - -# Uncomment the following line to change how often to auto-update (in days). -# zstyle ':omz:update' frequency 13 - -# Uncomment the following line if pasting URLs and other text is messed up. -# DISABLE_MAGIC_FUNCTIONS="true" - -# Uncomment the following line to disable colors in ls. -# DISABLE_LS_COLORS="true" - -# Uncomment the following line to disable auto-setting terminal title. -# DISABLE_AUTO_TITLE="true" - -# Uncomment the following line to enable command auto-correction. -# ENABLE_CORRECTION="true" - -# Uncomment the following line to display red dots whilst waiting for completion. -# You can also set it to another string to have that shown instead of the default red dots. -# e.g. COMPLETION_WAITING_DOTS="%F{yellow}waiting...%f" -# Caution: this setting can cause issues with multiline prompts in zsh < 5.7.1 (see #5765) -# COMPLETION_WAITING_DOTS="true" - -# Uncomment the following line if you want to disable marking untracked files -# under VCS as dirty. This makes repository status check for large repositories -# much, much faster. -# DISABLE_UNTRACKED_FILES_DIRTY="true" - -# Uncomment the following line if you want to change the command execution time -# stamp shown in the history command output. -# You can set one of the optional three formats: -# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd" -# or set a custom format using the strftime function format specifications, -# see 'man strftime' for details. -# HIST_STAMPS="mm/dd/yyyy" - -# Would you like to use another custom folder than $ZSH/custom? -# ZSH_CUSTOM=/path/to/new-custom-folder - -# Which plugins would you like to load? -# Standard plugins can be found in $ZSH/plugins/ -# Custom plugins may be added to $ZSH_CUSTOM/plugins/ -# Example format: plugins=(rails git textmate ruby lighthouse) -# Add wisely, as too many plugins slow down shell startup. +# List of plugins used plugins=() source $ZSH/oh-my-zsh.sh -# User configuration -# export MANPATH="/usr/local/man:$MANPATH" - -# You may need to manually set your language environment -# export LANG=en_US.UTF-8 - -# Preferred editor for local and remote sessions -# if [[ -n $SSH_CONNECTION ]]; then -# export EDITOR='vim' -# else -# export EDITOR='mvim' -# fi - -# Compilation flags -# export ARCHFLAGS="-arch x86_64" - -# Set personal aliases, overriding those provided by oh-my-zsh libs, -# plugins, and themes. Aliases can be placed here, though oh-my-zsh -# users are encouraged to define aliases within the ZSH_CUSTOM folder. -# For a full list of active aliases, run `alias`. - -# Example aliases -# alias zshconfig="mate ~/.zshrc" -# alias ohmyzsh="mate ~/.oh-my-zsh" - +# In case a command is not found, try to find the package that has it function command_not_found_handler { local purple='\e[1;35m' bright='\e[0;1m' green='\e[1;32m' reset='\e[0m' printf 'zsh: command not found: %s\n' "$1" @@ -117,37 +28,37 @@ function command_not_found_handler { return 127 } +# Detect the AUR wrapper +if pacman -Qi yay &>/dev/null ; then + aurhelper="yay" +elif pacman -Qi paru &>/dev/null ; then + aurhelper="paru" +fi + function in { local pkg="$1" if pacman -Si "$pkg" &>/dev/null ; then sudo pacman -S "$pkg" - elif pacman -Qi yay &>/dev/null ; then - yay -S "$pkg" - elif pacman -Qi paru &>/dev/null ; then - paru -S "$pkg" + else + "$aurhelper" -S "$pkg" fi } -alias l='eza -l --icons=auto' # long list -alias ls='eza -1 --icons=auto' # short list -alias ll='eza -la --icons=auto' # long list all -alias ld='eza -lD --icons=auto' # long list dirs -alias un='sudo pacman -Rns' # uninstall package -alias up='sudo pacman -Syu' # update system/package/aur -alias pl='pacman -Qs' # list installed package -alias pa='pacman -Ss' # list availabe package -alias pc='sudo pacman -Sc' # remove unused cache -alias po='pacman -Qtdq | sudo pacman -Rns -' # remove unused packages, also try > pacman -Qqd | pacman -Rsu --print - +# Helpful aliases +alias l='eza -lh --icons=auto' # long list +alias ls='eza -1 --icons=auto' # short list +alias ll='eza -lha --icons=auto --sort=name --group-directories-first' # long list all +alias ld='eza -lhD --icons=auto' # long list dirs +alias un='$aurhelper -Rns' # uninstall package +alias up='$aurhelper -Syu' # update system/package/aur +alias pl='$aurhelper -Qs' # list installed package +alias pa='$aurhelper -Ss' # list availabe package +alias pc='$aurhelper -Sc' # remove unused cache +alias po='$aurhelper -Qtdq | $aurhelper -Rns -' # remove unused packages, also try > $aurhelper -Qqd | $aurhelper -Rsu --print - alias vc='code' # gui code editor # To customize prompt, run `p10k configure` or edit ~/.p10k.zsh. [[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh -#Display specs -#neofetch - #Display Pokemon pokemon-colorscripts --no-title -r 1,3,6 - -#Display random gifs -#kitten icat --align left $(find $HOME/.config/neofetch/gifs/ -name "*.gif" | sort -R | head -1) diff --git a/Scripts/create_cache.sh b/Scripts/create_cache.sh index 813564bfde..70708f4897 100755 --- a/Scripts/create_cache.sh +++ b/Scripts/create_cache.sh @@ -54,6 +54,24 @@ while getopts "fc" option ; do done # magick function + +hex_conv() { + rgb_val=$(echo "$1" | sed 's/[-srgb()%]//g ; s/,/ /g') + red=$(echo "$rgb_val * 255 / 100" | awk '{printf "%d", $1}') + green=$(echo "$rgb_val * 255 / 100" | awk '{printf "%d", $2}') + blue=$(echo "$rgb_val * 255 / 100" | awk '{printf "%d", $3}') + printf "%02X%02X%02X\n" "$red" "$green" "$blue" +} + +dark_light () { + inCol="$1" + red=$(printf "%d" "0x${inCol:1:2}") + green=$(printf "%d" "0x${inCol:3:2}") + blue=$(printf "%d" "0x${inCol:5:2}") + brightness=$((red + green + blue)) + [ "$brightness" -lt 300 ] +} + imagick_t2 () { theme="$1" wpFullName="$2" @@ -71,13 +89,40 @@ imagick_t2 () { convert -strip -scale 10% -blur 0x3 -resize 100% "${wpFullName}" "${CacheDir}/${theme}/${wpBaseName}.blur" fi - if [ ! -f "${CacheDir}/${theme}/${wpBaseName}.dcol" ]; then - magick "${wpFullName}" -colors 4 -define histogram:unique-colors=true -format "%c" histogram:info: > "${CacheDir}/${theme}/${wpBaseName}.dcol" + if [ ! -f "${CacheDir}/${theme}/${wpBaseName}.dcol" ] ; then + dcol=(`magick "${wpFullName}" -colors 3 -define histogram:unique-colors=true -format "%c" histogram:info: | awk '{print substr($3,2,6)}' | awk '{printf "%d %s\n", "0x"$1, $0}' | sort -n | awk '{print $2}'`) + for (( i = 1; i < 3; i++ )) ; do + [ -z "${dcol[i]}" ] && dcol[i]=${dcol[i-1]} + done + for (( j = 0; j < 3; j++ )) ; do + r_swatch=$(echo "#${dcol[j]}" | sed 's/#//g') + echo "dcol_pry${j}=\"${r_swatch}\"" >> "${CacheDir}/${theme}/${wpBaseName}.dcol" + r_swatch=$(hex_conv `convert xc:"#${dcol[j]}" -negate -format "%c" histogram:info: | awk '{print $4}'`) + echo "dcol_txt${j}=\"${r_swatch}\"" >> "${CacheDir}/${theme}/${wpBaseName}.dcol" + z=0 + + if dark_light "#${dcol[j]}" ; then + for t in 30 50 70 90 ; do + z=$(( z + 1 )) + r_swatch=$(hex_conv `convert xc:"#${dcol[j]}" -modulate 200,"$(awk "BEGIN {print $t * 1.5}")" -channel RGB -evaluate multiply 1.$t -format "%c" histogram:info: | awk '{print $4}'`) + echo "dcol_${j}xa${z}=\"${r_swatch}\"" >> "${CacheDir}/${theme}/${wpBaseName}.dcol" + done + else + for t in 15 35 55 75 ; do + z=$(( z + 1 )) + r_swatch=$(hex_conv `convert xc:"#${dcol[j]}" -modulate 80,"$(awk "BEGIN {print $t * 1.5}")" -channel RGB -evaluate multiply 1.$t -format "%c" histogram:info: | awk '{print $4}'`) + echo "dcol_${j}xa${z}=\"${r_swatch}\"" >> "${CacheDir}/${theme}/${wpBaseName}.dcol" + done + fi + done fi } -# create thumbnails for each theme > wallpapers +export -f hex_conv +export -f dark_light export -f imagick_t2 + +# create thumbnails for each theme > wallpapers while read ctlLine do theme=$(echo $ctlLine | cut -d '|' -f 2) diff --git a/Scripts/custom_apps.lst b/Scripts/custom_apps.lst index b745817d8f..6b4ccfc200 100644 --- a/Scripts/custom_apps.lst +++ b/Scripts/custom_apps.lst @@ -1,6 +1,7 @@ #neovim #emote #trash-cli-git +downgrade steam gamemode #gamescope diff --git a/Scripts/restore_cfg.lst b/Scripts/restore_cfg.lst index 0e4e6113ba..2896e166f3 100644 --- a/Scripts/restore_cfg.lst +++ b/Scripts/restore_cfg.lst @@ -9,7 +9,7 @@ Y|${HOME}/.config|neofetch|neofetch Y|${HOME}/.config|qt5ct|qt5ct Y|${HOME}/.config|rofi|rofi Y|${HOME}/.config|swaylock|swaylock-effects -N|${HOME}/.config|swww|swww +Y|${HOME}/.config|swww|swww Y|${HOME}/.config|waybar|waybar Y|${HOME}/.config|wlogout|wlogout Y|${HOME}/.config|nwg-look gtk-3.0 xsettingsd|nwg-look diff --git a/Scripts/restore_cfg.sh b/Scripts/restore_cfg.sh index cf2bb1914c..5a805c94cb 100755 --- a/Scripts/restore_cfg.sh +++ b/Scripts/restore_cfg.sh @@ -10,7 +10,14 @@ if [ $? -ne 0 ] ; then exit 1 fi -CfgDir=`echo $CloneDir/Configs` +ThemeOverride="${1:-}" #override default config list with custom theme list [param 1] +CfgDir="${2:-${CloneDir}/Configs}" #override default config path with custom theme path [param 2] + +if [ ! -f "${ThemeOverride}restore_cfg.lst" ] || [ ! -d "${CfgDir}" ] ; then + echo "ERROR : '${ThemeOverride}restore_cfg.lst' or '${CfgDir}' does not exist..." + exit 1 +fi + BkpDir="${HOME}/.config/$(date +'cfg_%y%m%d_%Hh%Mm%Ss')" if [ -d $BkpDir ] ; then @@ -20,7 +27,7 @@ else mkdir -p $BkpDir fi -cat restore_cfg.lst | while read lst +cat "${ThemeOverride}restore_cfg.lst" | while read lst do bkpFlag=`echo $lst | awk -F '|' '{print $1}'` @@ -40,6 +47,7 @@ do echo "${cfg}" | xargs -n 1 | while read cfg_chk do tgt=`echo $pth | sed "s+^${HOME}++g"` + if [[ -z "$pth" ]]; then continue ; fi #Added this if cfg.lst have blank lines if ( [ -d $pth/$cfg_chk ] || [ -f $pth/$cfg_chk ] ) && [ "${bkpFlag}" == "Y" ] then @@ -65,7 +73,7 @@ done touch ${HOME}/.config/hypr/monitors.conf touch ${HOME}/.config/hypr/userprefs.conf -if nvidia_detect ; then +if nvidia_detect && [ $(grep '^source = ~/.config/hypr/nvidia.conf' ${HOME}/.config/hypr/hyprland.conf | wc -l) -eq 0 ] ; then cp ${CfgDir}/.config/hypr/nvidia.conf ${HOME}/.config/hypr/nvidia.conf echo -e 'source = ~/.config/hypr/nvidia.conf # auto sourced vars for nvidia\n' >> ${HOME}/.config/hypr/hyprland.conf fi @@ -73,3 +81,4 @@ fi ./create_cache.sh ./restore_zsh.sh ./restore_lnk.sh +