Git Product home page Git Product logo

foundata / chocolatey-usewindow.extension Goto Github PK

View Code? Open in Web Editor NEW
5.0 1.0 0.0 45 KB

A Chocolatey extension providing helper functions for querying and focusing windows. These functions may be used in Chocolatey install and uninstall scripts. The most important function is Use-Window, which is able to focus a window and bring it to the front.

License: MIT License

PowerShell 100.00%
automation chocolatey chocolatey-community-repository powershell focus window bringtofront user32dll

chocolatey-usewindow.extension's Introduction

Use-Window extension for Chocolatey (helper to focus a window) (usewindow.extension)

This project is not associated with the official Chocolatey product or team, nor with Chocolatey Software, Inc..

A Chocolatey extension providing helper functions for querying and focusing windows. These functions may be used in Chocolatey install and uninstall scripts by declaring this package a dependency in your package's .nuspec.

The most important function is Use-Window, which is able to focus a window and bring it to the front. A script can easily switch between windows this way.

Installation

As the package is an extension, it gets usually installed automatically as a dependency. However, you can still install it manually:

choco install usewindow.extension

Usage

To create a package with the ability to use a function from this extension, add the following to your .nuspec specification:

<dependencies>
  <dependency id="usewindow.extension" version="REPLACE_WITH_MINIMUM_VERSION_USUALLY_CURRENT_LATEST" />
</dependencies>

It is possible to import the module directly in your PS >, so you can try out the main functionality directly:

# import the modules
Import-Module "${env:ChocolateyInstall}\helpers\chocolateyInstaller.psm1"
Import-Module "${env:ChocolateyInstall}\extensions\usewindow\*.psm1"

# get a list of all functions
Get-Command -Module 'usewindow.extension'

# get help and examples for a specific function
Get-Help Use-Window -Detailed
Get-Help Find-WindowHandle -Detailed

# bring the first window that contains the name 'foo' to the front and focus it
Use-Window 'foo'

# bring the first window that equals the name 'foo' to the front and focus it
Use-Window '^foo$'

# bring the first window with the handle 101010, if it exist, to the front and focus it.
Use-Window 101010

# focus the window with the handle 202020, if it exists, to the front and focus it.
Use-Window 'foo bar (202020)'

But keep in mind that functions of Chocolatey extension may only work correctly in the context of Chocolatey install and uninstall scripts.

Licensing, copyright

Copyright (c) 2018 Grégoire Geis (https://github.com/71/Focus-Window/)
Copyright (c) 2022 Refactoring UI Inc. (https://github.com/tailwindlabs/heroicons/blob/master/optimized/24/outline/window.svg)
Copyright (c) 2023, 2024 foundata GmbH (https://foundata.com)

This project is licensed under the MIT License (SPDX-License-Identifier: MIT), see LICENSES/MIT.txt for the full text.

The .reuse/dep5 file provides detailed licensing and copyright information in a human- and machine-readable format. This includes parts that may be subject to different licensing or usage terms, such as third party components. The repository conforms to the REUSE specification, you can use reuse spdx to create a SPDX software bill of materials (SBOM).

REUSE status

Author information

This Chocolatey extension is maintained by foundata. If you like it, you might buy them a coffee. This is a community project and not associated with the official Chocolatey product or team, nor with Chocolatey Software, Inc.. The core functionality is a fork of the Focus-Window PowerShell module by Grégoire Geis.

chocolatey-usewindow.extension's People

Contributors

andreashaerter avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

chocolatey-usewindow.extension's Issues

Improve development info: publishing process / push.chocolatey.org

DEVELOPMENT.md should be extended with more information about

  • additional information how to prepare the repo:
    • .nuspec version-tag
    • .nuspec releaseNotes tag if not pointing to CHANGELOG.md
  • how to release a package and push to https://push.chocolatey.org/
  • what to expect after submitting:
    • automated emails will give you up2date information about how to reach a human if needed.
    • If one has fixes, repushing the package with the exact same version is possible (unless the change we requested was based on an incorrect version)
      • This is allowed until approved.
      • Therefore, the currently described release preparation on the repo (tagging, than nuspec pushing) should be adopted. I think tagging a commit and pushing it to Github makes sense only after the it is certain that it matches the push.chocolatey.org version, including fixes which where re-pushed to push.chocolatey.org with the exact same version number.

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.