Skip to content

Commit

Permalink
Add config parameter for the launch keybinding
Browse files Browse the repository at this point in the history
  • Loading branch information
yamnikov-oleg committed Feb 4, 2017
1 parent 344c369 commit 763ef7f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ Projektor configuration file is located at `~/.projektor/config.yaml`.
Here's annotation for every paramater of the default config:

```yaml
# Key bind, used by Projektor daemon. `mod4` is the Windows (Super) key.
# If your Super+Q shortcut doesn't work, edit this option.
# You can use modifier keys `shift` and `control`.
# To identify some complex keybind use `xbindkeys` tool.
keybind: mod4-q
# Searching categories, enabled for use.
# Disable a category by settings its flag to `false` and projektor will no longer
# offer you entries of that category.
Expand Down
3 changes: 3 additions & 0 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
)

type ProjektorConfig struct {
KeyBind string
EnabledCategories struct {
Calc bool
History bool
Expand All @@ -34,6 +35,8 @@ var (
func DefaultConfig() *ProjektorConfig {
c := &ProjektorConfig{}

c.KeyBind = "mod4-q"

c.EnabledCategories.Calc = true
c.EnabledCategories.History = true
c.EnabledCategories.Apps = true
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func RunDaemon() {
}
go cmd.Wait()
}
err = keybind.KeyPressFun(cb).Connect(xu, xu.RootWin(), "mod4-q", true)
err = keybind.KeyPressFun(cb).Connect(xu, xu.RootWin(), Config.KeyBind, true)
if err != nil {
log.Fatal(err)
}
Expand Down

0 comments on commit 763ef7f

Please sign in to comment.