From f071cef6a0c88e54dda81633c1ebbd697edff7ca Mon Sep 17 00:00:00 2001 From: Massaki Archambault Date: Wed, 27 Mar 2024 12:34:07 -0400 Subject: [PATCH] tweak sunshine --- files/.config/sunshine/sunshine.conf | 3 +++ files/.config/sway/config | 1 + files/.local/bin/gamemode-start | 2 +- files/.local/bin/sunshine-prepare | 6 ++++++ files/.local/bin/sunshine-restore | 5 +++++ files/.local/bin/sway | 10 ++++++---- files/.profile | 2 +- 7 files changed, 23 insertions(+), 6 deletions(-) create mode 100644 files/.config/sunshine/sunshine.conf create mode 100755 files/.local/bin/sunshine-prepare create mode 100755 files/.local/bin/sunshine-restore diff --git a/files/.config/sunshine/sunshine.conf b/files/.config/sunshine/sunshine.conf new file mode 100644 index 0000000..8338cba --- /dev/null +++ b/files/.config/sunshine/sunshine.conf @@ -0,0 +1,3 @@ +adapter_name = /dev/dri/by-path/pci-0000:03:00.0-render +output_name = 1 +global_prep_cmd = [{"do":"sunshine-prepare","undo":"sunshine-restore"}] diff --git a/files/.config/sway/config b/files/.config/sway/config index e54ee31..a7b4336 100644 --- a/files/.config/sway/config +++ b/files/.config/sway/config @@ -100,6 +100,7 @@ workspace $ws7 output $output1 VGA-1 workspace $ws8 output $output1 VGA-1 workspace $ws9 output $output1 VGA-1 workspace $ws10 output $output1 VGA-1 +workspace sunshine output $output1 VGA-1 output $output1 { position 0 270 # we need to explicitly select the mode diff --git a/files/.local/bin/gamemode-start b/files/.local/bin/gamemode-start index 10b8e86..ed8142f 100755 --- a/files/.local/bin/gamemode-start +++ b/files/.local/bin/gamemode-start @@ -1,5 +1,5 @@ #!/bin/bash systemctl --user stop gammastep -sudo systemctl stop docker +sudo systemctl stop docker.service docker.socket diff --git a/files/.local/bin/sunshine-prepare b/files/.local/bin/sunshine-prepare new file mode 100755 index 0000000..a946c78 --- /dev/null +++ b/files/.local/bin/sunshine-prepare @@ -0,0 +1,6 @@ +#!/bin/bash + +pkill --signal SIGUSR1 swaylock +xrandr --output DP-4 --primary +swaymsg output HDMI-A-2 disable +swaymsg workspace sunshine diff --git a/files/.local/bin/sunshine-restore b/files/.local/bin/sunshine-restore new file mode 100755 index 0000000..58f9be2 --- /dev/null +++ b/files/.local/bin/sunshine-restore @@ -0,0 +1,5 @@ +#!/bin/bash + +swaymsg output HDMI-A-2 enable +swaymsg workspace back_and_forth + diff --git a/files/.local/bin/sway b/files/.local/bin/sway index b9fdeaa..d6549b5 100755 --- a/files/.local/bin/sway +++ b/files/.local/bin/sway @@ -14,15 +14,17 @@ import-gsettings() { # list DRM device priority # Set intel graphics as lowest priority # https://github.com/swaywm/sway/wiki#i-have-a-multi-gpu-setup-like-intelnvidia-or-intelamd-and-sway-does-not-start -export WLR_DRM_DEVICES="$(drm_info -j | jq --raw-output 'to_entries[] | [if .value.driver.desc == "Intel Graphics" then 1 else 0 end, .key] | @tsv' | awk '{printf "%s:", $2}' | sed -e 's/:$//')" +export WLR_DRM_DEVICES="$(drm_info -j | jq --raw-output 'to_entries[] | [if .value.driver.desc == "Intel Graphics" then 0 else 1 end, .key] | @tsv' | sort | awk '{printf "%s:", $2}' | sed -e 's/:$//')" +# disable hardware cursor (cause mouse to stutter on my setup) +#export WLR_NO_HARDWARE_CURSORS=1 export XDG_CURRENT_DESKTOP=sway export XDG_SESSION_TYPE=wayland # Qt #export DESKTOP_SESSION=gnome -export QT_STYLE_OVERRIDE=gtk -export QT_QPA_PLATFORMTHEME=gtk2 +#export QT_STYLE_OVERRIDE=gtk +#export QT_QPA_PLATFORMTHEME=gtk2 export QT_AUTO_SCREEN_SCALE_FACTOR=0 #export QT_QPA_PLATFORM=wayland-egl export QT_WAYLAND_DISABLE_WINDOWDECORATION=1 @@ -39,7 +41,7 @@ export ECORE_EVAS_ENGINE=wayland_egl export ELM_ENGINE=wayland_egl # SDL -export SDL_VIDEODRIVER=wayland +#export SDL_VIDEODRIVER=wayland # Java export _JAVA_AWT_WM_NONREPARENTING=1 diff --git a/files/.profile b/files/.profile index 91307bb..d2bce7c 100644 --- a/files/.profile +++ b/files/.profile @@ -10,7 +10,7 @@ export PAGER=less export DIFFPROG=meld # motd -export MOTD_SERVICES="$MOTD_SERVICES docker.socket sshd.service" +export MOTD_SERVICES="$MOTD_SERVICES docker.service sshd.service" # java export _JAVA_OPTIONS="-Dawt.useSystemAAFontSettings=on -Dswing.aatext=true -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel -Dsun.java2d.opengl=true"