LinuxCommandLibrary

plasma-apply-wallpaperimage

Set desktop wallpaper using an image file

TLDR

Apply a wallpaper

$ plasma-apply-wallpaperimage /[path/to/image]
copy

Apply a wallpaper with a fill mode
$ plasma-apply-wallpaperimage --fill-mode [stretch|preserveAspectFit|preserveAspectCrop|tile|tileVertically|tileHorizontally|pad] /[path/to/image]
copy

Display help
$ plasma-apply-wallpaperimage --help
copy

SYNOPSIS

plasma-apply-wallpaperimage [OPTIONS] <FILE>

PARAMETERS

<FILE>
    Specifies the path to the image file to be used as wallpaper. This is a mandatory argument.

--screen <N>
    Applies the wallpaper to a specific screen, identified by its numerical index (e.g., 0 for the primary screen, 1 for a secondary screen).

--activity <UUID>
    Applies the wallpaper to a specific Plasma activity, identified by its unique UUID. Activity UUIDs can be discovered using D-Bus commands like qdbus org.kde.ActivityManager /ActivityManager Activities.

--help
    Displays a help message and exits.

--version
    Displays version information about the command and exits.

DESCRIPTION

The plasma-apply-wallpaperimage command provides a convenient command-line interface for changing the wallpaper image on a KDE Plasma desktop environment. It allows users to programmatically set a background image for specific screens or Plasma activities. This utility is particularly useful for scripting, automation, or quickly cycling through wallpapers without interacting with the graphical user interface. By leveraging Plasma's internal D-Bus mechanisms, it integrates seamlessly with the desktop, offering precise control over wallpaper settings. It's an essential tool for users looking to customize their Plasma experience through scripts or external applications.

CAVEATS

This command is designed exclusively for the KDE Plasma desktop environment and requires a running Plasma session to function correctly.
It only supports image files as wallpapers and cannot directly set slideshows, animated wallpapers, or solid colors. For more complex wallpaper types, direct D-Bus calls might be necessary.

USAGE EXAMPLES

Here are common ways to use the plasma-apply-wallpaperimage command:

1. Set wallpaper for the current desktop/activity:
plasma-apply-wallpaperimage /home/user/Pictures/my_cool_wallpaper.jpg

2. Set wallpaper for a specific screen (e.g., screen 1):
plasma-apply-wallpaperimage --screen 1 /home/user/Pictures/secondary_monitor_bg.png

3. Set wallpaper for a specific Plasma activity:
First, find the activity UUIDs:
qdbus org.kde.ActivityManager /ActivityManager Activities
Then, use the obtained UUID:
plasma-apply-wallpaperimage --activity <YOUR_ACTIVITY_UUID> /home/user/Pictures/work_activity_bg.webp

HISTORY

plasma-apply-wallpaperimage is part of the plasma-workspace package, which comprises core components of the KDE Plasma desktop environment. It was introduced to provide a command-line interface for managing certain desktop settings, specifically wallpaper, complementing the graphical configuration modules. This allows for greater automation and integration into shell scripts or custom applications, reflecting KDE's commitment to flexibility and user control over the desktop environment.

SEE ALSO

Copied to clipboard