npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

hyper-random-background

v1.0.4

Published

Set background with random images every time interval

Readme

hyper-random-background

Set background with random images every time interval.

Install

npm i hyper-random-background

Dependencies

image-size

This script is tested only on Linux, so performance is not guaranteed on Windows or MacOS.

Usage

Add config to ~/.hyper.js, and here is an example:

module.exports = {
  ...
  config: {
    ...
    // It is recommended to add transparency to default backgroundColor
    backgroundColor: 'rgba(0, 0, 0, 0.9)',
    ...
    backgroundImage: {
      default: "default",
      profiles: {
        none: {}, // Option for no backgrounds
        default: {
          path: "/path/to/your/directory",
          overlayColor: "rgba(0, 0, 0, 0.7)",
          interval: 600,
          fade: true,
          blur: "5px",
          switchBackgroundKey: "CmdOrCtrl+Shift+S",
        },
        home: {
          path: "/path/to/your/config/list",
          overlayColor: "rgba(0, 0, 0, 0.5)",
          interval: 10,
          fade: false,
          blur: "0px",
          switchBackgroundKey: "CmdOrCtrl+Shift+B",
        },
      }
    },
  },
  ...
  plugins: [
    ...
    "hyper-random-background",
  ],
  ...
}

You can use multiple background profiles. To achieve this, you can add field in backgroundImage.profiles with key as the name you want to display, and value as config of the profile. Then set backgroundImage.default with the default profile key you want to use. A profile contains following fields:

|Key|Value| |--- |--- | |path|Path to directory or config file| |overlayColor|Overlay color in front of the image, default: "rgba(0, 0, 0, 0.7)"| |interval|Time interval in second to change background, default: 600| |fade|Whether use fade effect when switching background, default: true| |blur|Size of blur effect, default: "0px"| |switchBackgroundKey|Keyboard shortcut switching to next image, default: "CmdOrCtrl+Shift+S"|

If the path is specified as a directory, then all image files will be fetched from that directory (not including sub-directories) as random source. If the path is specified as a file, that file is regarded as a config file. A config file should contain all paths you want to choose, one in a line. Similarly, if path in the config file is a directory, all image files will be extracted from that directory (not including sub-directories); If path is a file, that file will be regarded as a valid image file. Do not include invalid path or extra characters like comments. A sample config file looks like:

/home/remisiki/Pictures/r0/1234567.jpg
/run/media/remisiki/MyDisk/Backup/20221014.png
/mnt/mediacc/random/images/

If the image is horizontal, then it will be placed in the center and fills to the whole screen. If the image is vertical, another vertical image will be aligned to it, so that two vertical images will fill the screen side by side. This is assuming that most users resize their windows horizontally. If only one vertical image can be found, then it will be placed in the center and fills to the whole screen.

This plugin provides an in-app menu entry which can be accessed by clicking the hamburger button or Alt+F. You can switch your current profiles as well as randomly pick next image in-time, or open current background through system default image viewer.

Menu demo