GithubHelp home page GithubHelp logo

channel-42 / wppfzf Goto Github PK

View Code? Open in Web Editor NEW
8.0 1.0 0.0 4.06 MB

Browse and download images from reddit

License: GNU General Public License v3.0

Shell 96.32% Makefile 3.68%
cli fzf command-line bash ueberzug

wppfzf's Introduction

wppfzf

Browse and download images from reddit with fzf and ueberzug

demo gif

Content

  1. Installation
  2. Usage
  3. Theming
  4. Notes

Installation

Arch

To install the AUR package, use your AUR-helper of choice. For example:

paru -S wppfzf

General

Dependencies

  • bash
  • fzf
  • ueberzug

Install the necessary dependencies first. Then, get the latest release by running:

wget "https://github.com/channel-42/wppfzf/archive/v0.1.0.tar.gz" \
-O $HOME/wppfzf.tar.gz
mkdir $HOME/.wppfzf_d
tar -zxvf wppfzf.tar.gz -C $HOME/.wppfzf_d --strip-components 1
rm -f $HOME/wppfzf.tar.gz
cd $HOME/.wppfzf_d && sudo make install

You can specify the installation directory by using sudo make DESTDIR=/your/dir PREFIX="" install

Alternatively, to get the bleeding edge version (i.e. HEAD) run:

sudo wget "https://raw.githubusercontent.com/channel-42/wppfzf/master/wppfzf" \
-O /usr/bin/wppfzf
sudo chmod +x /usr/bin/wppfzf

Usage

All cli options are shown and explained when running wppfzf -h

To start a simple query, run wppfzf with no arguments. This will use the defaults. Each line shows the posts title as well as the number of up- and downvotes.

  • To open the currently selected image in your default image-viewer, press ctrl-p.
  • To download the currently selected image, press ENTER.
  • Press ESC to quit wppfzf.

To search a specific subreddit, use the -r option, -l N will limit the api query to N posts.

Note that less images may be show in wppfzf itself due to filtering of incompatible posts (e.g. imgur albums).

wppfzf defaults to searching the last 20 posts of r/wallpapers and saving desired images to $HOME/Pictures. These settings, as well as the default preview window size and location, can be temporarily changed through the cli arguments.

To make these changes permanent, the script itself has to be edited. The settings are located at the top of the script:

# query limit 
LIMIT=20
# default subreddit to search
SUBREDDIT="wallpapers"
# dir to save images to
declare -x WPP_FZF_DL_DIR=$HOME/Pictures
# default preview position
declare -x DEFAULT_PREVIEW_POSITION="up"
# default preview size
declare -x DEFAULT_PREVIEW_SIZE="60%"

Theming

Theming the fzf interface is done at the top of the script itself. To see all available color options, refer to fzf's man page.

# default interface colors: 'option:term_color_code'
COLOR_OPTS="bg+:0,fg:7,fg+:1,border:8,hl+:2,prompt:14,hl:2,pointer:6,info:8,spinner:6"

Notes

This project is made possible through both fzf and ueberzug.

wppfzf's People

Contributors

channel-42 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.