Migrated to ansible

This commit is contained in:
2024-04-02 00:59:42 +02:00
parent c53268e307
commit 0ccf6427f2
136 changed files with 5157 additions and 1407 deletions

View File

@@ -0,0 +1,5 @@
# Devices
device {
name = roccat-roccat-kone-emp-mouse
sensitivity = -0.5
}

12
roles/hypr/files/env.conf Executable file
View File

@@ -0,0 +1,12 @@
# Environment
env = XCURSOR_SIZE,24
env = HYPRCURSOR_SIZE,24
env = HYPRCURSOR_THEME,rose-pine-hyprcursor
env = XDG_SESSION_TYPE,wayland
env = WLR_NO_HARDWARE_CURSORS,1
env = QT_QPA_PLATFORMTHEME,qt5ct
#env = QT_QPA_PLATFORM,wayland
env = QT_STYLE_OVERRIDE,kvantum
# Minecraft
env = __GL_THREADED_OPTIMIZATIONS,0

View File

@@ -0,0 +1,98 @@
# Env
source = ~/.config/hypr/env.conf
# Nvidia
# source = ~/.config/hypr/nvidia.conf
# Keybinds
source = ~/.config/hypr/keybinds.conf
# Monitors/Workspaces
source = ~/.config/hypr/windowrule.conf
# Startup
source = ~/.config/hypr/startup.conf
# Devices
source = ~/.config/hypr/devices.conf
# Input
input {
kb_layout = de
numlock_by_default = 1
follow_mouse = 1
touchpad {
natural_scroll = yes
}
}
# General
general {
gaps_in = 2
gaps_out = 2
border_size = 2
col.active_border = rgba(7dc4e4ee) rgba(7dc4e4ee) 45deg
col.inactive_border = rgba(595959aa)
layout = dwindle
}
# Decoration
decoration {
rounding = 0
blur {
enabled = true
size = 2
passes = 3
#noise = 0
new_optimizations = on
special = false
blurls = rofi
blurls = gtk-layer-shell
}
drop_shadow = yes
shadow_range = 4
shadow_render_power = 3
col.shadow = rgba(1a1a1aee)
}
# Animations
animations {
enabled = yes
bezier = myBezier, 0.05, 0.9, 0.1, 1.05
animation = windows, 1, 7, myBezier
animation = windowsOut, 1, 7, default, popin 80%
animation = border, 1, 10, default
animation = borderangle, 1, 8, default
animation = fade, 1, 7, default
animation = workspaces, 1, 6, default
}
# Dwindle
dwindle {
pseudotile = yes
preserve_split = yes
}
# Master
master {
new_is_master = true
}
# Gestures
gestures {
workspace_swipe = on
}
# Misc
misc {
#mouse_move_enables_dpms = true
key_press_enables_dpms = true
}

103
roles/hypr/files/keybinds.conf Executable file
View File

@@ -0,0 +1,103 @@
# Keybindings
$mainMod = SUPER
# General
bind = $mainMod, P, pseudo,
bind = $mainMod, DELETE, exit,
bind = $mainMod, C, killactive,
bind = $mainMod, M, fullscreen,
bind = $mainMod, S, togglesplit,
bind = $mainMod, F4, exec, wlogout
bind = $mainMod, F, togglefloating,
bind = $mainMod, N, exec, swaync-client -t -sw
bind = $mainMod SHIFT, P, exec, hyprpicker -n -a -r
bind = $mainMod, O, exec, ~/.config/hypr/scripts/lock.sh
bind = $mainMod, B, exec, ~/.config/hypr/scripts/game_mode.sh
bind = $mainMod, V, exec, pkill rofi || ~/.config/hypr/scripts/clipboard.sh c
bind = $mainMod, TAB, exec, pkill rofi || ~/.config/hypr/scripts/app_launcher.sh w
bind = $mainMod, COMMA, exec, pkill rofi || ~/.config/hypr/scripts/app_launcher.sh e
bindr = $mainMod, SUPER_L, exec, pkill rofi || ~/.config/hypr/scripts/app_launcher.sh d
bind = $mainMod SHIFT, S, exec, grimblast --freeze copy area
bind = $mainMod CTRL, S, exec, grimblast --freeze copysave area ~/Pictures/Screenshots/"$(date --rfc-3339=seconds)".png
# Media keys
bind = , XF86AudioNext, exec, playerctl next
bind = , XF86AudioPrev, exec, playerctl previous
bind = , XF86AudioPlay, exec, playerctl play
bind = , XF86AudioPause, exec, playerctl pause
bind = , XF86AudioMute, exec, ~/.config/eww/scripts/audio.sh mutesink @DEFAULT_SINK@
bind = , XF86AudioMicMute, exec, ~/.config/eww/scripts/audio.sh mutesource @DEFAULT_SOURCE@
binde = , XF86AudioRaiseVolume, exec, ~/.config/eww/scripts/audio.sh vol up
binde = , XF86AudioLowerVolume, exec, ~/.config/eww/scripts/audio.sh vol down
binde = , XF86MonBrightnessDown, exec, brightnessctl set 5%-
binde = , XF86MonBrightnessUp, exec, brightnessctl set 5%+
# Applications
bind = $mainMod, T, exec, alacritty
bind = $mainMod, E, exec, nemo
bind = $mainMod, G, exec, ~/.config/hypr/scripts/app_launcher.sh c
bind = CTRL SHIFT, ESCAPE, exec, gnome-system-monitor
# Move focus
bind = $mainMod, left, movefocus, l
bind = $mainMod, H, movefocus, l
bind = $mainMod, right, movefocus, r
bind = $mainMod, L, movefocus, r
bind = $mainMod, up, movefocus, u
bind = $mainMod, K, movefocus, u
bind = $mainMod, down, movefocus, d
bind = $mainMod, J, movefocus, d
# Scrachtpad
bind = $mainMod CTRL, 2, togglespecialworkspace,
bind = $mainMod CTRL, 1, movetoworkspace, special
# Move window
bind = $mainMod SHIFT, left, movewindow, l
bind = $mainMod SHIFT, H, movewindow, l
bind = $mainMod SHIFT, right, movewindow, r
bind = $mainMod SHIFT, L, movewindow, r
bind = $mainMod SHIFT, up, movewindow, u
bind = $mainMod SHIFT, K, movewindow, u
bind = $mainMod SHIFT, down, movewindow, d
bind = $mainMod SHIFT, J, movewindow, d
bindm = $mainMod, mouse:272, movewindow
# Resize windows
binde = $mainMod CTRL, left, resizeactive, -20 0
binde = $mainMod CTRL, h, resizeactive, -20 0
binde = $mainMod CTRL, right, resizeactive, 20 0
binde = $mainMod CTRL, l, resizeactive, 20 0
binde = $mainMod CTRL, up, resizeactive, 0 -20
binde = $mainMod CTRL, k, resizeactive, 0 -20
binde = $mainMod CTRL, down, resizeactive, 0 20
binde = $mainMod CTRL, j, resizeactive, 0 20
bindm = $mainMod, mouse:273, resizewindow
# Move active window to a workspace
bind = $mainMod SHIFT, 1, movetoworkspace, 1
bind = $mainMod SHIFT, 2, movetoworkspace, 2
bind = $mainMod SHIFT, 3, movetoworkspace, 3
bind = $mainMod SHIFT, 4, movetoworkspace, 4
bind = $mainMod SHIFT, 5, movetoworkspace, 5
bind = $mainMod SHIFT, 6, movetoworkspace, 6
bind = $mainMod SHIFT, 7, movetoworkspace, 7
bind = $mainMod SHIFT, 8, movetoworkspace, 8
bind = $mainMod SHIFT, 9, movetoworkspace, 9
bind = $mainMod SHIFT, 0, movetoworkspace, 10
# Switch workspaces
bind = $mainMod, 1, workspace, 1
bind = $mainMod, 2, workspace, 2
bind = $mainMod, 3, workspace, 3
bind = $mainMod, 4, workspace, 4
bind = $mainMod, 5, workspace, 5
bind = $mainMod, 6, workspace, 6
bind = $mainMod, 7, workspace, 7
bind = $mainMod, 8, workspace, 8
bind = $mainMod, 9, workspace, 9
bind = $mainMod, 0, workspace, 10
# Scroll through existing workspaces
bind = $mainMod, mouse_down, workspace, e+1
bind = $mainMod, mouse_up, workspace, e-1

7
roles/hypr/files/nvidia.conf Executable file
View File

@@ -0,0 +1,7 @@
# Nvidia env
env = GBM_BACKEND,nvidia-drm
env = LIBVA_DRIVER_NAME,nvidia
env = __GLX_VENDOR_LIBRARY_NAME,nvidia
env = __GL_VRR_ALLOWED,1
env = WLR_NO_HARDWARE_CURSORS,1
env = WLR_DRM_NO_ATOMIC,1

View File

@@ -0,0 +1,36 @@
#!/bin/bash
rofi_conf="~/.config/rofi/main.rasi"
# Rofi action
case $1 in
d) mode="drun" ;;
w) mode="window" ;;
f) mode="filebrowser" ;;
e) mode="emoji"
action=(-a copy)
;;
c) mode="calc"
action=(-calc-command "wl-copy {result}")
children="\"message\", "
;;
h) echo -e "$0 [action]"
echo "d : drun mode"
echo "w : window mode"
echo "f : filebrowser mode"
exit 0 ;;
*) mode="drun" ;;
esac
# Get font
font=`gsettings get org.gnome.desktop.interface font-name`
fnt_override="configuration {font: \"${font//\'}\";}"
# Get icon theme
icon_override=`gsettings get org.gnome.desktop.interface icon-theme | sed "s/'//g"`
icon_override="configuration {icon-theme: \"${icon_override}\";}"
# Children
children_ovr="mainbox {children: [\"inputbar\", $children \"listbox\"];}"
# Launch rofi
rofi -show $mode ${action[0]} "${action[1]}" -theme-str "$children_ovr" -theme-str "$fnt_override" -theme-str "$icon_override" -config "$rofi_conf"

View File

@@ -0,0 +1,53 @@
#!/bin/bash
#set -e # Exit immediately if a command exits with a non-zero status. (deprecated) -> [CMD] || exit 1
if [[ $# -lt 1 ]] || [[ ! -d $1 ]]; then
echo "Usage:
$0 <dir containing images> [interval(seconds)]"
exit 1
fi
## Check running
running=$(ps -ef | grep "$0" | grep -v grep | wc -l)
if [ ${running} -gt 2 ]; then
echo "Script already running! Killing others (TODO)..."
exit 1
# CRASHES EVERYTHING \/ !!!!!!!!!!
script_pids=$(ps aux | grep -E "$script_name" | grep -v "grep" | awk -v pid="$current_pid" '$2 != pid {print $2}')
# Loop through the PIDs and kill the processes
for pid in $script_pids; do
echo "Killing process $pid"
kill "$pid"
done
fi
## Start swww
swww init &> /dev/null
## Settings for swww
export SWWW_TRANSITION_FPS=60
export SWWW_TRANSITION_STEP=2
INTERVAL=300
if [ ! -z $2 ]; then
INTERVAL=$2
fi
## Main loop
while true; do
find "$1" \
| while read -r img; do
echo "$((RANDOM % 1000)):$img"
done \
| sort -n | cut -d':' -f2- \
| while read -r img; do
img=${img/\~/$HOME}
if [ -d $img ]; then
continue
fi
swww img "$img" --transition-type wipe --resize=fit
ln -sf "$img" ~/.config/background
sleep $INTERVAL
done
done

View File

@@ -0,0 +1,24 @@
#!/bin/bash
roconf="~/.config/rofi/clipboard.rasi"
# Read font
font=`gsettings get org.gnome.desktop.interface font-name`
fnt_override="configuration {font: \"${font//\'}\";}"
# Clipboard action
case $1 in
c) cliphist list | rofi -dmenu -theme-str "entry { placeholder: \"Copy...\";}" -theme-str "$fnt_override" -config $roconf | cliphist decode | wl-copy
;;
d) cliphist list | rofi -dmenu -theme-str "entry { placeholder: \"Delete...\";}" -theme-str "$fnt_override" -config $roconf | cliphist delete
;;
w) if [ `echo -e "Yes\nNo" | rofi -dmenu -theme-str "entry { placeholder: \"Clear Clipboard History?\";}" -theme-str "$fnt_override" -config $roconf` == "Yes" ] ; then
cliphist wipe
fi
;;
*) echo -e "$0 [action]"
echo "c : cliphist list and copy selected"
echo "d : cliphist list and delete selected"
echo "w : cliphist wipe database"
exit 1
;;
esac

View File

@@ -0,0 +1,5 @@
#!/bin/bash
HYPRCMDS=$(hyprctl -j clients | jq -j '.[] | "dispatch closewindow address:\(.address); "')
hyprctl --batch "$HYPRCMDS" >> /tmp/hypr/cexit.log 2>&1

View File

@@ -0,0 +1,21 @@
#!/bin/bash
isplayingvideo(){
if pactl list | grep -q RUNNING; then
exit 1
else
exit 0
fi
}
if ! [ -z $1 ]; then
isplayingvideo
fi
timeout_lock=900
timeout_DPMS=1080
swayidle -w \
timeout ${timeout_lock} "$0 isplayinfvideo || ~/.config/hypr/scripts/lock.sh" \
#timeout ${timeout_DPMS} 'hyprctl dispatch dpms off'
#resume 'hyprctl dispatch dpms on' # Crashes all apps -> Hyprland config set misc/mouse_move_enables_dpms=true

View File

@@ -0,0 +1,10 @@
#!/bin/bash
dnd=$(swaync-client -D)
swaync-client -dn
swaylock -C ~/.config/swaylock/swaylock.conf
if [ "$dnd" == "false" ]; then
swaync-client -df
fi

View File

@@ -0,0 +1,6 @@
#!/bin/bash
HYPRCMDS=$(hyprctl -j clients | jq -j '.[] | "dispatch closewindow address:\(.address); "')
hyprctl --batch "$HYPRCMDS" >> /tmp/hypr/cexit.log 2>&1
hyprctl dispatch exit >> /tmp/hypr/cexit.log 2>&1

View File

@@ -0,0 +1,13 @@
#!/bin/bash
program_name="ags"
check_program_running() {
pgrep -x "$program_name" > /dev/null
}
while ! check_program_running; do
sleep 1
done
sleep 1

23
roles/hypr/files/startup.conf Executable file
View File

@@ -0,0 +1,23 @@
# First for systray
exec-once = ags -c /home/keule/test/config.js
# Programms
exec-once = armcord
exec-once = nextcloud
exec-once = youtube-music
exec-once = element-desktop
exec-once = nm-applet
exec-once = blueman-applet
exec-once = playerctld daemon
exec-once = ~/.config/hypr/scripts/idle.sh
exec-once = ~/.config/hypr/scripts/battery_check.sh
# Clipboard
exec-once = wl-paste --type text --watch cliphist store #Stores only text data
exec-once = wl-paste --type image --watch cliphist store #Stores only image data
# Background
exec-once = ~/.config/hypr/scripts/background.sh ~/Data/Pictures/Backgrounds/Desktop/
# Misc
exec-once = dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP

View File

@@ -0,0 +1,34 @@
# Monitors
$monitorOne = HDMI-A-1
$monitorTwo = DP-2
$monitorThree = HDMI-A-2
monitor = $monitorOne,1920x1080@144.001007,0x0,1
monitor = $monitorTwo,2560x1440@143.912003,1920x0,1
monitor = $monitorThree,1920x1080@60.000000,4480x0,1
monitor = ,preferred,auto,1
# Window Rules - (hyprctl -j clients | grep class)
windowrule = workspace 2,^(YouTube Music)$
windowrule = workspace 4,^(explorer.exe)$
windowrule = workspace 4,^(lutris)$
windowrule = workspace 5,^(discord)$
windowrule = workspace 5,^(WebCord)$
windowrule = workspace 5,^(Element)$
windowrule = workspace 5,^(de.keule.client.ui.JavaFX)$
windowrule = float,^(lutris)$
windowrule = size 965 545, ^(lutris)$
windowrule = float,title:^.*culator.*$
# Workspace
workspace = 1, monitor:$monitorOne, default:true
workspace = 2, monitor:$monitorOne
workspace = 3, monitor:$monitorTwo, default:true
workspace = 4, monitor:$monitorTwo
workspace = 5, monitor:$monitorThree, default:true
workspace = 6, monitor:$monitorThree

18
roles/hypr/tasks/main.yml Normal file
View File

@@ -0,0 +1,18 @@
---
- name: "[Hyprland] Install"
ansible.builtin.package:
name:
- hyprland
state: latest
become: true
- name: "[Hyprland] Create config folder"
ansible.builtin.file:
mode: "0755"
path: "{{ ansible_user_dir }}/.config/hypr"
state: directory
- name: "[Hyprland] Configure"
ansible.builtin.copy:
src: "./"
dest: "{{ ansible_user_dir }}/.config/hypr"