no flip flop between last used workspace
This commit is contained in:
parent
f93a90d8f9
commit
6543416654
1 changed files with 4 additions and 0 deletions
|
@ -26,6 +26,7 @@ type
|
|||
urgent: bool
|
||||
|
||||
var my_workspaces: seq[Workspace]
|
||||
var current_workspace: int = 0
|
||||
|
||||
proc showWorkspaces()
|
||||
|
||||
|
@ -37,6 +38,7 @@ proc buildString(ws: Workspace): string =
|
|||
else:
|
||||
str &= " "
|
||||
if ws.focused or ws.application.focused:
|
||||
current_workspace = ws.num
|
||||
str &= FOCUSED
|
||||
# elif ws.visible:
|
||||
# str &= VISIBLE
|
||||
|
@ -60,6 +62,8 @@ proc switchWorkspace(workspace: string) =
|
|||
if workspace.contains("%"):
|
||||
return
|
||||
let ws = findWorkspace(workspace)
|
||||
if ws.num == current_workspace:
|
||||
return
|
||||
let cmd = "i3-msg workspace " & $ws.num
|
||||
discard execCmd(cmd)
|
||||
showWorkspaces()
|
||||
|
|
Loading…
Reference in a new issue