diff --git a/flake.lock b/flake.lock index 0ad943a6..f6a24f7b 100644 --- a/flake.lock +++ b/flake.lock @@ -17,6 +17,7 @@ "original": { "owner": "ryantm", "repo": "agenix", + "rev": "0d8c5325fc81daf00532e3e26c6752f7bcde1143", "type": "github" } }, @@ -184,16 +185,16 @@ "xdph": "xdph" }, "locked": { - "lastModified": 1683130508, - "narHash": "sha256-Npf48UUfywneFYGEc7NQ59xudwvw7EJjwweT4tHguIY=", + "lastModified": 1689160271, + "narHash": "sha256-mEKF6Wcx+wSF/eos/91A7LxhFLDYhSnQnLpwZF13ntg=", "owner": "hyprwm", "repo": "Hyprland", - "rev": "f27873a6f06dc2f87600edb890f3c38298bfb55f", + "rev": "5e577acf516b80173f695a458c2cc188a4d64560", "type": "github" }, "original": { "owner": "hyprwm", - "ref": "v0.25.0", + "ref": "v0.27.0", "repo": "Hyprland", "type": "github" } diff --git a/flake.nix b/flake.nix index 4af568cd..b43c1221 100644 --- a/flake.nix +++ b/flake.nix @@ -59,7 +59,7 @@ }; # modern window compositor - hyprland.url = "github:hyprwm/Hyprland/v0.25.0"; + hyprland.url = "github:hyprwm/Hyprland/v0.27.0"; # community wayland nixpkgs nixpkgs-wayland.url = "github:nix-community/nixpkgs-wayland"; @@ -115,6 +115,7 @@ home-manager.extraSpecialArgs = x64_specialArgs; home-manager.users.ryan = import ./home/linux/x11.nix; + # home-manager.users.ryan = import ./home/linux/wayland.nix; } ]; # 星野 愛久愛海, Hoshino Akuamarin diff --git a/home/linux/base/default.nix b/home/linux/base/default.nix new file mode 100644 index 00000000..60e82c2e --- /dev/null +++ b/home/linux/base/default.nix @@ -0,0 +1,6 @@ +{ + imports = [ + ./shell.nix + ./system-tools.nix + ]; +} diff --git a/home/linux/desktop/default.nix b/home/linux/desktop/default.nix index 93393cc7..792e3a13 100644 --- a/home/linux/desktop/default.nix +++ b/home/linux/desktop/default.nix @@ -4,7 +4,10 @@ ./alacritty ./creative.nix + ./immutable-file.nix ./media.nix + ./ssh.nix + ./xdg.nix ]; home.packages = with pkgs; [ diff --git a/home/linux/base/immutable-file.nix b/home/linux/desktop/immutable-file.nix similarity index 100% rename from home/linux/base/immutable-file.nix rename to home/linux/desktop/immutable-file.nix diff --git a/home/linux/base/ssh.nix b/home/linux/desktop/ssh.nix similarity index 100% rename from home/linux/base/ssh.nix rename to home/linux/desktop/ssh.nix diff --git a/home/linux/base/xdg.nix b/home/linux/desktop/xdg.nix similarity index 100% rename from home/linux/base/xdg.nix rename to home/linux/desktop/xdg.nix diff --git a/home/linux/i3/default.nix b/home/linux/i3/default.nix index 031f46a9..6efcb0eb 100644 --- a/home/linux/i3/default.nix +++ b/home/linux/i3/default.nix @@ -11,7 +11,6 @@ ".config/i3/wallpaper.png".source = ../wallpapers/wallpaper.png; ".config/i3/config".source = ./config; ".config/i3/i3blocks.conf".source = ./i3blocks.conf; - ".config/i3/keybindings".source = ./keybindings; ".config/i3/scripts" = { source = ./scripts; # copy the scripts directory recursively diff --git a/home/linux/i3/keybindings b/home/linux/i3/keybindings deleted file mode 100644 index c54b5a17..00000000 --- a/home/linux/i3/keybindings +++ /dev/null @@ -1,106 +0,0 @@ -EndeavourOS i3wm Keybindings cheat sheet: - ---> to update this run the following command: -wget --backups=1 https://raw.githubusercontent.com/endeavouros-team/endeavouros-i3wm-setup/main/.config/i3/keybindings -P ~/.config/i3/ - -All sources and updates are available at GitHub: -https://github.com/endeavouros-team/endeavouros-i3wm-setup - -For reference consult our WIKI: -https://discovery.endeavouros.com/window-tiling-managers/i3-wm/ - - = windows key - -# start alacritty -+Return - -# kill focused window -+q - -# Application menu search by typing (fancy Rofi menu): -+d - -# Window switcher menu (fancy Rofi menu): -+t - -# fancy exit-menu on bottom right: -+Shift+e - -# Lock the system -# lock with a picture or blurring the screen (options in config) -+l - -# reload the configuration file -+Shift+c - -# restart i3 inplace (preserves your layout/session, can be used to upgrade i3) -+Shift+r - -# keybinding in fancy rofi (automated) -F1 - -# full keybinding list in editor: -+F1 - -# change window focus -+j focus left -+k focus down -+b focus up -+o focus right - -# alternatively, you can use the cursor keys: -+Left focus left -+Down focus down -+Up focus up -+Right focus right - -# move a focused window -+Shift+j move left -+Shift+k move down -+Shift+b move up -+Shift+o move right - -# alternatively, you can use the cursor keys: -+Shift+Left move left -+Shift+Down move down -+Shift+Up move up -+Shift+Right move right - -# split in horizontal orientation -+h split h - -# split in vertical orientation -+v split v - -# enter fullscreen mode for the focused container -+f fullscreen toggle - -# change container layout (stacked, tabbed, toggle split) -+s layout stacking -+g layout tabbed -+e layout toggle split - -# toggle tiling / floating -+Shift+space floating toggle - -# change focus between tiling / floating windows -+space focus mode_toggle - -# focus the parent container -+a focus parent - -# focus the child container -#+d focus child - -# resize floating window -+right mouse button - -## Multimedia Keys - -# Redirect sound to headphones -+p - -## App shortcuts -+w starts Firefox -+n starts Thunar - Button screenshot diff --git a/home/linux/server.nix b/home/linux/server.nix index 6130895a..082e3911 100644 --- a/home/linux/server.nix +++ b/home/linux/server.nix @@ -4,8 +4,7 @@ imports = [ ../base/server - ./base/shell.nix - ./base/system-tools.nix + ./server ]; # Home Manager needs a bit of information about you and the diff --git a/home/linux/wayland.nix b/home/linux/wayland.nix index 7441710f..84c209b0 100644 --- a/home/linux/wayland.nix +++ b/home/linux/wayland.nix @@ -8,11 +8,6 @@ ./fcitx5 ./desktop - - ./base/shell.nix - ./base/ssh.nix - ./base/system-tools.nix - ./base/xdg.nix ]; # Home Manager needs a bit of information about you and the diff --git a/home/linux/x11.nix b/home/linux/x11.nix index b731ed3a..cb4458d2 100644 --- a/home/linux/x11.nix +++ b/home/linux/x11.nix @@ -8,11 +8,6 @@ ./fcitx5 ./desktop - - ./base/shell.nix - ./base/ssh.nix - ./base/system-tools.nix - ./base/xdg.nix ]; # Home Manager needs a bit of information about you and the diff --git a/modules/darwin/apps.nix b/modules/darwin/apps.nix index 556373e5..26118592 100644 --- a/modules/darwin/apps.nix +++ b/modules/darwin/apps.nix @@ -120,8 +120,14 @@ # but it's not supported by macOS yet. keyboard = { enableKeyMapping = true; # enable key mapping so that we can use `option` as `control` + + # NOTE: do NOT support remap capslock to both control and escape at the same time remapCapsLockToControl = false; # remap caps lock to control - remapCapsLockToEscape = false; # remap caps lock to escape + remapCapsLockToEscape = true; # remap caps lock to escape + + # swap left command and left alt, + # so it matches common keyboard layout: `ctrl | command | alt` + swapLeftCommandAndLeftAlt = true; }; }; diff --git a/modules/nixos/core-desktop.nix b/modules/nixos/core-desktop.nix index f6295901..3481296d 100644 --- a/modules/nixos/core-desktop.nix +++ b/modules/nixos/core-desktop.nix @@ -171,6 +171,19 @@ services.gnome.gnome-keyring.enable = true; security.pam.services.greetd.enableGnomeKeyring = true; + + # A key remapping daemon for linux. + # https://github.com/rvaiya/keyd + services.keyd = { + enable = true; + settings = { + main = { + # overloads the capslock key to function as both escape (when tapped) and control (when held) + capslock = "overload(control, esc)"; + }; + }; + }; + services = { dbus.packages = [ pkgs.gcr ]; diff --git a/overlays/fcitx5/rime-data-flypy/share/rime-data/default.yaml b/overlays/fcitx5/rime-data-flypy/share/rime-data/default.yaml index 511f16ad..adfd8176 100644 --- a/overlays/fcitx5/rime-data-flypy/share/rime-data/default.yaml +++ b/overlays/fcitx5/rime-data-flypy/share/rime-data/default.yaml @@ -24,41 +24,7 @@ menu: page_size: 5 punctuator: - full_shape: - ' ' : { commit: ' ' } - ',' : { commit: , } - '.' : { commit: 。 } - '<' : [ 《, 〈, «, ‹ ] - '>' : [ 》, 〉, », › ] - '/' : { commit: 、 } - '?' : { commit: ? } - ';' : { commit: ; } - ':' : { commit: : } - '''' : { pair: [ '‘', '’' ] } - '"' : { pair: [ '“', '”' ] } - '\' : { commit: 、 } - '|' : '|' - '`' : ` - '~' : ~ - '!' : { commit: ! } - '@' : '@' - '#' : '#' - '%' : '%' - '$' : [ ¥, '$', '€', '£', '¥', '¢', '¤' ] - '^' : { commit: …… } - '&' : & - '*' : '*' - '(' : ( - ')' : ) - '-' : - - '_' : —— - '+' : + - '=' : = - '[' : [ 「, 【, 〔, [ ] - ']' : [ 」, 】, 〕, ] ] - '{' : [ 『, 〖, { ] - '}' : [ 』, 〗, } ] - half_shape: + half_shape: &half_shape ',' : { commit: , } '.' : { commit: 。 } '<' : [ 《, 〈, «, ‹ ] @@ -91,10 +57,13 @@ punctuator: # ']' : { commit: '】' } # '{' : { commit: '{' } # '}' : { commit: '}' } + # 直角空格更好看,改成它 '[' : { commit: '「' } ']' : { commit: '」' } '{' : { commit: '『' } '}' : { commit: '』' } + # 这个全宽字符非常恶心, 没啥用,老搞出全宽空格,禁用掉! + full_shape: *half_shape key_binder: bindings: @@ -132,7 +101,7 @@ key_binder: - { when: always, accept: Control+Shift+numbersign, toggle: full_shape } - { when: always, accept: Control+Shift+dollar, toggle: simplification } - { when: always, accept: Control+Shift+percent, toggle: extended_charset } - - { when: always, accept: Shift+space, toggle: full_shape } + - { when: always, accept: Shift+space, toggle: full_shape } - { when: always, accept: Control+period, toggle: ascii_punct } recognizer: diff --git a/overlays/fcitx5/rime-data-flypy/share/rime-data/flypy.schema.yaml b/overlays/fcitx5/rime-data-flypy/share/rime-data/flypy.schema.yaml index 8cf8ff74..341510c7 100644 --- a/overlays/fcitx5/rime-data-flypy/share/rime-data/flypy.schema.yaml +++ b/overlays/fcitx5/rime-data-flypy/share/rime-data/flypy.schema.yaml @@ -160,4 +160,4 @@ menu: style: horizontal: true #竖排为false - \ No newline at end of file +