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 🙏

© 2024 – Pkg Stats / Ryan Hefner

auto-win-opacity

v1.0.6

Published

Automatically set the opacity of windows on a timer

Downloads

11

Readme

Automatic Window Opacity

I got really envious of *nix systems and their transparency options. So I decided to give myself similar control in Windows.

This provides a tool for automatically setting the opacity of different windows. Here's a screenshot of me editing this with opacity applied to Visual Studio Code.

Visual Studio Code transparency

And another with Spotify.

Spotify transparency

Tested On

  • Windows 10

Installation

npm install -g auto-win-opacity

Configuration

In the folder where it is installed, there should be a config.json. I've included a config.example.json which you can copy and rename to config.json to get started. An example configuration may look something like this:

{
  "pollInMilliseconds": 500,
  "windows": [
    {
      "pattern": "^Slack",
      "opacity": 210
    },
    {
      "pattern": "- Visual Studio Code$",
      "opacity": 230
    }
  ]
}

The configuration includes a few options:

  • pollInMilliseconds
    • This is how often to check for changes in the config file and for new windows
    • I personally have it set to run every 100 milliseconds and do not experience any issues but your mileage may vary.
  • windows
    • An array of window configuration settings.

Each window configuration setting is made up of two properties: pattern and opacity.

  • pattern
    • A string which will be interpreted as a regular expression
  • opacity
    • A number indicating how opaque the window should be
    • Valid values are from 0 to 255, inclusive
    • 0 means invisible. 255 means opaque

pattern is a string which will be converted into a regular expression. This will be matched against the title of the window. The system will look at every visible window and try to match the title against each pattern in order. As soon as a pattern matches, it will apply the matching opacity value and stop checking patterns. This is useful if you want to have different opacity settings for different states of a window. For example, say you wanted the GitHub homepage to appear transparent but everything else in the browser to be opaque. If you use Firefox, you could write something like this:

{
  "pollInMilliseconds": 100,
  "windows": [
    {
      "pattern": "^GitHub - Mozilla Firefox$",
      "opacity": 210
    },
    {
      "pattern": "- Mozilla Firefox$",
      "opacity": 255
    }
  ]
}

Usage

To start it, simply run

auto-win-opacity

To edit the config file, you can either open the config.json yourself or run

auto-win-opacity edit

Note: This will attempt to open the config in Visual Studio Code. It's my editor of choice so that's what it currently does.

If for some reason you decide it needs to stop, you can run

auto-win-opacity kill

This will stop the current process as soon as the polling periods ends.

Advanced Usage

I like to have it run at startup in the background. I went ahead and included a very, very simple batch script here that you can link to in your startup folder. By default, this will make an empty command prompt window appear. There are ways of making it run in the background which I will leave as an exercise for the reader.