-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
1,671 additions
and
449 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: goreleaser | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
goreleaser: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- | ||
name: Set up Go | ||
uses: actions/setup-go@v4 | ||
- | ||
name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v5 | ||
with: | ||
distribution: goreleaser | ||
version: latest | ||
args: release --clean | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,4 +46,6 @@ go.work | |
/.dev | ||
/sway-yast | ||
/test.sh | ||
/data.txt | ||
/data.txt | ||
|
||
/dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
builds: | ||
- id: "sway-yast" | ||
main: "./cmd/sway-yast/main.go" | ||
binary: "sway-yast" | ||
goos: | ||
- linux | ||
goarch: | ||
- 386 | ||
- amd64 | ||
- arm64 | ||
goarm: | ||
- 7 | ||
|
||
release: | ||
github: | ||
owner: pancsta | ||
name: sway-yast | ||
draft: true | ||
replace_existing_draft: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
## v0.1.0 | ||
- mouse follows focus | ||
- pick space | ||
- pick win | ||
- run path | ||
- live config changes | ||
|
||
## v0.0.1 | ||
- initial release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"io" | ||
"log" | ||
"os" | ||
|
||
"github.com/pancsta/sway-yast/internal/cmd" | ||
"github.com/pancsta/sway-yast/internal/daemon" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
func main() { | ||
// TODO --status (PID, config, windows count) | ||
// TODO readme, screenshots | ||
// TODO auto bind default shortcuts via --bind-default-keys | ||
// alt+tab, cmd+o, cmd+p | ||
// TODO include desktop shortcuts in "path" (Name, Exe) | ||
// - ~/.local/share/applications | ||
// - /usr/share/applications | ||
if os.Getenv("YAST_LOG") == "" { | ||
log.SetOutput(io.Discard) | ||
} | ||
cmdDaemon := &cobra.Command{ | ||
Use: "daemon", | ||
Short: "Start tracking focus in sway", | ||
Run: func(cmd *cobra.Command, args []string) { | ||
mouseFollow, _ := cmd.Flags().GetBool("mouse-follows-focus") | ||
autoconfig, _ := cmd.Flags().GetBool("autoconfig") | ||
defaultKeybindings, _ := cmd.Flags().GetBool("default-keybindings") | ||
d := &daemon.Daemon{ | ||
MouseFollowsFocus: mouseFollow, | ||
Autoconfig: autoconfig, | ||
DefaultKeybindings: defaultKeybindings, | ||
} | ||
if mouseFollow { | ||
log.Println("Mouse follows focus enabled") | ||
} | ||
d.Start() | ||
}, | ||
} | ||
// TODO extract | ||
cmdDaemon.Flags().Bool("mouse-follows-focus", false, | ||
"Calls 'input ... map_to_output OUTPUT' on each focus") | ||
cmdDaemon.Flags().Bool("autoconfig", true, | ||
"Automatic configuration of layout") | ||
cmdDaemon.Flags().Bool("default-keybindings", false, | ||
"Add default keybindings") | ||
|
||
cmdList := &cobra.Command{ | ||
Use: "mru-list", | ||
Short: "Print a list of MRU window IDs", | ||
Run: func(cmd *cobra.Command, args []string) { | ||
fmt.Print(daemon.RemoteCall("Daemon.RemoteWinList", daemon.RPCArgs{})) | ||
}, | ||
} | ||
|
||
cmdFzf := &cobra.Command{ | ||
Use: "fzf", | ||
Short: "Run fzf with a list of windows", | ||
Run: cmd.CmdFzf, | ||
} | ||
|
||
cmdFzfPickWin := &cobra.Command{ | ||
Use: "fzf-pick-win", | ||
Short: "Run fzf with a list of windows to pick", | ||
Run: cmd.CmdFzfPickWin, | ||
} | ||
|
||
cmdFzfPickSpace := &cobra.Command{ | ||
Use: "fzf-pick-space", | ||
Short: "Run fzf with a list of workspaces to pick", | ||
Run: cmd.CmdFzfPickSpace, | ||
} | ||
|
||
cmdFzfPath := &cobra.Command{ | ||
Use: "fzf-path", | ||
Short: "Run fzf with a list of executable files from PATH", | ||
Run: cmd.CmdFzfPath, | ||
} | ||
|
||
cmdSwitcher := &cobra.Command{ | ||
Use: "switcher", | ||
Short: "Show the switcher window using foot", | ||
Run: cmd.CmdSwitcher, | ||
} | ||
|
||
cmdPickWin := &cobra.Command{ | ||
Use: "pick-win", | ||
Short: "Show the window picker using foot", | ||
Run: cmd.CmdPickWin, | ||
} | ||
|
||
cmdPickSpace := &cobra.Command{ | ||
Use: "pick-space", | ||
Short: "Show the workspace picker using foot", | ||
Run: cmd.CmdPickSpace, | ||
} | ||
|
||
cmdPath := &cobra.Command{ | ||
Use: "path", | ||
Short: "Show the +x files from PATH using foot", | ||
Run: cmd.CmdPath, | ||
} | ||
|
||
cmdConfig := &cobra.Command{ | ||
Use: "config", | ||
Short: "Change the config of a running daemon process", | ||
Run: cmd.CmdConfig, | ||
} | ||
// TODO extract | ||
cmdConfig.Flags().Bool("mouse-follows-focus", false, | ||
"Calls 'input ... map_to_output OUTPUT' on each focus") | ||
|
||
var rootCmd = &cobra.Command{ | ||
Use: "sway-yast", | ||
Run: cmd.CmdRoot, | ||
} | ||
rootCmd.AddCommand(cmdDaemon, cmdList, cmdFzf, cmdSwitcher, cmdFzfPickWin, cmdPickWin, cmdConfig, cmdFzfPickSpace, | ||
cmdPickSpace, cmdPath, cmdFzfPath) | ||
rootCmd.Flags().Bool("version", false, | ||
"Print version and exit") | ||
|
||
err := rootCmd.Execute() | ||
if err != nil { | ||
log.Fatal("cobra error:", err) | ||
} | ||
} |
Oops, something went wrong.