wallpaper manager

So, I have been looking for a wallpaper manager with some features like:

1) automatically change wallpaper from my directory list

2) Get wallpapers from internet

Possibly display time and a quote.


Variety does all of that. From variety website :

Variety is a wallpaper manager for Linux systems. It supports numerous desktops and wallpaper sources, including local files and online services: Flickr, Wallhaven, Unsplash, and more.

Where supported, Variety sits as a tray icon to allow easy pausing and resuming. Otherwise, its desktop entry menu provides a similar set of options.

Variety also includes a range of image effects, such as oil painting and blur, as well as options to layer quotes and a clock onto the background.

To install

dnf install variety

xev – Check the X keyboard events

xev man page

xev – print contents of X events

So other day I was checking why my play key was not working and wanted to check if it maps to one of the X default mappings for the keyboard and was stuck on how to check this. And finally found that I can try this:


xev -event keyboard

Pretty neat 🙂

Get to your ebooks quickly

So this is going to be a little longer post than usual.

To begin with, here is screenshot of how it would look like finally:

We are using “rofi” here to show the menu. So, lets first install that

cat <<EOF >/etc/yum.repos.d/_copr_yaroslav-i3desktop.repo 
name=Copr repo for i3desktop owned by yaroslav

yum install rofi
Once that is done, we will create a small script to look for all our pdf files and display that in the menu, like above. Save this as ~/bin/books-search.sh :
#!/usr/bin/env bash
# wget 'https://raw.githubusercontent.com/miroslavvidovic/rofi-scripts/master/books-search/books-search.sh'

# -----------------------------------------------------------------------------
# Info:
#   author:    Miroslav Vidovic
#   file:      books-search.sh
#   created:   13.08.2017.-08:06:54
#   revision:  ---
#   version:   1.0
# -----------------------------------------------------------------------------
# Requirements:
#   rofi
# Description:
#   Use rofi to search my books.
# Usage:
#   books-search.sh
# -----------------------------------------------------------------------------
# Script:
# Modified by Amit Agarwal

# Books directory

# Save find result to F_ARRAY
readarray -t F_ARRAY <<< "$(find "$BOOKS_DIR" -type f -name '*.pdf')"

# Associative array for storing books
# key => book name
# value => absolute path to the file
# BOOKS['filename']='path'
declare -A BOOKS

# Add elements to BOOKS array
get_books() {
    for i in "${!F_ARRAY[@]}"
        file=$(basename "${F_ARRAY[$i]}")

# List for rofi
    for i in "${!BOOKS[@]}"
      echo "$i"

main() {
 book=$( (gen_list) | rofi -dmenu -lines 10 -width 100 -i -matching 
fuzzy -only-match -location 0 -fake-transparency -p "Book > " )
  book=$( (gen_list) | rofi -dmenu -i -matching fuzzy -only-match -p "Book > " )
  xdg-open "${BOOKS[$book]}"

exit 0
In the above script, change the BOOKS_DIR to the one that you would like to see. And finally make some cosmetic changes:
cat <<EOF >~/.Xresources 
rofi.color-enabled: true
rofi.opacity:                        50
rofi.width:                          100
rofi.lines:                          10
rofi.columns:                        4
rofi.font:                           System San Francisco Display 8
rofi.color-normal:                   #fdf6e3,#002b36,#eee8d5,#586e75,#eee8d5
rofi.color-urgent:                   #fdf6e3,#dc322f,#eee8d5,#dc322f,#fdf6e3
rofi.color-active:                   #fdf6e3,#268bd2,#eee8d5,#268bd2,#fdf6e3
rofi.color-window:                   #fdf6e3,#002b36
rofi.yoffset:                        0
rofi.xoffset:                        0
rofi.fixed-num-lines:                false
rofi.terminal:                       rofi-sensible-terminal
rofi.ssh-client:                     ssh
rofi.ssh-command:                    {terminal} -e {ssh-client} {host}
rofi.run-command:                    {cmd}
rofi.run-shell-command:              {terminal} -e {cmd}
rofi.window-command:                 xkill -id {window}
rofi.disable-history:                false
rofi.levenshtein-sort:               false
rofi.case-sensitive:                 false
rofi.cycle:                          true
rofi.sidebar-mode:                   false
rofi.auto-select:                    false
rofi.parse-hosts:                    true
rofi.parse-known-hosts:              true
rofi.combi-modi:                     window,run
rofi.fuzzy:                          true
rofi.glob:                           false
rofi.regex:                          false
rofi.tokenize:                       true
rofi.m:                              -1
rofi.line-margin:                    2
rofi.separator-style:                dash
rofi.hide-scrollbar:                 false
rofi.fullscreen:                     false
rofi.fake-transparency:              true
rofi.dpi:                            -1
rofi.threads:                        1
rofi.scrollbar-width:                8
rofi.scroll-method:                  0
rofi.fake-background:                screenshot

xrdb -merge ~/.Xresources
Finally for easy access, you might want to bind a key to lauch the script that we created and voila.