Add Hyprland stuff

This commit is contained in:
2023-11-27 23:31:36 +01:00
parent 06b642ae28
commit 5017ee7099
9 changed files with 143 additions and 123 deletions

View File

@ -24,7 +24,7 @@ network_print() {
signal=$(nmcli -t -f in-use,signal device wifi list ifname "$device" | grep "\*" | cut -d ':' -f 2)
if [ "$signal" -lt 40 ]; then
description="$description - %{F#f9cc18}$signal%%{F-}"
description="$description - $signal"
fi
elif [ "$type" = "802-3-ethernet" ]; then
icon=""
@ -53,9 +53,9 @@ network_print() {
fi
if [ $counter -gt 0 ]; then
printf " %s %s" "$icon" "$description"
printf "%s %s" "$icon" "$description"
else
printf "%s %s" "$icon" "$description"
printf "%s %s" "$icon" "$description"
fi
counter=$((counter + 1))

View File

@ -14,19 +14,23 @@ exec-once = dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CUR
# Execute your favorite apps at launch
# exec-once = waybar & hyprpaper & firefox
exec-once = battery_status &
exec-once = swayidle &
exec-once = xiccd &
exec-once = dunst &
exec-once = ibus-daemon -drxR &
exec-once = sleep 3 && kanshi &
exec-once = bash ~/.config/hypr/scripts/launch_waybar.sh
exec-once = bash ~/.config/hypr/scripts/launch_waybar.sh &
exec-once = easyeffects --gapplication-service &
exec-once = lxqt-policykit-agent &
exec-once = thunar --daemon &
exec-once = copyq --start-server
exec-once = env QT_QPA_PLATFORM=xcb /usr/lib/kdeconnectd
exec-once = env QT_QPA_PLATFORM=xcb kdeconnect-indicator
exec-once = env QT_QPA_PLATFORM=xcb /usr/lib/kdeconnectd &
exec-once = env QT_QPA_PLATFORM=xcb kdeconnect-indicator &
monitor = eDP-1,pref,auto,auto
# On reload:
exec = pkill -1 kanshi
@ -114,7 +118,7 @@ device:epic-mouse-v1 {
sensitivity = -0.5
}
misc {
misc {
focus_on_activate = true
}
@ -124,6 +128,12 @@ misc {
# windowrulev2 = float,class:^(kitty)$,title:^(kitty)$
# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more
windowrulev2 = float,class:^(thunderbird)$,title:.*Reminders?
windowrulev2 = workspace, 4,title:^(Spotify)$
windowrulev2 = workspace, 4,class:^(org.keepassxc.KeepassXC)$
windowrulev2 = workspace, 5,title:^(Discord).*$
windowrulev2 = workspace, 8,class:^(thunderbird)$
# See https://wiki.hyprland.org/Configuring/Keywords/ for more
$mainMod = SUPER
@ -132,6 +142,7 @@ $mainMod = SUPER
# bind = $mainMod, Q, exec, kitty
bind = $mainMod SHIFT, Q, killactive,
bind = $mainMod, RETURN, exec, alacritty
bind = $mainMod, E, exec, thunar
bind = $mainMod CONTROL, L, exec, loginctl lock-session self
bindr = $mainMod, D, exec, dunstctl context
bind = $mainMod, F, fullscreen
@ -141,7 +152,7 @@ binde = , XF86AudioRaiseVolume, exec, pactl set-sink-volume @DEFAULT_SINK@ +100
binde = , XF86AudioLowerVolume, exec, pactl set-sink-volume @DEFAULT_SINK@ -100
binde = SHIFT, XF86AudioRaiseVolume, exec, pactl set-sink-volume @DEFAULT_SINK@ +1000
binde = SHIFT, XF86AudioLowerVolume, exec, pactl set-sink-volume @DEFAULT_SINK@ -1000
bind = , XF86AudioMute, exec, pactl set-sink-mute @DEFAULT_SINK@ toggle
bindr = , XF86AudioMute, exec, pactl set-sink-mute @DEFAULT_SINK@ toggle
# Microphone control
bind = , XF86AudioMicMute, exec, pactl set-source-mute @DEFAULT_SOURCE@ toggle
@ -152,7 +163,6 @@ binde = , XF86MonBrightnessUp, exec, brightnessctl s +2%
binde = , XF86MonBrightnessDown, exec, brightnessctl s 2%-
binde = SHIFT , XF86MonBrightnessUp, exec, brightnessctl s +10%
binde = SHIFT , XF86MonBrightnessDown, exec, brightnessctl s 10%-
bind = , XF86AudioMute, exec, pactl set-sink-mute @DEFAULT_SINK@ toggle
# Flameshot
bindr = CONTROL SHIFT, Print, exec, ~/.config/hypr/scripts/screenshot.sh
@ -170,7 +180,7 @@ bind = ALT, SPACE, exec, rofi -show drun
bind = $mainMod, TAB, exec, rofi -show window
bind = $mainMod SHIFT, N, exec, networkmanager_dmenu --rofi -i
bind = $mainMod SHIFT, B, exec, rofi-bluetooth
bind = $mainMod , E, exec, rofimoji --typer wtype
bind = $mainMod SHIFT , E, exec, rofimoji --typer wtype
bind = $mainMod CONTROL, SPACE, togglefloating,
bind = $mainMod, SPACE, layoutmsg, orientationnext
@ -214,8 +224,8 @@ bind = $mainMod SHIFT, 9, movetoworkspace, 9
bind = $mainMod SHIFT, 0, movetoworkspace, 10
# Scroll through existing workspaces with mainMod + scroll
bind = $mainMod, mouse_down, workspace, e+1
bind = $mainMod, mouse_up, workspace, e-1
bind = $mainMod, mouse_down, workspace, m+1
bind = $mainMod, mouse_up, workspace, m-1
# Move/resize windows with mainMod + LMB/RMB and dragging
bindm = $mainMod, mouse:272, movewindow

View File

@ -3,9 +3,16 @@
getDisplay () {
local DESK
# DOCK
DESK="$(~/.config/hypr/scripts/displaybyname.sh Samsung Electric Company S34J55x H4LT100404)"
[[ -n "$DESK" ]] && echo $DESK && return
# FSI
DESK="$(~/.config/hypr/scripts/displaybyname.sh LG Electronics 24EB23 609NTFAF4483)"
[[ -n "$DESK" ]] && echo $DESK && return
# Technofabrik
DESK="$(~/.config/hypr/scripts/displaybyname.sh Dell Inc. DELL U2713HM GK0KD27S476L)"
[[ -n "$DESK" ]] && echo $DESK && return
# Fallback
echo "eDP-1"
}
@ -17,4 +24,4 @@ export PRIMARY_DISPLAY
envsubst < ~/.config/waybar/config > /tmp/waybar
pkill waybar
waybar -c /tmp/waybar &!
waybar -c /tmp/waybar $@ &!

33
hyprland/scripts/workspaces.sh Executable file
View File

@ -0,0 +1,33 @@
#!/bin/bash
mapfile -t MONITORS < <(hyprctl monitors -j | yq -r '. | sort_by(.x) | .[].name')
mapfile -t WORKSPACES < <(hyprctl workspaces -j | yq -r '.[].name')
function docked() {
if [ ! ${#MONITORS[@]} -eq 3 ]; then
echo "Not the right amount of displays"
exit 1
fi
echo "Assume Docked at home."
for i in "${!WORKSPACES[@]}"; do
# Move the workspace to the correct monitor
w=${WORKSPACES[$i]}
case $w in
4|8|9)
hyprctl dispatch moveworkspacetomonitor "${w} ${MONITORS[0]}"
;;
5|6)
hyprctl dispatch moveworkspacetomonitor "${w} ${MONITORS[2]}"
;;
*)
hyprctl dispatch moveworkspacetomonitor "${w} ${MONITORS[1]}"
;;
esac
done
}
if [ "$1" = "docked" ]; then
docked
fi