This commit is contained in:
pika 2025-06-22 17:54:29 +02:00
parent e8026812a1
commit 70ed10f484

View file

@ -33,6 +33,28 @@ source-script() {
fi fi
} }
check-powerstation() {
local hn="$(hostname)"
write-config() {
echo "\$main = DP-1" >>"$HOME/.monitors.conf"
echo "\$secondary = HDMI-A-1" >>"$HOME/.monitors.conf"
echo "monitor = \$main, 3440x1440@165, 0x0, 1" >>"$HOME/.monitors.conf"
echo "monitor = \$secondary, 2560x1440@95, 1600x-1440, 1" >>"$HOME/.monitors.conf"
}
if [ "$hn" == 'cl-powerstation' ]; then
if [ -e "$HOME/.monitors.conf" ]; then
if ! grep -qi '3550x1440@165' <<<"$(cat $HOME/.monitors.conf)"; then
write-config
fi
else
write-config
fi
else
return 69
fi
}
get-dependencies() { get-dependencies() {
depends=( depends=(
stow stow
@ -251,13 +273,15 @@ __dep__() {
} }
__monitors__() { __monitors__() {
if [ ! -e "$HOME/.monitors.conf" ]; then if ! check-powerstation; then
res="$(hyprctl monitors | grep -oP '\d+x\d+@\d+\.\d+' | head -n 1)" if [ ! -e "$HOME/.monitors.conf" ]; then
touch "$HOME/.monitors.conf" res="$(hyprctl monitors | grep -oP '\d+x\d+@\d+\.\d+' | head -n 1)"
if [[ -n $res ]]; then touch "$HOME/.monitors.conf"
echo "monitor = eDP-1, ${res}, 0x0, 1" >>"$HOME/.monitors.conf" if [[ -n $res ]]; then
else echo "monitor = eDP-1, ${res}, 0x0, 1" >>"$HOME/.monitors.conf"
echo "monitor = preferred,, 0x0, 1" >>"$HOME/.monitors.conf" else
echo "monitor = preferred,, 0x0, 1" >>"$HOME/.monitors.conf"
fi
fi fi
fi fi
} }
@ -267,6 +291,7 @@ pkg_optional() {
"cowsay" "cowsay"
"cmatrix" "cmatrix"
"trash-cli" "trash-cli"
"duf"
) )
for pkg in "${_opts[@]}"; do for pkg in "${_opts[@]}"; do
@ -329,9 +354,9 @@ c_fonts() {
} }
c_wallpapers() { c_wallpapers() {
local dirWallpaper="$HOME/.wallpapers" local dirWallpaper="$HOME/.wallpaper"
if [[ ! -d "$dirWallpaper" ]]; then if [[ ! -d "$dirWallpaper" ]]; then
if confirm "Seems like you may miss some wallpapers.. Do you want to clone them now to $(pen blue bold $HOME/.wallpapers)?" </dev/tty; then if confirm "Seems like you may miss some wallpaper.. Do you want to clone them now to $(pen blue bold $HOME/.wallpaper)?" </dev/tty; then
if ! command_exists git; then if ! command_exists git; then
spin "Installing dependencies.." spin "Installing dependencies.."