|
802 | 802 | extraSessionCommands = ''
|
803 | 803 | # see also https://wiki.hyprland.org/Configuring/Environment-variables/
|
804 | 804 |
|
| 805 | + # Fix screen tearing in external display of machine with nvidia GPU |
| 806 | + # https://old.reddit.com/r/swaywm/comments/102cdqa/how_can_i_fix_my_external_screen_flickering_with/ |
| 807 | + # Seems to be not working |
| 808 | + # export WLR_RENDERER=vulkan |
| 809 | +
|
805 | 810 | export TERMINAL="alacritty"
|
806 | 811 | export BROWSER="firefox"
|
807 | 812 |
|
|
831 | 836 | # export GBM_BACKEND=nvidia-drm
|
832 | 837 | # export __GLX_VENDOR_LIBRARY_NAME=nvidia
|
833 | 838 |
|
| 839 | + # https://old.reddit.com/r/swaywm/comments/17sob2b/sway_wont_launch_with_vulkan_renderer_on_nvidia/k8rkxo4/ |
| 840 | + nvidia_priority=40 |
| 841 | + # If $WLR_RENDERER == vulkan, then the nvidia card should be prioritized to the first |
| 842 | + # otherwise, nvidia card should be deprioritized to the last. |
| 843 | + if [[ "$WLR_RENDERER" == "vulkan" ]]; then |
| 844 | + nvidia_priority=40 |
| 845 | + fi |
834 | 846 | # https://wiki.hyprland.org/hyprland-wiki/pages/Configuring/Multi-GPU/
|
835 |
| - # Changing the order of using GPUs to intel -> amd -> other -> nvidia. |
836 | 847 | wlr_drm_devices="$(drm_info -j |\
|
837 | 848 | jq -r 'with_entries(.value |= .driver.desc) | to_entries | .[] | "\(.key) \(.value)"' |\
|
838 |
| - sed -E 's#(^\S+)\s+(.*intel.*)#\1 10#gI; |
| 849 | + sed -E "s#(^\S+)\s+(.*intel.*)#\1 10#gI; |
839 | 850 | s#(^\S+)\s+(.*amd.*)#\1 20#gI;
|
840 |
| - s#(^\S+)\s+(.*nvidia.*)#\1 40#gI; |
841 |
| - # Below line assign all other devices to the priority 30, |
842 |
| - # which means the order is intel -> amd -> other -> nvidia. |
843 |
| - s#(^\S+)\s+([^0-9]+$)#\1 30#gI' |\ |
| 851 | + s#(^\S+)\s+(.*nvidia.*)#\1 $nvidia_priority#gI; |
| 852 | + s#(^\S+)\s+([^0-9]+$)#\1 30#gI" |\ |
844 | 853 | sort -n -k2 |\
|
845 | 854 | awk '{print $1}' |\
|
846 | 855 | paste -sd ':')"
|
|
0 commit comments