forked from Shinonome/dots-hyprland
fix quickshell bg showing over mpvpaper (fixes #1684)
This commit is contained in:
@@ -32,6 +32,11 @@ Scope {
|
|||||||
property int lastWorkspaceId: relevantWindows[relevantWindows.length - 1]?.workspace.id || 10
|
property int lastWorkspaceId: relevantWindows[relevantWindows.length - 1]?.workspace.id || 10
|
||||||
// Wallpaper
|
// Wallpaper
|
||||||
property string wallpaperPath: Config.options.background.wallpaperPath
|
property string wallpaperPath: Config.options.background.wallpaperPath
|
||||||
|
property bool wallpaperIsVideo: Config.options.background.wallpaperPath.endsWith(".mp4")
|
||||||
|
|| Config.options.background.wallpaperPath.endsWith(".webm")
|
||||||
|
|| Config.options.background.wallpaperPath.endsWith(".mkv")
|
||||||
|
|| Config.options.background.wallpaperPath.endsWith(".avi")
|
||||||
|
|| Config.options.background.wallpaperPath.endsWith(".mov")
|
||||||
property real preferredWallpaperScale: Config.options.background.parallax.workspaceZoom
|
property real preferredWallpaperScale: Config.options.background.parallax.workspaceZoom
|
||||||
property real effectiveWallpaperScale: 1 // Some reasonable init value, to be updated
|
property real effectiveWallpaperScale: 1 // Some reasonable init value, to be updated
|
||||||
property int wallpaperWidth: modelData.width // Some reasonable init value, to be updated
|
property int wallpaperWidth: modelData.width // Some reasonable init value, to be updated
|
||||||
@@ -137,6 +142,7 @@ Scope {
|
|||||||
|
|
||||||
// Wallpaper
|
// Wallpaper
|
||||||
Image {
|
Image {
|
||||||
|
visible: !bgRoot.wallpaperIsVideo
|
||||||
property real value // 0 to 1, for offset
|
property real value // 0 to 1, for offset
|
||||||
value: {
|
value: {
|
||||||
// Range = half-groups that workspaces span on
|
// Range = half-groups that workspaces span on
|
||||||
@@ -267,7 +273,7 @@ Scope {
|
|||||||
animation: Appearance.animation.elementMoveFast.numberAnimation.createObject(this)
|
animation: Appearance.animation.elementMoveFast.numberAnimation.createObject(this)
|
||||||
}
|
}
|
||||||
text: "Enter password"
|
text: "Enter password"
|
||||||
color: CF.ColorUtils.transparentize(bgRoot.colText, 0.5)
|
color: CF.ColorUtils.transparentize(bgRoot.colText, 0.3)
|
||||||
font {
|
font {
|
||||||
pixelSize: Appearance.font.pixelSize.normal
|
pixelSize: Appearance.font.pixelSize.normal
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -151,6 +151,13 @@ EOF
|
|||||||
mv "$RESTORE_SCRIPT.tmp" "$RESTORE_SCRIPT"
|
mv "$RESTORE_SCRIPT.tmp" "$RESTORE_SCRIPT"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
set_wallpaper_path() {
|
||||||
|
local path="$1"
|
||||||
|
if [ -f "$SHELL_CONFIG_FILE" ]; then
|
||||||
|
jq --arg path "$path" '.background.wallpaperPath = $path' "$SHELL_CONFIG_FILE" > "$SHELL_CONFIG_FILE.tmp" && mv "$SHELL_CONFIG_FILE.tmp" "$SHELL_CONFIG_FILE"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
switch() {
|
switch() {
|
||||||
imgpath="$1"
|
imgpath="$1"
|
||||||
mode_flag="$2"
|
mode_flag="$2"
|
||||||
@@ -204,6 +211,10 @@ switch() {
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Set wallpaper path
|
||||||
|
set_wallpaper_path "$imgpath"
|
||||||
|
|
||||||
|
# Set video wallpaper
|
||||||
local video_path="$imgpath"
|
local video_path="$imgpath"
|
||||||
monitors=$(hyprctl monitors -j | jq -r '.[] | .name')
|
monitors=$(hyprctl monitors -j | jq -r '.[] | .name')
|
||||||
for monitor in $monitors; do
|
for monitor in $monitors; do
|
||||||
@@ -228,9 +239,7 @@ switch() {
|
|||||||
matugen_args=(image "$imgpath")
|
matugen_args=(image "$imgpath")
|
||||||
generate_colors_material_args=(--path "$imgpath")
|
generate_colors_material_args=(--path "$imgpath")
|
||||||
# Update wallpaper path in config
|
# Update wallpaper path in config
|
||||||
if [ -f "$SHELL_CONFIG_FILE" ]; then
|
set_wallpaper_path "$imgpath"
|
||||||
jq --arg path "$imgpath" '.background.wallpaperPath = $path' "$SHELL_CONFIG_FILE" > "$SHELL_CONFIG_FILE.tmp" && mv "$SHELL_CONFIG_FILE.tmp" "$SHELL_CONFIG_FILE"
|
|
||||||
fi
|
|
||||||
remove_restore
|
remove_restore
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user