Skip to content

Commit

Permalink
Merge branch 'main' into clock_calendar
Browse files Browse the repository at this point in the history
  • Loading branch information
RAprogramm authored Nov 19, 2023
2 parents 0f1840e + 9db633e commit 032f651
Show file tree
Hide file tree
Showing 59 changed files with 703 additions and 304 deletions.
12 changes: 6 additions & 6 deletions Configs/.config/dunst/dunstrc
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 6 additions & 2 deletions Configs/.config/hypr/scripts/spotifyvolumecontrol.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
101 changes: 79 additions & 22 deletions Configs/.config/hypr/scripts/swwwallbash.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,52 +6,109 @@ 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!"
exit 1
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}>/${dcol[i]}/g" "${target}"
done

if [ ! -z "${appexe}" ]; then
sed -i "s/<wallbash_pry0>/${dcol_pry0}/g
s/<wallbash_txt0>/${dcol_txt0}/g
s/<wallbash_0xa1>/${dcol_0xa1}/g
s/<wallbash_0xa2>/${dcol_0xa2}/g
s/<wallbash_0xa3>/${dcol_0xa3}/g
s/<wallbash_0xa4>/${dcol_0xa4}/g
s/<wallbash_pry1>/${dcol_pry1}/g
s/<wallbash_txt1>/${dcol_txt1}/g
s/<wallbash_1xa1>/${dcol_1xa1}/g
s/<wallbash_1xa2>/${dcol_1xa2}/g
s/<wallbash_1xa3>/${dcol_1xa3}/g
s/<wallbash_1xa4>/${dcol_1xa4}/g
s/<wallbash_pry2>/${dcol_pry2}/g
s/<wallbash_txt2>/${dcol_txt2}/g
s/<wallbash_2xa1>/${dcol_2xa1}/g
s/<wallbash_2xa2>/${dcol_2xa2}/g
s/<wallbash_2xa3>/${dcol_2xa3}/g
s/<wallbash_2xa4>/${dcol_2xa4}/g" "${target}"

if [ ! -z "${appexe}" ] ; then
"${appexe}"
fi
}

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}


17 changes: 9 additions & 8 deletions Configs/.config/hypr/scripts/swwwallpaper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
12 changes: 6 additions & 6 deletions Configs/.config/hypr/scripts/themeswitch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -119,5 +119,5 @@ hyprctl reload


# rofi & waybar
${ScrDir}/swwwallbash.sh $getWall
${ScrDir}/swwwallbash.sh "$getWall"

2 changes: 1 addition & 1 deletion Configs/.config/hypr/scripts/wallbashspotify.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

4 changes: 2 additions & 2 deletions Configs/.config/hypr/scripts/wallbashtoggle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion Configs/.config/hypr/scripts/wallbashypr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions Configs/.config/hypr/themes/Wall-Dcol.conf
Original file line number Diff line number Diff line change
@@ -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
}
14 changes: 7 additions & 7 deletions Configs/.config/hypr/wallbash/dunst.dcol
Original file line number Diff line number Diff line change
@@ -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 = "<dcol_3>"
foreground = "<dcol_1>"
frame_color = "<dcol_2>"
background = "#<wallbash_0xa1>"
foreground = "#<wallbash_txt0>"
frame_color = "#<wallbash_0xa4>"
icon = "~/.config/dunst/icons/hyprdots.svg"
timeout = 10

[urgency_normal]
background = "<dcol_0>"
foreground = "<dcol_3>"
frame_color = "<dcol_2>"
background = "#<wallbash_1xa4>"
foreground = "#<wallbash_txt0>"
frame_color = "#<wallbash_2xa4>"
icon = "~/.config/dunst/icons/hyprdots.svg"
timeout = 10
14 changes: 7 additions & 7 deletions Configs/.config/hypr/wallbash/hypr.dcol
Original file line number Diff line number Diff line change
@@ -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(<dcol_0>ff) rgba(<dcol_2>ff) 45deg
col.inactive_border = rgba(<dcol_1>cc) rgba(<dcol_3>cc) 45deg
col.active_border = rgba(<wallbash_pry2>ff) rgba(<wallbash_pry0>ff) 45deg
col.inactive_border = rgba(<wallbash_2xa1>ff) rgba(<wallbash_2xa4>ff) 45deg
}

group {
col.border_active = rgba(<dcol_0>ff) rgba(<dcol_2>ff) 45deg
col.border_inactive = rgba(<dcol_1>cc) rgba(<dcol_3>cc) 45deg
col.border_locked_active = rgba(<dcol_0>ff) rgba(<dcol_2>ff) 45deg
col.border_locked_inactive = rgba(<dcol_1>cc) rgba(<dcol_3>cc) 45deg
col.border_active = rgba(<wallbash_2xa1>ff) rgba(<wallbash_2xa4>ff) 45deg
col.border_inactive = rgba(<wallbash_0xa1>cc) rgba(<wallbash_0xa4>cc) 45deg
col.border_locked_active = rgba(<wallbash_2xa2>ff) rgba(<wallbash_2xa3>ff) 45deg
col.border_locked_inactive = rgba(<wallbash_0xa2>cc) rgba(<wallbash_0xa3>cc) 45deg
}
16 changes: 8 additions & 8 deletions Configs/.config/hypr/wallbash/icons/hyprdots.dcol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
4|~/.config/dunst/icons/hyprdots.svg
$HOME/.config/dunst/icons/hyprdots.svg
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="300"
Expand Down Expand Up @@ -132,30 +132,30 @@
inkscape:groupmode="layer"
id="layer1">
<circle
style="display:inline;opacity:1;fill:<dcol_3>;fill-opacity:1;stroke:none;stroke-width:2.64583;stroke-dasharray:none;stroke-opacity:1"
style="display:inline;opacity:1;fill:#<wallbash_pry2>;fill-opacity:1;stroke:none;stroke-width:2.64583;stroke-dasharray:none;stroke-opacity:1"
id="path1"
cx="39.997181"
cy="39.029049"
r="25.959431"
inkscape:label="base"
sodipodi:insensitive="true" />
<circle
style="display:inline;opacity:1;fill:<dcol_3>;fill-opacity:1;stroke:<dcol_0>;stroke-width:1.32292;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1"
style="display:inline;opacity:1;fill:#<wallbash_pry2>;fill-opacity:1;stroke:#<wallbash_pry0>;stroke-width:1.32292;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1"
id="path23"
cx="59.239162"
cy="65.282417"
r="3.9791903"
inkscape:label="dots" />
<path
style="display:inline;opacity:1;fill:<dcol_2>;fill-opacity:1;stroke:none;stroke-width:2.64583;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1"
style="display:inline;opacity:1;fill:#<wallbash_pry1>;fill-opacity:1;stroke:none;stroke-width:2.64583;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1"
d="M 14.113556,8.1829745 56.98133,12.94242 37.386776,66.72921 7.3373035,66.366241 Z"
id="path4"
sodipodi:nodetypes="ccccc"
inkscape:label="rose_pine"
clip-path="url(#clipPath4)"
sodipodi:insensitive="true" />
<path
style="display:inline;opacity:1;fill:<dcol_1>;fill-opacity:1;stroke:none;stroke-width:2.64583;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1"
style="display:inline;opacity:1;fill:#<wallbash_1xa4>;fill-opacity:1;stroke:none;stroke-width:2.64583;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1"
d="m 38.53683,10.093324 c -4.365942,9.204371 -6.195104,15.177206 -7.207595,27.726667 -0.991944,12.294793 2.307273,27.137042 4.047673,28.491534 L 8.1586184,69.098661 11.655182,10.116831 Z"
id="path8"
inkscape:label="decay_ce"
Expand All @@ -164,7 +164,7 @@
transform="translate(0.76197263)"
sodipodi:insensitive="true" />
<path
style="display:inline;opacity:1;fill:<dcol_0>;fill-opacity:1;stroke:none;stroke-width:2.64583;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1"
style="display:inline;opacity:1;fill:#<wallbash_pry0>;fill-opacity:1;stroke:none;stroke-width:2.64583;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1"
d="m 42.192726,12.318411 c -4.211383,1.986898 -14.038715,6.1886 -14.817953,16.984439 -1.04881,14.530574 8.416642,27.085895 14.90106,33.18835 l -22.176874,3.329798 -0.9709,-51.470147 z"
id="path12"
inkscape:label="tokyo_night"
Expand All @@ -173,7 +173,7 @@
transform="matrix(1.1365005,0,0,1.1365005,-11.015826,-4.4408595)"
sodipodi:insensitive="true" />
<path
style="display:inline;fill:none;stroke:<dcol_3>;stroke-width:5.29167;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1"
style="display:inline;fill:none;stroke:#<wallbash_pry2>;stroke-width:5.29167;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1"
d="M 56.155019,14.892653 37.161315,67.306549 c 0.34522,-0.825973 6.533363,-17.660613 9.643704,-21.103821 4.780254,-5.291832 13.007552,-2.764636 13.142556,4.977296 0.04382,2.512914 -1.431223,15.998469 -1.431223,15.998469"
id="path2"
sodipodi:nodetypes="ccssc"
Expand All @@ -182,7 +182,7 @@
mask="none"
sodipodi:insensitive="true" />
<circle
style="display:inline;opacity:1;fill:none;fill-opacity:1;stroke:<dcol_3>;stroke-width:1.32292;stroke-dasharray:none;stroke-opacity:1"
style="display:inline;opacity:1;fill:none;fill-opacity:1;stroke:#<wallbash_pry2>;stroke-width:1.32292;stroke-dasharray:none;stroke-opacity:1"
id="circle8"
cx="39.997181"
cy="39.029049"
Expand Down
Loading

0 comments on commit 032f651

Please sign in to comment.