DEV Community

gokayburuc.dev
gokayburuc.dev

Posted on • Edited on

Changing Wallpaper from Terminal using fzf and zsh

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
Enter fullscreen mode Exit fullscreen mode

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

Enter fullscreen mode Exit fullscreen mode

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)"
}
Enter fullscreen mode Exit fullscreen mode

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

result

Peek-2024-02-12-16-43

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read more →

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

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more