Prerequisites
- fzf : fuzzy finder
- zsh : zShell alternative to BASH
- omz : zsh package manager
- find : Finder
- fd : alternative to find (Optional)
fzf
First install fzf on your system from the following instructions:
https://github.com/junegunn/fzf
zsh
If you are a Linux user:
sudo apt install zsh
For other distros:
https://github.com/ohmyzsh/ohmyzsh/wiki/Installing-ZSH
omz
For omz installation:
https://github.com/ohmyzsh/ohmyzsh
Coding The Wallpaper Changer Function
CD
# I am using nvim, you can perform this operation with any text editor (nano, pico, gedit etc.).
nvim .zshrc
Find the file named .zshrc
on your system and add the following code block to the bottom line:
# change desktop wallpaper
changewall(){
gsettings set org.gnome.desktop.background picture-uri "$(find ~/Pictures -type f | ff)"
}
Explanation
-
gsettings
: It is the command that makes system settings for GNOME -
set
: specifies the value to be assigned to the operations to be performed -
org.gnome.desktop.background
: indicates that changes will be made to the background within the system. -
picture-uri
: indicates the point in the system where the path to the file to be changed is located. -
find
: Used to find the full file path of the file.-type f
indicates that the file is being searched. -
fzf
: the tool we will use to search for files
Top comments (0)
Some comments may only be visible to logged-in visitors. Sign in to view all comments. Some comments have been hidden by the post's author - find out more