qs: a new action

This commit is contained in:
2025-12-23 22:13:04 +01:00
parent af0f4c83ba
commit 7e5dba2118
3 changed files with 47 additions and 35 deletions
@@ -85,7 +85,7 @@ Item {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
hoverEnabled: true
acceptedButtons: Qt.LeftButton | Qt.MiddleButton
acceptedButtons: Qt.LeftButton | Qt.MiddleButton | Qt.RightButton
onEntered: {
if (windowTitle.implicitWidth > titleContainer.width)
windowTitle.x = titleContainer.width - windowTitle.implicitWidth;
@@ -99,6 +99,8 @@ Item {
Quickshell.execDetached(["niri", "msg", "action", "close-window"]);
else if (mouse.button === Qt.LeftButton)
Quickshell.execDetached(["niri", "msg", "action", "center-window"]);
else if (mouse.button === Qt.RightButton)
Quickshell.execDetached(["niri", "msg", "action", "maximize-window-to-edges"]);
}
onWheel: function(wheel) {
if (wheel.angleDelta.y > 0)
+17 -7
View File
@@ -1,10 +1,10 @@
#!/usr/bin/env bash
# Description:
# Select which GPU to use for rendering for Hyprland and Niri.
# Select which GPU to use for rendering by Hyprland and Niri.
#
# envs exported:
# HYPR_AQ_DRM_DEVICES - Colon-separated list of DRM device paths for Hyprland's aq_drm
# Envs exported:
# HYPR_AQ_DRM_DEVICES - Colon-separated list of DRM device paths for Hyprland's AQ_DRM_DEVICES env
# BRIGHTNESSCTL_DEVICE - Device identifier for brightnessctl
# Constants
@@ -57,9 +57,18 @@ export HYPR_AQ_DRM_DEVICES
primary_device="$default_dri_path"
for who in "${prefer_order[@]}"; do
case "$who" in
nvidia) [[ -n "$nvidia_path" ]] && { primary_device="$nvidia_path"; break; } ;;
intel) [[ -n "$intel_path" ]] && { primary_device="$intel_path"; break; } ;;
amd) [[ -n "$amd_path" ]] && { primary_device="$amd_path"; break; } ;;
nvidia) [[ -n "$nvidia_path" ]] && {
primary_device="$nvidia_path"
break
} ;;
intel) [[ -n "$intel_path" ]] && {
primary_device="$intel_path"
break
} ;;
amd) [[ -n "$amd_path" ]] && {
primary_device="$amd_path"
break
} ;;
esac
done
@@ -76,8 +85,9 @@ function update_niri_config() {
[[ "$current" == "$device_path" ]] && return
sed -i -E "s|^(\s*render-drm-device\s+)\"[^\"]+\"|\1\"$device_path\"|" "$config_file"
else
printf '\ndebug {\nrender-drm-device "%s"\n}\n' "$device_path" >> "$config_file"
printf '\ndebug {\nrender-drm-device "%s"\n}\n' "$device_path" >>"$config_file"
fi
}
update_niri_config "$niri_config_file" "$primary_device"