-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sway: fix workspace 10 missing from default config #4636
sway: fix workspace 10 missing from default config #4636
Conversation
workspace 10 is part of upstream's default config, but was missing in home-manager. The initial "sway: add module" PR (02d6040) went through multiple iterations and had workspace 10 included for a brief moment. Until the author removed it in a force-push commenting > Have removed the last change which added bound ${modifer}+0 to workspace number 10 as this messed up workspace numbering in sway. The reason might have been, that sway used to sort the workspaces in the order they appeared in the config. Attribute sets in nix are sorted, but not "naturally sorted", meaning `bindsym Mod1+0 workspace number 10` comes before `bindsym Mod1+0 workspace number 1`. It's unclear if that's what really happened. A workaround would have been to use `lib.lists.naturalSort` in `keybindingsStr`. But I cannot reproduce this anymore in any way. I assume this has been fixed many years ago by now. upstream config: https://github.com/swaywm/sway/blob/020a572ed615b8fe272c7566a27ee0abe73a58d7/config.in#L113-L134
Thank you for your contribution! I marked this pull request as stale due to inactivity. Please read the relevant sections below before commenting. If you are the original author of the PR
If you are not the original author of the PR
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, another reason it might got left out is that the first defined workspace in keybindings is the workspace active when sway starts, but this can be controlled with defaultWorkspace already.
not stale (trying to get rid of the stale label and not sure if the review does not count for whatever reason -- might delete later, in case you wondered why you can see this comment in your mail inbox but not on github) |
* commit 'bfd0ae29': emacs: use `overrideScope` instead of `overrideScope'` flake.lock: Update imapnotify: enable STARTTLS if enabled in email account config (nix-community#5013) sway: fix workspace 10 missing from default config (nix-community#4636) zellij: use full executable path jetbrains-remote: add module neomutt: fix crypt_use_gpgme in newer versions arrpc: add module swayosd: update executable home-manager: Check VISUAL before EDITOR for editor himalaya: adjust module for v1.0.0-beta nix-gc: add service mcfly: add interfaceView option vscode: add openvscode-server kitty: always export `KITTY_SHELL_INTEGRATION` vdirsyncer: create postHook script when non-empty fish: implement shellInitLast (after others) flake.lock: Update Translate using Weblate (Turkish) hyprland: fix hyprctl crash tests: reduce closure sizes nix: fix generation of nix.conf for nix >= 2.20 xfconf: fix config loading docs: add style sheets and `scrubDerivations` tealdeer: add option to toggle update on activation home-manager: remove the export of `run` wob: add module firefox: fix darwin NativeMessagingHostsPath flake.lock: Update (nix-community#4964) network-manager-applet: add XDG data directory firefox: Reimplement FF native messaging home-manager: add extendModules attribute flake.lock: Update firefox: add default containers keepassx: remove module firefox: implement native messaging hosts treewide: deprecate `VERBOSE_ECHO` home-manager: avoid running empty `nix profile remove` treewide: deprecate `DRY_RUN_CMD` and `DRY_RUN_NULL` tealdeer: add cache update activation script zoxide: fix nushell 0.89 deprecation bemenu: allow floats in settings flake.lock: Update k9s: fix unnecessary test dependency k9s: v0.29/v0.30 compatibility mise: fix test mise: add module hyprland: change plugins settings generation mcfly: add mcfly-fzf integration hyprland: do not override existing plugins settings in config docs, tests: revert to fetchTarball for nmd and nmt gh: add github gist to default credential hosts sway: include cursor environment variables gradle: Don't enable programs.java gradle: re-add britter as maintainer flake.lock: Update flake.lock: Update flake.lock: Update firefox: restore compatibility for extraPolicies xsession: allow xplugd to restart on failure flake: update release notes URL home-manager: check profile exists in nixProfileRemove docs: use nmd from Nixpkgs tests: use nmt from Nixpkgs Remove some formatting exceptions listenbrainz-mpd: use sdnotify when possible gh: only run migration when required home-manager: internalize uninstall docs: use alternative source of nmd thunderbird: configure signature if set (nix-community#4852) Translate using Weblate (Czech) home-manager: update --version to 24.05 github: fix broken links xplr: support multiple plugins in cfg.plugins xdg-portal: add new module yazi: fix nushell integration flake.lock: Update zsh: fix zprof typo i3blocks: added configuration module lorri: unbreak due to too tight sandboxing Translate using Weblate (Ukrainian) flake.lock: Update bemenu: add module Translate using Weblate (German) zoxide: fix use with recent Nushell zsh: add support for zproof oh-my-posh: fix test under Darwin alacritty: make compatible with alacritty 0.13 gh: idempotently consider existing symlinks sftpman: add module zsh.prezto: fix path in example for 'pmoduleDirs' osmscout-server: add module gpg-agent: don't set a default for pinentry gh: test for existence of hosts file gh: include version in settings
Somehow my Sway desktop is booting to workspace 10 always since I updated my inputs, and I can't seem to know why until I found this commit. Could it be the cause? |
Yes, but I don't see you using https://nix-community.github.io/home-manager/options.xhtml#opt-wayland.windowManager.sway.config.defaultWorkspace correct? Then it's handled like explained here: #4636 (review) |
So sorry, I didn't even read the whole issue. |
Maybe it would be a good idea to set it to 1 if using mkOptionDefault in the keybindings. |
Hi, I've run into this as well - my default workspace being changed to 10. This is manageable on single display environments, where you can change the default workspace to be 1 explicitly, but this does not work with multi monitor setups. When i connect my laptop to a monitor, the laptop screen is workspace 1 but the monitor is workspace 10 instead of workspace 2. How could I workaround this? |
Guess we could use |
I'm not sure how to manually test it on my local machine without switching my hm input but i'd be up to try it |
hmm turns out throwing |
is it possible to add |
Why don't we just set a default value for |
Because it would not fix the ordering issue on multi-monitor setups. See #4636 (comment) |
workspace 10 is part of upstream's default config, but was missing in home-manager. The initial "sway: add module" PR (02d6040) went through multiple iterations and had workspace 10 included for a brief moment. Until the author removed it in a force-push commenting > Have removed the last change which added bound ${modifer}+0 to workspace number 10 as this messed up workspace numbering in sway. The reason might have been, that sway used to sort the workspaces in the order they appeared in the config. Attribute sets in nix are sorted, but not "naturally sorted", meaning `bindsym Mod1+0 workspace number 10` comes before `bindsym Mod1+0 workspace number 1`. It's unclear if that's what really happened. A workaround would have been to use `lib.lists.naturalSort` in `keybindingsStr`. But I cannot reproduce this anymore in any way. I assume this has been fixed many years ago by now. upstream config: https://github.com/swaywm/sway/blob/020a572ed615b8fe272c7566a27ee0abe73a58d7/config.in#L113-L134
Description
workspace 10 is part of upstream's default config, but was missing in home-manager.
The initial "sway: add module" PR (#829, 02d6040) went through multiple iterations and had workspace 10 included for a brief moment. Until the author removed it in a force-push commenting
#829 (comment)
The reason might have been, that sway used to sort the workspaces in the order they appeared in the config.
Attribute sets in nix are sorted, but not "naturally sorted", meaning
bindsym Mod1+0 workspace number 10
comes beforebindsym Mod1+0 workspace number 1
.It's unclear if that's what really happened. A workaround would have been to use
lib.lists.naturalSort
inkeybindingsStr
.But I cannot reproduce this anymore in any way.
I assume this has been fixed many years ago by now.
upstream config: https://github.com/swaywm/sway/blob/020a572ed615b8fe272c7566a27ee0abe73a58d7/config.in#L113-L134
Checklist
Change is backwards compatible.
Code formatted with
./format
.Code tested through
nix-shell --pure tests -A run.all
ornix develop --ignore-environment .#all
using Flakes.Test cases updated/added. See example.
Commit messages are formatted like
See CONTRIBUTING for more information and recent commit messages for examples.
If this PR adds a new module
Maintainer CC
@Scrumplex @alexarice @sumnerevans @SebTM @oxalica