使用 LSWC 在 Linux 中自动更改壁纸
墙纸

> 
> 简介：这是一个小脚本，可以在 Linux 桌面上定期自动更改壁纸。
> 
> 
> 


顾名思义，LittleSimpleWallpaperChanger （LSWC）是一个小脚本，可以定期地随机更改壁纸。


我知道在“外观”或“更改桌面背景”设置中有一个随机壁纸选项。但那是随机更改预置的壁纸而不是你添加的壁纸。


因此，在本文中，我们将看到如何使用 LittleSimpleWallpaperChanger 设置包含照片的随机桌面壁纸。


### Little Simple Wallpaper Changer (LSWC)


[LittleSimpleWallpaperChanger](https://github.com/LittleSimpleWallpaperChanger/lswc) （LSWC） 是一个非常轻量级的脚本，它在后台运行，从用户指定的文件夹中更改壁纸。壁纸以 1 至 5 分钟的随机间隔变化。该软件设置起来相当简单，设置完后，用户就可以不用再操心了。


![Little Simple Wallpaper Changer to change wallpapers in Linux](/data/attachment/album/201807/07/140202q045bz1cqug47t4z.jpg)


#### 安装 LSWC


[点此链接下载 LSWC](https://github.com/LittleSimpleWallpaperChanger/lswc/raw/master/Lswc.zip)。压缩文件的大小约为 15KB。


* 进入下载位置。
* 右键单击下载的 .zip 文件，然后选择“在此处解压”。
* 打开解压后的文件夹，右键单击并选择“在终端中打开”。
* 在终端中复制粘贴命令 `bash ./README_and_install.sh` 并按回车键。
* 然后会弹出一个对话框，要求你选择包含壁纸的文件夹。单击它，然后选择你存放壁纸的文件夹。
* 就是这样。然后重启计算机。


![Little Simple Wallpaper Changer for Linux](/data/attachment/album/201807/07/140203q1zg8u6gu1wf11mt.jpg)


#### 使用 LSWC


安装时，LSWC 会要求你选择包含壁纸的文件夹。因此，我建议你在安装 LSWC 之前创建一个文件夹并将你想要的壁纸全部移动到那。或者你可以使用图片文件夹中的“壁纸”文件夹。**所有壁纸都必须是 .jpg 格式。**


你可以添加更多壁纸或从所选文件夹中删除当前壁纸。要更改壁纸文件夹位置，你可以从以下文件中编辑壁纸的位置。



```
.config/lswc/homepath.conf

```

#### 删除 LSWC


打开终端并运行以下命令以停止 LSWC：



```
pkill lswc

```

在文件管理器中打开家目录，然后按 `Ctrl+H` 显示隐藏文件，接着删除以下文件：


* `.local` 中的 `scripts` 文件夹
* `.config` 中的 `lswc` 文件夹
* `.config/autostart` 中的 `lswc.desktop` 文件


这就完成了。创建自己的桌面背景幻灯片。LSWC 非常轻巧，易于使用。安装它然后忘记它。


LSWC 功能不是很丰富，但这是有意的。它做了它打算做的事情，那就是更换壁纸。如果你想要一个自动下载壁纸的工具试试 [WallpaperDownloader](https://itsfoss.com/wallpaperdownloader-linux/)。


请在下面的评论栏分享你对这个漂亮的小软件的想法。别忘了分享这篇文章。干杯。




---


via: <https://itsfoss.com/little-simple-wallpaper-changer/>


作者：[Aquil Roshan](https://itsfoss.com/author/aquil/) 选题：[lujun9972](https://github.com/lujun9972) 译者：[geekpi](https://github.com/geekpi) 校对：[wxy](https://github.com/wxy)


本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译，[Linux中国](https://linux.cn/) 荣誉推出


OK
![Warp Terminal](/assets/images/warp-terminal.webp)


![Warp Terminal](/assets/images/warp-terminal.webp)

As the name suggests, LittleSimpleWallpaperChanger is a small script that changes the wallpapers randomly at intervals.

Now I know that there is a random wallpaper option in the ‘Appearance’ or the ‘Change desktop background’ settings. But that randomly changes the pre-installed wallpapers and not the wallpapers that you add.

So in this article, we’ll be seeing how to set up a random desktop wallpaper setup consisting of your photos using LittleSimpleWallpaperChanger.

## Little Simple Wallpaper Changer (LSWC)

[LittleSimpleWallpaperChanger](https://github.com/LittleSimpleWallpaperChanger/lswc) or LSWC is a very lightweight script that runs in the background, changing the wallpapers from the user-specified folder. The wallpapers change at a random interval between 1 and 5 minutes. The software is rather simple to set up, and once set up, the user can just forget about it.

**archive file on Fedora 40, which worked as intended.**

**GNOME 3 or 4**Similarly, if you are switching between dark mode and light-mode frequently, you may need to use the

**file.**

**dark and light theme**### Installing LSWC

Required zip archive files are directly added to the GitHub repo of this project. You can download the file as per your distribution or desktop environment version. The zipped file is around 15 KB in size.

![Download the zip file of LSWC from GitHub page.](https://itsfoss.com/content/images/2024/09/download-the-raw-zip-file-of-lswc.png)

**archive file on Fedora 40, which worked as intended.**

**GNOME 3 or 4**Now, browse to the download location and right-click on the downloaded .zip file and select **Extract**.

![Right-click on the downloaded zip archive file of LSWC and select "Extract" from the context menu.](https://itsfoss.com/content/images/2024/09/right-click-on-the-archive-file-and-select-extract.png)

Open the extracted folder, right click and select **Open in terminal**.

![Inside the extracted folder, right-click on an empty space and select "Open in Terminal" option from the context menu.](https://itsfoss.com/content/images/2024/09/open-a-terminal-inside-the-downloaded-lswc-folder.png)

You can now run the `README_and-install.sh`

file. Use the `bash`

command to execute the shell script without giving explicit execution permission to the installation script.

```
bash ./README_and_install.sh
```


**Suggested Read 📖**

[How to Run a Shell Script in Linux [Essentials Explained]Here are all the essential details you should know about executing a shell script in the Linux command line.](https://itsfoss.com/run-shell-script-linux/)![](https://itsfoss.com/content/images/thumbnail/linux-terminal.png)


![](https://itsfoss.com/content/images/thumbnail/linux-terminal.png)

Now a tiny dialogue box will pop up asking you to select the folder containing the wallpapers. Click on the “**Choose Wallpaper Folder**” button and then select the folder that you’ve stored your wallpapers in.

![Run the installer and click on the "Choose Wallpaper Folder" button.](https://itsfoss.com/content/images/2024/09/run-the-installer-and-select-the-folder-location-1.png)

That’s it. Reboot your computer.

### Using LSWC

On installation, LSWC asks you to select the folder containing your wallpapers. So I suggest you create a folder and move all the wallpapers you want to use there before we install LSWC. Or you can just use the ‘Wallpapers’ folder in the Pictures folder.

You can add more wallpapers or delete the current wallpapers from your selected folder. To change the wallpapers folder location, you can edit the location of the wallpapers in the following file.

```
.config/lswc/homepath.conf
```


### To remove LSWC

Open a terminal and [run the pkill command](https://linuxhandbook.com/pkill-command/) to stop LSWC:

```
pkill lswc
```


Then open home in your file manager and press CTRL+H to show hidden files, then delete the following files:

- The
`scripts`

directory from`.local`

directory. - The
`lswc`

directory from`.config`

directory. - The
`lswc.desktop`

file from`.config/autostart`

directory.

You can do this in terminal using the commands:

```
rm -rf ~/.config/lswc ~/.local/scripts
rm .config/autostart/lswc.desktop
```


There you have it. How to create your own desktop background slideshow. LSWC is really lightweight and simple to use. Install it and then forget it.

LSWC is not very feature rich but that intentional. It does what it intends to do and that is to change wallpapers. If you want a tool that automatically downloads wallpapers, try [WallpaperDownloader](https://itsfoss.com/wallpaperdownloader-linux/).

Do share your thoughts on this nifty little software in the comments section below. Don’t forget to share this article. Cheers.