LGUG2Z / komorebi

A tiling window manager for Windows 🍉
https://lgug2z.github.io/komorebi/
Other
9.58k stars 198 forks source link

[BUG]: Komrebi Bar configurations not being loaded correctly #1079

Open H7ioo opened 1 month ago

H7ioo commented 1 month ago

Summary

Komorebi bar's few configurations don't apply correctly on the komorebic start --whkd --bar command

Bug video demo

Version Information

OS Name: Microsoft Windows 11 Home Single Language OS Version: 10.0.22631 N/A Build 22631

komorebic 0.1.29 tag:v0.1.29 commit_hash:818ac340 build_time:2024-09-28 01:48:31 +00:00 build_env:rustc 1.81.0 (eeb90cda1 2024-09-04),stable-x86_64-pc-windows-msvc

Komorebi Configuration

Komorebi.json

{
  "$schema": "https://raw.githubusercontent.com/LGUG2Z/komorebi/v0.1.25/schema.json",
  "app_specific_configuration_path": "$Env:USERPROFILE/applications.yaml",
  "window_hiding_behaviour": "Cloak",
  "cross_monitor_move_behaviour": "Insert",
  "default_workspace_padding": 10,
  "default_container_padding": 10,
  "border": true,
  "border_width": 8,
  "border_offset": -1,
  "border_colours": {
    "single": "#42a5f5",
    "stack": "#00a542",
    "monocle": "#ff3399",
    "unfocused": "#808080"
  },
  "float_rules": [
    { "id": "Everything", "kind": "Title", "matching_strategy": "Contains" },
    { "id": "ShareX", "kind": "Title", "matching_strategy": "Contains" },
    { "id": "HD-Player.exe", "kind": "Exe", "matching_strategy": "Contains" },
    { "id": "HD-Player", "kind": "Exe", "matching_strategy": "Contains" },
    {
      "id": "Photoshop",
      "kind": "Exe",
      "matching_strategy": "Contains"
    },
    {
      "id": "VLC media player",
      "kind": "Title",
      "matching_strategy": "Contains"
    }
  ],
  "stackbar": {
    "height": 40,
    "mode": "OnStack",
    "tabs": {
      "width": 300,
      "focused_text": "#00a542",
      "unfocused_text": "#b3b3b3",
      "background": "#141414"
    }
  },
  "monitors": [
    {
      "workspaces": [
        {
          "name": "I",
          "layout": "BSP"
        },
        {
          "name": "II",
          "layout": "BSP"
        },
        {
          "name": "III",
          "layout": "BSP"
        },
        {
          "name": "IV",
          "layout": "BSP"
        },
        {
          "name": "V",
          "layout": "BSP"
        },
        {
          "name": "VI",
          "layout": "BSP"
        },
        {
          "name": "VII",
          "layout": "BSP"
        }
      ]
    }
  ]
}

Komorebi.bar.json

{
  "$schema": "https://raw.githubusercontent.com/LGUG2Z/komorebi/v0.1.29/schema.bar.json",
  "monitor": {
    "index": 0,
    "work_area_offset": {
      "left": 0,
      "top": 10,
      "right": 0,
      "bottom": 10
    }
  },
  "font_family": "JetBrains Mono",
  "theme": {
    "palette": "Base16",
    "name": "Ashes",
    "accent": "Base0D"
  },
  "font_size": 9,
  "viewport": {
    "inner_size": {
      "x": 1920,
      "y": 10
    }
  },

  "frame": {
    "inner_margin": {
      "x": 15,
      "y": 0
    }
  },

  "left_widgets": [
    {
      "Komorebi": {
        "workspaces": {
          "enable": true,
          "hide_empty_workspaces": false
        },
        "layout": {
          "enable": true
        },
        "focused_window": {
          "enable": true,
          "show_icon": true
        }
      }
    }
  ],
  "right_widgets": [
    {
      "Media": {
        "enable": true
      }
    },
    {
      "Memory": {
        "enable": true
      }
    },
    {
      "Network": {
        "enable": true,
        "show_total_data_transmitted": true,
        "show_network_activity": true
      }
    },
    {
      "Date": {
        "enable": true,
        "format": "DayDateMonthYear"
      }
    },
    {
      "Time": {
        "enable": true,
        "format": "TwentyFourHour"
      }
    }
  ]
}
### Hotkey Configuration
.shell powershell

# Reload whkd configuration
# alt + o                 : taskkill /f /im whkd.exe && start /b whkd # if shell is cmd
alt + o                 : taskkill /f /im whkd.exe; Start-Process whkd -WindowStyle hidden # if shell is pwsh / powershell
alt + shift + o         : komorebic reload-configuration

# App shortcuts - these require shell to be pwsh / powershell
# The apps will be focused if open, or launched if not open
# alt + f                 : if ($wshell.AppActivate('Firefox') -eq $False) { start firefox }
# alt + b                 : if ($wshell.AppActivate('Chrome') -eq $False) { start chrome }

alt + q                 : komorebic close
alt + m                 : komorebic minimize

# Focus windows
alt + h                 : komorebic focus left
alt + j                 : komorebic focus down
alt + k                 : komorebic focus up
alt + l                 : komorebic focus right
alt + shift + oem_4     : komorebic cycle-focus previous # oem_4 is [
alt + shift + oem_6     : komorebic cycle-focus next # oem_6 is ]

# Move windows
alt + shift + h         : komorebic move left
alt + shift + j         : komorebic move down
alt + shift + k         : komorebic move up
alt + shift + l         : komorebic move right
alt + shift + return    : komorebic promote

# Stack windows
alt + left              : komorebic stack left
alt + down              : komorebic stack down
alt + up                : komorebic stack up
alt + right             : komorebic stack right
alt + oem_1             : komorebic unstack # oem_1 is ;
alt + oem_4             : komorebic cycle-stack previous # oem_4 is [
alt + oem_6             : komorebic cycle-stack next # oem_6 is ]

# Resize
alt + oem_plus          : komorebic resize-axis horizontal increase
alt + oem_minus         : komorebic resize-axis horizontal decrease
alt + shift + oem_plus  : komorebic resize-axis vertical increase
alt + shift + oem_minus : komorebic resize-axis vertical decrease

# Manipulate windows
alt + t                 : komorebic toggle-float
alt + shift + f         : komorebic toggle-monocle

# Window manager options
alt + shift + r         : komorebic retile
alt + p                 : komorebic toggle-pause

# Layouts
alt + x                 : komorebic flip-layout horizontal
alt + y                 : komorebic flip-layout vertical

# Workspaces
alt + 1                 : komorebic focus-monitor-workspace 0 0 ; komorebic focus-monitor-workspace 1 0
alt + 2                 : komorebic focus-monitor-workspace 0 1 ; komorebic focus-monitor-workspace 1 1
alt + 3                 : komorebic focus-monitor-workspace 0 2 ; komorebic focus-monitor-workspace 1 2
alt + 4                 : komorebic focus-monitor-workspace 0 3 ; komorebic focus-monitor-workspace 1 3
alt + 5                 : komorebic focus-monitor-workspace 0 4 ; komorebic focus-monitor-workspace 1 4
alt + 6                 : komorebic focus-monitor-workspace 0 5 ; komorebic focus-monitor-workspace 1 5
alt + 7                 : komorebic focus-monitor-workspace 0 6 ; komorebic focus-monitor-workspace 1 6
alt + 8                 : komorebic focus-monitor-workspace 0 7 ; komorebic focus-monitor-workspace 1 7

# Move windows across workspaces
alt + shift + 1         : komorebic move-to-workspace 0 ; komorebic focus-monitor-workspace 0 0 ; komorebic focus-monitor-workspace 1 0
alt + shift + 2         : komorebic move-to-workspace 1 ; komorebic focus-monitor-workspace 0 1 ; komorebic focus-monitor-workspace 1 1
alt + shift + 3         : komorebic move-to-workspace 2 ; komorebic focus-monitor-workspace 0 2 ; komorebic focus-monitor-workspace 1 2
alt + shift + 4         : komorebic move-to-workspace 3 ; komorebic focus-monitor-workspace 0 3 ; komorebic focus-monitor-workspace 1 3
alt + shift + 5         : komorebic move-to-workspace 4 ; komorebic focus-monitor-workspace 0 4 ; komorebic focus-monitor-workspace 1 4
alt + shift + 6         : komorebic move-to-workspace 5 ; komorebic focus-monitor-workspace 0 5 ; komorebic focus-monitor-workspace 1 5
alt + shift + 7         : komorebic move-to-workspace 6 ; komorebic focus-monitor-workspace 0 6 ; komorebic focus-monitor-workspace 1 6
alt + shift + 8         : komorebic move-to-workspace 7 ; komorebic focus-monitor-workspace 0 7 ; komorebic focus-monitor-workspace 1 7

Output of komorebic check

No KOMOREBI_CONFIG_HOME detected, defaulting to C:\Users\omarj

Looking for configuration files in C:\Users\omarj

Found komorebi.json; this file can be passed to the start command with the --config flag

Found C:\Users\omarj\.config\whkdrc; key bindings will be loaded from here when whkd is started, and you can start it automatically using the --whkd flag
LGUG2Z commented 1 month ago

Hello and thanks for the report. There are currently a bunch of fixes for various bar issues on the latest nightly release.

To avoid duplicating effort please first confirm if you can reproduce these issues on the nightly release.

H7ioo commented 1 month ago

Sure!

Summary

Steps Taken

  1. Removed current installation

  2. Downloaded Nightly. (That Rust build took forever ngl.)

  3. Made sure that I'm using the nightly version

    komorebic 0.1.30
    tag:nightly
    commit_hash:09afad62
    build_time:2024-10-22 14:49:49 +03:00
    build_env:rustc 1.82.0 (f6e511eec 2024-10-15),stable-x86_64-pc-windows-msvc
  4. Got the following error: Your bar configuration file contains some options that have been renamed or deprecated "viewport" is now "position"

  5. Updated "viewport" to "position" and made y:20 instead of y: 10 because the old (y:10) cut the bar in half. Schema.bar.json

    
    {
    "$schema": "https://raw.githubusercontent.com/LGUG2Z/komorebi/v0.1.29/schema.bar.json",
    "monitor": {
    "index": 0,
    "work_area_offset": {
      "left": 0,
      "top": 10,
      "right": 0,
      "bottom": 10
    }
    },
    "font_family": "JetBrains Mono",
    "theme": {
    "palette": "Base16",
    "name": "Ashes",
    "accent": "Base0D"
    },
    "font_size": 9,
    "position": {
    "inner_size": {
      "x": 1920,
      "y": 20
    }
    },
    
    "frame": {
    "inner_margin": {
      "x": 15,
      "y": 0
    }
    },
    
    "left_widgets": [
    {
      "Komorebi": {
        "workspaces": {
          "enable": true,
          "hide_empty_workspaces": false
        },
        "layout": {
          "enable": true
        },
        "focused_window": {
          "enable": true,
          "show_icon": true
        }
      }
    }
    ],
    "right_widgets": [
    {
      "Media": {
        "enable": true
      }
    },
    {
      "Memory": {
        "enable": true
      }
    },
    {
      "Network": {
        "enable": true,
        "show_total_data_transmitted": true,
        "show_network_activity": true
      }
    },
    {
      "Date": {
        "enable": true,
        "format": "DayDateMonthYear"
      }
    },
    {
      "Time": {
        "enable": true,
        "format": "TwentyFourHour"
      }
    }
    ]
    }


Thanks for the awesome project by the way. 
xidsyed commented 1 week ago

I have been facing the same problem. I have some position configurations specified in my Json file that don't get applied unless I reopen vs code and press ctrl + s to re-save the komkorebi-bar.json file to have the bar update to the correct position.

do the configurations not get loaded when the bar gets launched?

H7ioo commented 1 week ago

Which version are you running?

xidsyed commented 1 week ago
komorebi 0.1.30
tag:v0.1.30
commit_hash:9a3dbccc
build_time:2024-11-03 23:49:52 +00:00
build_env:rustc 1.82.0 (f6e511eec 2024-10-15),stable-x86_64-pc-windows-msvc
Looking for configuration files in C:\Users\mmsye

Found komorebi.json; this file can be passed to the start command with the --config flag

Found C:\Users\mmsye\.config\whkdrc; key bindings will be loaded from here when whkd is started, and you can start it automatically using the --whkd flag
xidsyed commented 1 week ago

it's interesting that everything else gets loaded correctly on bar start except for the position configurations, in my case:

  "position": {
    "start": {
      "x": 0,
      "y": -10
    },
    "end": {
      "x": 1920,
      "y": 45
    }

probably a little bug somehwere @LGUG2Z take a look at this when u can pretty please 🥹