This commit is contained in:
Stephan Raabe 2024-05-27 16:15:06 +02:00
parent c375c92d6f
commit 498fd92a12
11 changed files with 151 additions and 57 deletions

View File

@ -51,10 +51,10 @@ if gum confirm "Do you want to install the prepared dotfiles now?" ;then
echo "Skipped: DEV MODE!" echo "Skipped: DEV MODE!"
fi fi
elif [ $? -eq 130 ]; then elif [ $? -eq 130 ]; then
echo ":: Installation cancelled" echo ":: Installation canceled"
exit 130 exit 130
else else
echo ":: Installation cancelled" echo ":: Installation canceled"
exit exit
fi fi
echo echo

View File

@ -6,37 +6,61 @@ echo -e "${GREEN}"
figlet "Keyboard" figlet "Keyboard"
echo -e "${NONE}" echo -e "${NONE}"
# Default layout and variants setkeyboard=0
keyboard_layout="us"
_setupKeyboardLayout() {
echo ""
echo "Start typing = Search, RETURN = Confirm, CTRL-C = Cancel"
keyboard_layout=$(localectl list-x11-keymap-layouts | gum filter --height 15 --placeholder "Find your keyboard layout...")
echo ""
echo ":: Keyboard layout changed to $keyboard_layout"
echo ""
_confirmKeyboard
}
_confirmKeyboard() {
echo "Current selected keyboard setup:"
echo "Keyboard layout: $keyboard_layout"
if gum confirm "Do you want proceed with this keyboard setup?" --affirmative "Proceed" --negative "Change" ;then
return 0
elif [ $? -eq 130 ]; then
exit 130
else
_setupKeyboardLayout
fi
}
if [ "$restored" == "1" ]; then if [ "$restored" == "1" ]; then
echo ":: You have already restored your settings into the new installation." echo ":: You have already restored your settings into the new installation."
else echo "You can repeat the keyboard setup again to choose between a desktop and laptop optimized configuration."
echo
if gum confirm "Do you want to setup your keyboard again?" ;then
setkeyboard=0
elif [ $? -eq 130 ]; then
echo ":: Installation canceled."
exit 130
else
echo ":: Keyboard setup skipped."
setkeyboard=1
fi
fi
if [ "$setkeyboard" == "0" ] ;then
# Default layout and variants
keyboard_layout="us"
_setupKeyboardLayout() {
echo
keyboard_layout=$(localectl list-x11-keymap-layouts | gum filter --height 15 --placeholder "Find your keyboard layout...")
echo
echo ":: Keyboard layout changed to $keyboard_layout"
echo
_confirmKeyboard
}
_confirmKeyboard() {
echo "Current selected keyboard setup:"
echo "Keyboard layout: $keyboard_layout"
echo
if gum confirm "Do you want proceed with this keyboard setup?" --affirmative "Proceed" --negative "Change" ;then
return 0
elif [ $? -eq 130 ]; then
exit 130
else
_setupKeyboardLayout
fi
}
_confirmKeyboard _confirmKeyboard
cp .install/templates/keyboard.conf ~/dotfiles-versions/$version/hypr/conf/keyboard.conf if gum confirm "Are you using a laptop and would you like to enable the laptop presets?"; then
cp .install/templates/keyboard-laptop.conf ~/dotfiles-versions/$version/hypr/conf/keyboard.conf
echo "source = ~/dotfiles/hypr/conf/layouts/laptop.conf" > ~/dotfiles-versions/$version/hypr/conf/layout.conf
elif [ $? -eq 130 ]; then
echo ":: Installation canceled."
exit 130
else
cp .install/templates/keyboard-default.conf ~/dotfiles-versions/$version/hypr/conf/keyboard.conf
fi
cp .install/templates/autostart.sh ~/dotfiles-versions/$version/qtile/autostart.sh cp .install/templates/autostart.sh ~/dotfiles-versions/$version/qtile/autostart.sh
SEARCH="KEYBOARD_LAYOUT" SEARCH="KEYBOARD_LAYOUT"
@ -47,7 +71,9 @@ else
REPLACE="$keyboard_layout" REPLACE="$keyboard_layout"
sed -i "s/$SEARCH/$REPLACE/g" ~/dotfiles-versions/$version/qtile/autostart.sh sed -i "s/$SEARCH/$REPLACE/g" ~/dotfiles-versions/$version/qtile/autostart.sh
echo "" echo
echo ":: Keyboard setup updated successfully." echo ":: Keyboard setup complete."
echo
echo "PLEASE NOTE: You can update your keyboard layout later in ~/dotfiles/hypr/conf/keyboard.conf" echo "PLEASE NOTE: You can update your keyboard layout later in ~/dotfiles/hypr/conf/keyboard.conf"
fi
fi

View File

@ -1,12 +1,5 @@
#!/bin/bash #!/bin/bash
# Remove blueman
if [[ $(_isInstalledPacman "blueman") == 0 ]]; then
sudo pacman --noconfirm -Rns blueman
echo ":: blueman removed"
echo
fi
# Remove Rofi Calc # Remove Rofi Calc
if [[ $(_isInstalledPacman "rofi-calc") == 0 ]]; then if [[ $(_isInstalledPacman "rofi-calc") == 0 ]]; then
sudo pacman --noconfirm -Rns rofi-calc sudo pacman --noconfirm -Rns rofi-calc

View File

@ -42,6 +42,10 @@ _showRestoreOptions() {
restorelist+="~/dotfiles/hypr/conf/environment.conf " restorelist+="~/dotfiles/hypr/conf/environment.conf "
selectedlist+="~/dotfiles/hypr/conf/environment.conf," selectedlist+="~/dotfiles/hypr/conf/environment.conf,"
fi fi
if [ -f ~/dotfiles/hypr/conf/layout.conf ] && [ -d ~/dotfiles/hypr/conf/layouts/ ]; then
restorelist+="~/dotfiles/hypr/conf/layout.conf "
selectedlist+="~/dotfiles/hypr/conf/layout.conf,"
fi
if [ -f ~/dotfiles/hypr/conf/windowrule.conf ] && [ -d ~/dotfiles/hypr/conf/windowrules/ ]; then if [ -f ~/dotfiles/hypr/conf/windowrule.conf ] && [ -d ~/dotfiles/hypr/conf/windowrules/ ]; then
restorelist+="~/dotfiles/hypr/conf/windowrule.conf " restorelist+="~/dotfiles/hypr/conf/windowrule.conf "
selectedlist+="~/dotfiles/hypr/conf/windowrule.conf," selectedlist+="~/dotfiles/hypr/conf/windowrule.conf,"
@ -150,6 +154,12 @@ _startRestore() {
echo ":: Hyprland environment.conf restored!" echo ":: Hyprland environment.conf restored!"
fi fi
fi fi
if [[ $restoreselect == *"~/dotfiles/hypr/conf/layout.conf"* ]] || [[ $restoreselect == *"All"* ]] ; then
if [ -f ~/dotfiles/hypr/conf/layout.conf ]; then
cp ~/dotfiles/hypr/conf/layout.conf ~/dotfiles-versions/$version/hypr/conf/
echo ":: Hyprland layout.conf restored!"
fi
fi
if [[ $restoreselect == *"~/dotfiles/hypr/conf/windowrule.conf"* ]] || [[ $restoreselect == *"All"* ]] ; then if [[ $restoreselect == *"~/dotfiles/hypr/conf/windowrule.conf"* ]] || [[ $restoreselect == *"All"* ]] ; then
if [ -f ~/dotfiles/hypr/conf/windowrule.conf ]; then if [ -f ~/dotfiles/hypr/conf/windowrule.conf ]; then
cp ~/dotfiles/hypr/conf/windowrule.conf ~/dotfiles-versions/$version/hypr/conf/ cp ~/dotfiles/hypr/conf/windowrule.conf ~/dotfiles-versions/$version/hypr/conf/

View File

@ -18,7 +18,13 @@ input {
follow_mouse = 1 follow_mouse = 1
touchpad { touchpad {
# for desktop
natural_scroll = false natural_scroll = false
# for laptop
# natural_scroll = yes
# middle_button_emulation = true
# clickfinger_behavior = 1
} }
sensitivity = 0 # -1.0 - 1.0, 0 means no modification. sensitivity = 0 # -1.0 - 1.0, 0 means no modification.
} }

View File

@ -0,0 +1,30 @@
# -----------------------------------------------------
# Keyboard Layout
# https://wiki.hyprland.org/Configuring/Variables/#input
# -----------------------------------------------------
input {
kb_layout = KEYBOARD_LAYOUT
kb_variant =
kb_model =
kb_options =
numlock_by_default = true
mouse_refocus=false
# For United States
# kb_layout = us
# kb_variant = intl
# kb_model = pc105
# kb_options =
follow_mouse = 1
touchpad {
# for desktop
# natural_scroll = false
# for laptop
natural_scroll = yes
middle_button_emulation = true
clickfinger_behavior = 1
}
sensitivity = 0 # -1.0 - 1.0, 0 means no modification.
}

View File

@ -1,16 +1 @@
# ----------------------------------------------------- source = ~/dotfiles/hypr/conf/layouts/default.conf
# Layouts
# -----------------------------------------------------
dwindle {
pseudotile = true
preserve_split = true
}
master {
new_is_master = true
}
gestures {
workspace_swipe = false
}

View File

@ -0,0 +1,16 @@
# -----------------------------------------------------
# Layouts
# -----------------------------------------------------
dwindle {
pseudotile = true
preserve_split = true
}
master {
new_is_master = true
}
gestures {
workspace_swipe = false
}

View File

@ -0,0 +1,16 @@
# -----------------------------------------------------
# Layouts
# -----------------------------------------------------
dwindle {
pseudotile = true
preserve_split = true
}
master {
new_is_master = true
}
gestures {
workspace_swipe = true
}

View File

@ -64,8 +64,8 @@ source .install/wallpaper.sh
source .install/displaymanager.sh source .install/displaymanager.sh
source .install/issue.sh source .install/issue.sh
source .install/restore.sh source .install/restore.sh
source .install/neovim.sh
source .install/keyboard.sh source .install/keyboard.sh
source .install/neovim.sh
source .install/hook.sh source .install/hook.sh
source .install/vm.sh source .install/vm.sh
source .install/copy.sh source .install/copy.sh

12
scripts/lid-improvements.sh Executable file
View File

@ -0,0 +1,12 @@
#!/bin/bash
while IFS= read -r line; do
# If the line starts with # and the next line is not the lines to be added
if [[ $line == \#HandleLidSwitchDocked=ignore ]]; then
# Add the new lines
echo "HandleLidSwitchDocked=ignore" | sudo tee -a /etc/systemd/logind.conf > /dev/null
fi
if [[ $line == \#HoldoffTimeoutSec=5s ]]; then
# Add the new lines
echo "HoldoffTimeoutSec=5s" | sudo tee -a /etc/systemd/logind.conf > /dev/null
fi
done < /etc/systemd/logind.conf