From 19282115eb6562df509b2cc00f5e269685a43ab8 Mon Sep 17 00:00:00 2001 From: Warren Hood Date: Wed, 6 Dec 2023 00:32:14 +0200 Subject: [PATCH] Added screenshotting, window cycling etc to hyprland configs --- hyprland/.config/hypr/hyprland.conf | 22 ++++++++++++++++++---- setup | 25 +++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 4 deletions(-) diff --git a/hyprland/.config/hypr/hyprland.conf b/hyprland/.config/hypr/hyprland.conf index b4a3089..b113baf 100644 --- a/hyprland/.config/hypr/hyprland.conf +++ b/hyprland/.config/hypr/hyprland.conf @@ -34,7 +34,7 @@ input { kb_options = kb_rules = - follow_mouse = 1 + follow_mouse = 0 touchpad { natural_scroll = false @@ -133,7 +133,7 @@ $mainMod = SUPER # Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more bind = $mainMod, RETURN, exec, $terminal bind = $mainMod SHIFT, C, killactive, -bind = $mainMod, M, exit, +bind = $mainMod SHIFT, Q, exit, bind = $mainMod, E, exec, $fileManager bind = $mainMod CTRL, SPACE, togglefloating, bind = $mainMod, R, exec, $menu @@ -146,6 +146,11 @@ bind = $mainMod, L, movefocus, r bind = $mainMod, K, movefocus, u bind = $mainMod, J, movefocus, d +# Toggle fullscreen +bind = $mainMod, M, fullscreen +# Fake (internal) fullscreen +bind = $mainMod SHIFT, M, fakefullscreen + # Switch workspaces with mainMod + [0-9] bind = $mainMod, 1, workspace, 1 bind = $mainMod, 2, workspace, 2 @@ -175,8 +180,8 @@ bind = $mainMod, S, togglespecialworkspace, magic bind = $mainMod SHIFT, S, movetoworkspace, special:magic # Scroll through existing workspaces with mainMod + scroll -bind = $mainMod, LEFT, workspace, e+1 -bind = $mainMod, RIGHT, workspace, e-1 +bind = $mainMod, RIGHT, workspace, e+1 +bind = $mainMod, LEFT, workspace, e-1 # Move/resize windows with mainMod + LMB/RMB and dragging bindm = $mainMod, mouse:272, movewindow @@ -184,3 +189,12 @@ bindm = $mainMod, mouse:273, resizewindow # Open up browser bind = $mainMod, B, exec, $browser + +# Screenshots with grim, slurp and swappy +bind = $mainMod SHIFT, S, exec, grim -g "$(slurp)" - | swappy -f - + +# Cycle between windows +bind = ALT, TAB, cyclenext +bind = ALT, TAB, bringactivetotop +bind = ALT SHIFT, TAB, cyclenext, prev +bind = ALT SHIFT, TAB, bringactivetotop diff --git a/setup b/setup index d29aa0d..15372d9 100755 --- a/setup +++ b/setup @@ -5,11 +5,33 @@ echo "Setting up the stuff..." git submodule init git submodule update +! command -v git &> /dev/null && echo "Ensure git is install before running this" && exit -1 + +[[ ! -d ~/git ]] && echo "Creating git directory in $HOME" && mkdir ~/git # Wayland + Hyprland seems cool setup_hyprland_arch() { echo "Setting up Hyprland..." sudo pacman -S wayland hyprland waybar dmenu dunst pipewire wireplumber xdg-desktop-portal-hyprland polkit-kde-agent qt5-wayland qt6-wayland + + # grim + slurp + swappy for screenshots + sudo pacman -S grim slurp swappy wl-clipboard +} + + +# Setup paru +setup_paru() { + if ! command -v paru &> /dev/null; then + echo "Setting up paru..." + pushd ~/git + sudo pacman -S --needed base-devel + git clone https://aur.archlinux.org/paru.git + cd paru + makepkg -si + popd + else + echo "paru is already installed" + fi } @@ -39,6 +61,9 @@ else # sudo pacman -S thermald # sudo systemctl enable --now thermald # sudo thermald --systemd + + # Install paru + setup_paru # Install wayland + hyprland setup_hyprland_arch