Added customization from prasanthrangan/hyprdots

This commit is contained in:
Trianta
2024-01-24 23:23:07 -06:00
parent f1f95d8728
commit d13f6b7f2d
10 changed files with 417 additions and 165 deletions
+60
View File
@@ -0,0 +1,60 @@
#!/usr/bin/env sh
# wallpaper var
EnableWallDcol=0
ConfDir="${XDG_CONFIG_HOME:-$HOME/.config}"
CloneDir="$HOME/Hyprdots"
ThemeCtl="$ConfDir/hypr/theme.ctl"
cacheDir="$HOME/.cache/hyprdots"
# theme var
gtkTheme=`gsettings get org.gnome.desktop.interface gtk-theme | sed "s/'//g"`
gtkMode=`gsettings get org.gnome.desktop.interface color-scheme | sed "s/'//g" | awk -F '-' '{print $2}'`
# hypr var
hypr_border=`hyprctl -j getoption decoration:rounding | jq '.int'`
hypr_width=`hyprctl -j getoption general:border_size | jq '.int'`
# notification var
#ncolor="-h string:bgcolor:#191724 -h string:fgcolor:#faf4ed -h string:frcolor:#56526e"
#
#if [ "${gtkMode}" == "light" ] ; then
# ncolor="-h string:bgcolor:#f4ede8 -h string:fgcolor:#9893a5 -h string:frcolor:#908caa"
#fi
# pacman fns
pkg_installed()
{
local PkgIn=$1
if pacman -Qi $PkgIn &> /dev/null
then
#echo "${PkgIn} is already installed..."
return 0
else
#echo "${PkgIn} is not installed..."
return 1
fi
}
get_aurhlpr()
{
if pkg_installed yay
then
aurhlpr="yay"
elif pkg_installed paru
then
aurhlpr="paru"
fi
}
check(){
local Pkg_Dep=$(for PkgIn in "$@"; do ! pkg_installed $PkgIn && echo "$PkgIn"; done)
if [ -n "$Pkg_Dep" ]; then echo -e "$0 Dependencies:\n$Pkg_Dep"
read -p "ENTER to install (Other key: Cancel): " ans
if [ -z "$ans" ]; then get_aurhlpr ; $aurhlpr -S $Pkg_Dep
else echo "Skipping installation of packages" ;exit 1
fi
fi
}
+61
View File
@@ -0,0 +1,61 @@
#!/usr/bin/env sh
# Check if wlogout is already running
if pgrep -x "wlogout" > /dev/null
then
pkill -x "wlogout"
exit 0
fi
# set file variables
ScrDir=`dirname "$(realpath "$0")"`
source $ScrDir/globalcontrol.sh
wLayout="${XDG_CONFIG_HOME:-$HOME/.config}/wlogout/layout_$1"
wlTmplt="${XDG_CONFIG_HOME:-$HOME/.config}/wlogout/style_$1.css"
if [ ! -f $wLayout ] || [ ! -f $wlTmplt ] ; then
echo "ERROR: Config $1 not found..."
exit 1;
fi
# detect monitor res
x_mon=$(hyprctl -j monitors | jq '.[] | select(.focused==true) | .width')
y_mon=$(hyprctl -j monitors | jq '.[] | select(.focused==true) | .height')
hypr_scale=$(hyprctl -j monitors | jq '.[] | select (.focused == true) | .scale' | sed 's/\.//')
# scale config layout and style
case $1 in
1) wlColms=6
export mgn=$(( y_mon * 28 / hypr_scale ))
export hvr=$(( y_mon * 23 / hypr_scale )) ;;
2) wlColms=2
export x_mgn=$(( x_mon * 35 / hypr_scale ))
export y_mgn=$(( y_mon * 25 / hypr_scale ))
export x_hvr=$(( x_mon * 32 / hypr_scale ))
export y_hvr=$(( y_mon * 20 / hypr_scale )) ;;
esac
# scale font size
export fntSize=$(( y_mon * 2 / 100 ))
# detect gtk system theme
export BtnCol=`[ "$gtkMode" == "dark" ] && ( echo "white" ) || ( echo "black" )`
export WindBg=`[ "$gtkMode" == "dark" ] && ( echo "rgba(0,0,0,0.5)" ) || ( echo "rgba(255,255,255,0.5)" )`
if [ "$EnableWallDcol" -eq 1 ] ; then
export wbarTheme="Wall-Dcol"
else
export wbarTheme="${gtkTheme}"
fi
# eval hypr border radius
export active_rad=$(( hypr_border * 5 ))
export button_rad=$(( hypr_border * 8 ))
# eval config files
wlStyle=`envsubst < $wlTmplt`
# launch wlogout
wlogout -b $wlColms -c 0 -r 0 -m 0 --layout $wLayout --css <(echo "$wlStyle") --protocol layer-shell
+12
View File
@@ -0,0 +1,12 @@
#!/bin/bash
sleep 1
killall xdg-desktop-portal-hyprland
killall xdg-desktop-portal-gnome
killall xdg-desktop-portal-kde
killall xdg-desktop-portal-lxqt
killall xdg-desktop-portal-wlr
killall xdg-desktop-portal
sleep 1
/usr/lib/xdg-desktop-portal-hyprland &
sleep 2
/usr/lib/xdg-desktop-portal &