diff --git a/install.sh b/install.sh index c2f11be..0f5805c 100755 --- a/install.sh +++ b/install.sh @@ -33,6 +33,28 @@ source-script() { 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() { depends=( stow @@ -251,13 +273,15 @@ __dep__() { } __monitors__() { - if [ ! -e "$HOME/.monitors.conf" ]; then - res="$(hyprctl monitors | grep -oP '\d+x\d+@\d+\.\d+' | head -n 1)" - touch "$HOME/.monitors.conf" - if [[ -n $res ]]; then - echo "monitor = eDP-1, ${res}, 0x0, 1" >>"$HOME/.monitors.conf" - else - echo "monitor = preferred,, 0x0, 1" >>"$HOME/.monitors.conf" + if ! check-powerstation; then + if [ ! -e "$HOME/.monitors.conf" ]; then + res="$(hyprctl monitors | grep -oP '\d+x\d+@\d+\.\d+' | head -n 1)" + touch "$HOME/.monitors.conf" + if [[ -n $res ]]; then + echo "monitor = eDP-1, ${res}, 0x0, 1" >>"$HOME/.monitors.conf" + else + echo "monitor = preferred,, 0x0, 1" >>"$HOME/.monitors.conf" + fi fi fi } @@ -267,6 +291,7 @@ pkg_optional() { "cowsay" "cmatrix" "trash-cli" + "duf" ) for pkg in "${_opts[@]}"; do @@ -329,9 +354,9 @@ c_fonts() { } c_wallpapers() { - local dirWallpaper="$HOME/.wallpapers" + local dirWallpaper="$HOME/.wallpaper" 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)?"