]> Freerunner's - dotfiles.git/commitdiff
niri: update config while upgrading to 1.8.x
authorAndre Ramnitz <tux.rising@gmail.com>
Tue, 27 Aug 2024 12:22:02 +0000 (14:22 +0200)
committerAndre Ramnitz <tux.rising@gmail.com>
Tue, 27 Aug 2024 12:22:02 +0000 (14:22 +0200)
config/dot-config/niri/config.kdl
config/dot-config/niri/startup.sh

index a2a2b166bf58690c4254f885d5005a99a0a4627d..aa99c1136a5984a3aa47b724d02aae77c3b2f670 100644 (file)
@@ -10,6 +10,7 @@ input {
             // For example:
             // layout "us,ru"
             // options "grp:win_space_toggle,compose:ralt,ctrl:nocaps"
+               layout "us(de_se_fi)"
         }
 
         // You can set the keyboard repeat parameters. The defaults match wlroots and sway.
@@ -36,15 +37,15 @@ input {
 
     mouse {
         // natural-scroll
-        // accel-speed 0.2
-        // accel-profile "flat"
+        accel-speed 0.2
+        accel-profile "adaptive" 
     }
 
     tablet {
         // Set the name of the output (see below) which the tablet will map to.
         // If this is unset or the output doesn't exist, the tablet maps to one of the
         // existing outputs.
-        map-to-output "eDP-1"
+        map-to-output "eDP-3"
     }
 
     // By default, niri will take over the power button to make it sleep
@@ -58,7 +59,7 @@ input {
 // by running `niri msg outputs` while inside a niri instance.
 // The built-in laptop monitor is usually called "eDP-1".
 // Remember to uncommend the node by removing "/-"!
-/-output "eDP-1" {
+output "DP-1" {
     // Uncomment this line to disable this output.
     // off
 
@@ -71,7 +72,7 @@ input {
     // for the resolution.
     // If the mode is omitted altogether or is invalid, niri will pick one automatically.
     // Run `niri msg outputs` while inside a niri instance to list all outputs and their modes.
-    mode "5120x1440@120"
+    mode "5120x1440@119.970"
 
     // Position of the output in the global coordinate space.
     // This affects directional monitor actions like "focus-monitor-left", and cursor movement.
@@ -82,7 +83,9 @@ input {
     // so to put another output directly adjacent to it on the right, set its x to 1920.
     // It the position is unset or results in an overlap, the output is instead placed
     // automatically.
-    position x=5120 y=0
+    // position x=5120 y=0
+
+    variable-refresh-rate on-demand=true
 }
 
 layout {
@@ -107,7 +110,7 @@ layout {
         // If you enable the border, you probably want to disable the focus ring.
         //off
 
-        width 2
+        width 1
         active-color 255 200 127 255
         //active-color 127 200 255 255
         inactive-color 90 90 90 255
@@ -133,7 +136,7 @@ layout {
     // default-column-width {}
 
     // Set gaps around windows in logical pixels.
-    gaps 24
+    gaps 16
 
     // Struts shrink the area occupied by windows, similarly to layer-shell panels.
     // You can think of them as a kind of outer gaps. They are set in logical pixels.
@@ -160,12 +163,14 @@ layout {
 // Note that running niri as a session supports xdg-desktop-autostart,
 // which may be more convenient to use.
 // spawn-at-startup "alacritty" "-e" "fish"
+spawn-at-startup "~/.config/niri/startup.sh"
+spawn-at-startup "/usr/bin/foot -s"
 
 cursor {
     // Change the theme and size of the cursor as well as set the
     // `XCURSOR_THEME` and `XCURSOR_SIZE` env variables.
     xcursor-theme "breeze_cursors"
-    xcursor-size 28
+    xcursor-size 32
 }
 
 // Uncomment this line to ask the clients to omit their client-side decorations if possible.
@@ -176,7 +181,7 @@ prefer-no-csd
 // You can change the path where screenshots are saved.
 // A ~ at the front will be expanded to the home directory.
 // The path is formatted with strftime(3) to give you the screenshot date and time.
-screenshot-path "~/Bilder/niri/scrot %Y-%m-%d %H-%M-%S.png"
+screenshot-path "~/Bilder/Screenshots//scrot niri %Y-%m-%d %H-%M-%S.png"
 
 // You can also set this to null to disable saving screenshots to disk.
 // screenshot-path null
index 2f3336458f61ac045a709b839344a4b62631771d..761d12886b045b1b1f024e8a7e108966dfaef2bb 100755 (executable)
@@ -1,60 +1,40 @@
 #!/usr/bin/env bash
 
-logger '======================='
-logger 'NIRI MAIN STARTUP BEGIN'
-
-MAKOCONFIG="/home/andy/.config/mako/config"
-
-if [[ ! -d "$XDG_RUNTIME_DIR" ]] ; then
-    # shellcheck disable=SC2155
-    # shellcheck disable=SC2046
-    export XDG_RUNTIME_DIR=$(mktemp -d /tmp/$(id -u)-runtime-dir.XXX)
-    logger 'xdg-runtime dir set NOW'
-else
-    logger 'xdg-runtime dir already set'
-fi
-
-if [[ ! "$DBUS_SESSION_BUS_ADDRESS" ]]; then
-    dbus-daemon --session --address=unix:path="$XDG_RUNTIME_DIR"/bus &
-    logger 'dbus session daemon started'
-else
-    logger 'dbus already running'
-fi
+logger '============================'
+logger 'HYPRLAND MAIN STARTUP BEGIN'
+# shellcheck disable=SC2155
+# shellcheck disable=SC2046
+test ! -d "$XDG_RUNTIME_DIR" && export XDG_RUNTIME_DIR=$(mktemp -d /tmp/$(id -u)-runtime-dir.XXX) && logger 'xdg-runtime dir set NOW'
+test ! "$DBUS_SESSION_BUS_ADDRESS" && dbus-daemon --session --address=unix:path="$XDG_RUNTIME_DIR"/bus && logger 'dbus session daemon started'
+dbus-update-activation-environment WAYLAND_DISPLAY XDG_CURRENCT_DESKTOP
+
+#------------------------------------------------------ xdg-desktop-portal
+killall -e xdg-desktop-portal-hyprland
+killall -e xdg-desktop-portal-kde
+killall -e xdg-desktop-portal-gtk
+killall -e xdg-desktop-portal-gnome
+killall -e xdg-desktop-portal-wlr
+killall xdg-desktop-portal
+logger 'killed all xdg-desktop'
 
-if [[ ! $(pidof /usr/lib64/libexec/polkit-kde-authentication-agent-1) ]]; then
-    /usr/lib64/libexec/polkit-kde-authentication-agent-1 &
+# sleep 1 && test -f /usr/libexec/xdg-desktop-portal-kde && sleep 1 && /usr/libexec/xdg-desktop-portal-kde &
+sleep 1 && test -f /usr/libexec/xdg-desktop-portal-hyprland && sleep 1 && /usr/libexec/xdg-desktop-portal-hyprland &
+sleep 1 && test -f /usr/libexec/xdg-desktop-portal && sleep 1 && /usr/libexec/xdg-desktop-portal &
+
+#------------------------------------------------------ polkit-kde
+if [[ ! $(pidof /usr/libexec/polkit-kde-authentication-agent-1) ]]; then
+    if ! command -v /usr/libexec/polkit-kde-authentication-agent-1 &> /dev/null
+    then
+        echo "polkit-kde not installed"
+    else
+    /usr/libexec/polkit-kde-authentication-agent-1 &
     logger 'polit-kde started'
+    fi
 else
     logger 'polkit-kde already running'
 fi
 
-if [[ ! $(pidof mako) ]]; then
-       mako --config "${MAKOCONFIG}" &
-       logger 'mako started'
-else
-    logger 'mako already running'
-fi
-
-killall xdg-desktop-portal-hyprland
-killall xdg-desktop-portal-kde
-killall xdg-desktop-portal-gtk
-killall xdg-desktop-portal-gnome
-killall xdg-desktop-portal-wlr
-killall xdg-desktop-portal
-logger 'killed all xdg-desktop'
-
-sleep 1
-if [[ ! $(pidof xdg-desktop-portal-gtk) ]]; then
-    /usr/libexec/xdg-desktop-portal-gtk
-    logger 'problem: xdg-desktop-portal-gtk'
-fi
-
-sleep 2
-if [[ ! $(pidof xdg-desktop-portal) ]]; then
-    /usr/libexec/xdg-desktop-portal &
-    logger 'problem: xdg-desktop-portal'
-fi
-
+#------------------------------------------------------ waybar and tray apps
 if [[ ! $(pidof pipewire) ]]; then
     gentoo-pipewire-launcher &
     logger 'gentoo-pipewire-launcher started'
@@ -63,57 +43,35 @@ else
     logger 'gentoo-pipewire-launcher (re-)started'
 fi
 
-if [[ ! $(pidof waybar) ]]; then
-    waybar && logger 'waybar started' &
-fi
+until [[ $(pidof pipewire) ]]; do
+    sleep 0.5
+done
 
-if [[ ! $(pidof mpd) ]]; then
-       mpd && logger 'mpd started' &
-else
-    logger 'mpd already running'
-fi
+! pidof mpd && mpd # does fork unless called with --no-daemon
+! pidof mpd-mpris && mpd-mpris > /dev/null 2>&1 &
 
-if [[ ! $(pidof mpd-mpris) ]]; then
-       mpd-mpris &
-       logger 'mpd-mpris started'
-else
-    logger 'mpd-mpris already running'
-fi
+! pidof waybar && waybar > /dev/null 2>&1 &
+logger 'waybar started'
 
-if [[ ! $(pidof swww-daemon) ]]; then
-    swww init
-    logger 'swww-daemon started' &
-    # swww img ~/Bilder/Wallpapers/default.jpg &
-fi
+until [[ $(pidof waybar) ]]; do
+    sleep 0.5
+done
+corectrl --minimize-systray &
+openrgb -p default --startminimized &
 
-if [[ ! $(pidof wl-gammarelay-rs) ]]; then
-    /home/andy/.cargo/bin/wl-gammarelay-rs > /dev/null 2>&1 &
-    logger 'gammarelay started'
-fi
-if [[ ! -f "/tmp/autotemp.pid" ]]; then
-    kill "$(cat /tmp/autotemp.pid)" && logger "gammarelay-autotemp killed"
-    /home/andy/.config/hypr/scripts/gammarelay-autotemp.py > /dev/null 2>&1 &
-fi
+! pidof swaync && swaync > /dev/null 2>&1 &
+! pidof kwalletmanager5 && /usr/libexec/pam_kwallet_init &
 
-# if [[ ! $(pidof wlsunset) ]]; then
-#     wlsunset -l 51.5 -L 6.7 > /dev/null 2>&1 &
-#     logger 'wlsunset started'
-# else
-#     logger 'wlsunset already running'
-# fi
+! pidof swww-daemon && /usr/bin/swww-daemon > /dev/null 2>&1 &
+sleep 0.5 && /usr/bin/swww img ~/Bilder/Wallpapers/default.jpg
 
-openrgb -p default &
-logger 'openrgb default theme loaded'
-kks new default & # kakoune default server
+pkill -f 'python /home/andy/.config/hypr/scripts/gammarelay-auto-temp.py'
+sleep 1 && "/home/andy/.config/hypr/scripts/gammarelay-auto-temp.py" > /dev/null 2>&1 &
 
-if [[ $(pidof swww-daemon) ]]; then
-    killall wl-paste
-    wl-paste --type  text --watch cliphist store &
-    wl-paste --type image --watch cliphist store &
-    logger 'clipboard manager loaded'
-fi
+pidof wl-paste && killall wl-paste
+wl-paste --type text --watch cliphist store &
+wl-paste --type image --watch cliphist store &
 
-sleep 2
-logger 'NIRI MAIN STARTUP END'
-logger '====================='
+logger 'HYPRLAND MAIN STARTUP END'
+logger '============================'