Giter Site home page Giter Site logo

b0o / swaynagmode Goto Github PK

View Code? Open in Web Editor NEW
44.0 6.0 2.0 31 KB

⌨ swaynag wrapper for the love of keybindings

Home Page: https://aur.archlinux.org/packages/swaynagmode

License: GNU General Public License v3.0

Shell 100.00%
sway swaywm wayland swaynag sway-nag nag i3 i3wm

swaynagmode's Introduction

swaynagmode

swaynagmode
v0.2.1
github.com/b0o/swaynagmode

A wrapper script which provides programmatic control
over swaynag, intended for use with keyboard bindings.

To create a nag, simply use swaynag options as normal - they will be parsed and passed through.

To customise a nag, use these additional options:

  short      long           description
  -M <mode>  --mode         name of sway mode to trigger on init (default: nag)
                            NOTE: beginning in sway version 1.2, mode names are case-sensitive
  -D <mode>  --mode-default name of sway mode to trigger on exit (default: default)
             --no-mode      disable triggering of sway modes
  -i <index> --initial      index of the initially selected button (default: 0)
  -K         --no-kill      don't add a kill command to the button actions
  -R         --reverse      reverse the button order

To control an existing nag, use the following options:

  short           long       description
  -x              --exit     dismisses the nag without performing any actions
  -S <prev|next>  --select   selects the previous/next button, wrapping around each end
                             (as specified in arguments left to right, buttons appear from right to
                             left)
  -C              --confirm  accepts the selected button (indicated with [brackets]) and executes its
                             action.

Global options:
  short  long       description
  -h     --help     display usage information for swaynagmode and swaynag
  -H     --help-snm display usage information for swaynagmode
  -v     --version  output version

Caveats:
  - Only one instance of swaynagmode may be run at a time.

Example sway configuration:

  # nag
  set {
    $nag         exec swaynagmode
    $nag_exit    $nag --exit
    $nag_confirm $nag --confirm
    $nag_select  $nag --select
  }
  mode "nag" {
    bindsym {
      Ctrl+d    mode "default"

      Ctrl+c    $nag_exit
      q         $nag_exit
      Escape    $nag_exit

      Return    $nag_confirm

      Tab       $nag_select prev
      Shift+Tab $nag_select next

      Left      $nag_select next
      Right     $nag_select prev

      Up        $nag_select next
      Down      $nag_select prev
    }
  }
  bindsym {
    $super+Shift+q $nag -t "warning" -m "Exit Sway?" -b "Exit" "swaymsg exit" -b "Reload" "swaymsg reload"
  }
  # -R is recommended for swaynag_command so that, upon a syntax error in your sway config, the
  # 'Reload Sway' option will be initially selected instead of the 'Exit Sway' option
  swaynag_command $nag -R


(c) 2019-2021 Maddison Hellstrom <github.com/b0o>

GPL License (https://www.gnu.org/licenses/gpl-3.0.txt)

swaynagmode's People

Contributors

b0o avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

amurrayc itspngu

swaynagmode's Issues

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.