diff --git a/nixcfgs/flake.lock b/nixcfgs/flake.lock index 149535a..b86886e 100644 --- a/nixcfgs/flake.lock +++ b/nixcfgs/flake.lock @@ -137,11 +137,11 @@ ] }, "locked": { - "lastModified": 1766195958, - "narHash": "sha256-YGawjW7RDzzOEiovrRGyRoXfjISbgLz4BVN9ZMb8LEc=", + "lastModified": 1766714789, + "narHash": "sha256-hmhLNI09u6QJoGkS7ur+wgc1z2LYb3jQP0wB3qwyrLU=", "owner": "caelestia-dots", "repo": "cli", - "rev": "8c83ae1e6a60de7d496d346bf3623f789a9f53e3", + "rev": "b049cb17496b622917d41c057c78b3aa5d885a1a", "type": "github" }, "original": { @@ -159,11 +159,11 @@ "quickshell": "quickshell" }, "locked": { - "lastModified": 1766280311, - "narHash": "sha256-Ty4GT6EaQFaL9E/dKcJB1Q30ByGkxXV6U1eu8+PS5Dc=", + "lastModified": 1766885627, + "narHash": "sha256-Ux+D5mjfLEMQfCaG9g4TGKgBsQ/oVjo1613/m7Uk/5Y=", "owner": "caelestia-dots", "repo": "shell", - "rev": "66e509ae488b2c0468f2c803fd34c2625ca725dc", + "rev": "dfa28d7f85215bd42d02717255c45b8126aeb8da", "type": "github" }, "original": { @@ -250,11 +250,11 @@ ] }, "locked": { - "lastModified": 1766278788, - "narHash": "sha256-vjhg2yy/FOxGok4Vk7qEYd3EhrBfxNSLUIZ2QIjIBD0=", + "lastModified": 1766970058, + "narHash": "sha256-9CSlpJPd09DQGStRJjRhtSEOU6dGnmnSNdWHR9uQP4s=", "owner": "petrkozorezov", "repo": "firefox-addons-nix", - "rev": "c06109c10bfd1736c5ededd34d9b9f3ef090c7de", + "rev": "cb708ed2e3305af20bd132ec61df8f05fdf3b9a3", "type": "github" }, "original": { @@ -490,11 +490,11 @@ ] }, "locked": { - "lastModified": 1766282146, - "narHash": "sha256-0V/nKU93KdYGi+5LB/MVo355obBJw/2z9b2xS3bPJxY=", + "lastModified": 1766969492, + "narHash": "sha256-TbvCOhB4ziljUQUOkqYAtKM0H4XJTR/1UQEB2n+NL4s=", "owner": "nix-community", "repo": "home-manager", - "rev": "61fcc9de76b88e55578eb5d79fc80f2b236df707", + "rev": "9d32c214dbdd66fff881d0d3aad91bde282bd37b", "type": "github" }, "original": { @@ -827,11 +827,11 @@ "xwayland-satellite-unstable": "xwayland-satellite-unstable" }, "locked": { - "lastModified": 1766291414, - "narHash": "sha256-0bPXNNAJOffm+iSorLOJvfTqEQa4isWRS9Cl4E+BXn4=", + "lastModified": 1766968208, + "narHash": "sha256-WM6X8mnpjmCU+fpaFNH4w2R7GVJllXtv4UKRIPmbCIo=", "owner": "sodiboo", "repo": "niri-flake", - "rev": "a9ce6453f35f795f9e1203ff0f49c284ce588cf5", + "rev": "503a635a4a734f4e8852f4387886ab9f58724da5", "type": "github" }, "original": { @@ -860,11 +860,11 @@ "niri-unstable": { "flake": false, "locked": { - "lastModified": 1766229062, - "narHash": "sha256-8iBPfiM3w0m7Qrs3PyFyiN+I96ba4owEaSZ9ahgPdqM=", + "lastModified": 1766751930, + "narHash": "sha256-83/YSW6c58i/iwGzAFApuMy6MCgoIaROeCcoIGh+ViU=", "owner": "YaLTeR", "repo": "niri", - "rev": "19e55a2df095d14f9490b79e38193ad4b4e87bb9", + "rev": "b5640d5293ad8dca06cb447692ea7cbb21680eb1", "type": "github" }, "original": { @@ -880,11 +880,11 @@ ] }, "locked": { - "lastModified": 1766038392, - "narHash": "sha256-ht/GuKaw5NT3M12xM+mkUtkSBVtzjJ8IHIy6R/ncv9g=", + "lastModified": 1766784396, + "narHash": "sha256-rIlgatT0JtwxsEpzq+UrrIJCRfVAXgbYPzose1DmAcM=", "owner": "nix-darwin", "repo": "nix-darwin", - "rev": "5fb45ece6129bd7ad8f7310df0ae9c00bae7c562", + "rev": "f0c8e1f6feb562b5db09cee9fb566a2f989e6b55", "type": "github" }, "original": { @@ -936,11 +936,11 @@ "nixpkgs": "nixpkgs_5" }, "locked": { - "lastModified": 1766332965, - "narHash": "sha256-A7hWWIFhMPjcf50nNw7Bid4U5E+YT2OKHIs3lWFArus=", + "lastModified": 1766917993, + "narHash": "sha256-Hf5T3qQX4hgGQITFSCqsIorMo0FxcI4TsygB1iruUeU=", "owner": "kaylorben", "repo": "nixcord", - "rev": "cc3aa513640220ee0ed624f8dd771a48da6b3d03", + "rev": "63871baa87897231803d617eab908261caa5907c", "type": "github" }, "original": { @@ -997,11 +997,11 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1766201043, - "narHash": "sha256-eplAP+rorKKd0gNjV3rA6+0WMzb1X1i16F5m5pASnjA=", + "lastModified": 1766736597, + "narHash": "sha256-BASnpCLodmgiVn0M1MU2Pqyoz0aHwar/0qLkp7CjvSQ=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "b3aad468604d3e488d627c0b43984eb60e75e782", + "rev": "f560ccec6b1116b22e6ed15f4c510997d99d5852", "type": "github" }, "original": { @@ -1013,11 +1013,11 @@ }, "nixpkgs-stable_2": { "locked": { - "lastModified": 1766014764, - "narHash": "sha256-+73VffE5GP5fvbib6Hs1Su6LehG+9UV1Kzs90T2gBLA=", + "lastModified": 1766687554, + "narHash": "sha256-DegN7KD/EtFSKXf2jvqL6lvev6GlfAAatYBcRC8goEo=", "owner": "nixOS", "repo": "nixpkgs", - "rev": "2b0d2b456e4e8452cf1c16d00118d145f31160f9", + "rev": "fd0ca39c92fdb4012ed8d60e1683c26fddadd136", "type": "github" }, "original": { @@ -1141,11 +1141,11 @@ }, "nixpkgs_4": { "locked": { - "lastModified": 1766070988, - "narHash": "sha256-G/WVghka6c4bAzMhTwT2vjLccg/awmHkdKSd2JrycLc=", + "lastModified": 1766902085, + "narHash": "sha256-coBu0ONtFzlwwVBzmjacUQwj3G+lybcZ1oeNSQkgC0M=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "c6245e83d836d0433170a16eb185cefe0572f8b8", + "rev": "c0b0e0fddf73fd517c3471e546c0df87a42d53f4", "type": "github" }, "original": { @@ -1173,11 +1173,11 @@ }, "nixpkgs_6": { "locked": { - "lastModified": 1766125104, - "narHash": "sha256-l/YGrEpLromL4viUo5GmFH3K5M1j0Mb9O+LiaeCPWEM=", + "lastModified": 1766870016, + "narHash": "sha256-fHmxAesa6XNqnIkcS6+nIHuEmgd/iZSP/VXxweiEuQw=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "7d853e518814cca2a657b72eeba67ae20ebf7059", + "rev": "5c2bc52fb9f8c264ed6c93bd20afa2ff5e763dce", "type": "github" }, "original": { @@ -1189,11 +1189,11 @@ }, "nixpkgs_7": { "locked": { - "lastModified": 1766070988, - "narHash": "sha256-G/WVghka6c4bAzMhTwT2vjLccg/awmHkdKSd2JrycLc=", + "lastModified": 1766902085, + "narHash": "sha256-coBu0ONtFzlwwVBzmjacUQwj3G+lybcZ1oeNSQkgC0M=", "owner": "nixos", "repo": "nixpkgs", - "rev": "c6245e83d836d0433170a16eb185cefe0572f8b8", + "rev": "c0b0e0fddf73fd517c3471e546c0df87a42d53f4", "type": "github" }, "original": { @@ -1241,11 +1241,11 @@ "nixpkgs": "nixpkgs_7" }, "locked": { - "lastModified": 1766256167, - "narHash": "sha256-KEaIZT5R9KftLGaZHJxJgR7M/XLwYGpvbgwIIPoJFu8=", + "lastModified": 1766977898, + "narHash": "sha256-9W9YN9fS6tInHRyw0lmw5wpIAQ9U7J37fhHS4EtPwvs=", "owner": "nix-community", "repo": "NUR", - "rev": "51d3347e63a34996f35275c77372eeafaa11e0ed", + "rev": "ef7a5e958f185c70de278477b3c326c9a4d244b2", "type": "github" }, "original": { @@ -1334,11 +1334,11 @@ ] }, "locked": { - "lastModified": 1764663772, - "narHash": "sha256-sHqLmm0wAt3PC4vczJeBozI1/f4rv9yp3IjkClHDXDs=", + "lastModified": 1766725085, + "narHash": "sha256-O2aMFdDUYJazFrlwL7aSIHbUSEm3ADVZjmf41uBJfHs=", "ref": "refs/heads/master", - "rev": "26531fc46ef17e9365b03770edd3fb9206fcb460", - "revCount": 713, + "rev": "41828c4180fb921df7992a5405f5ff05d2ac2fff", + "revCount": 715, "type": "git", "url": "https://git.outfoxxed.me/outfoxxed/quickshell" }, @@ -1378,11 +1378,11 @@ ] }, "locked": { - "lastModified": 1766289575, - "narHash": "sha256-BOKCwOQQIP4p9z8DasT5r+qjri3x7sPCOq+FTjY8Z+o=", + "lastModified": 1766894905, + "narHash": "sha256-pn8AxxfajqyR/Dmr1wnZYdUXHgM3u6z9x0Z1Ijmz2UQ=", "owner": "Mic92", "repo": "sops-nix", - "rev": "9836912e37aef546029e48c8749834735a6b9dad", + "rev": "61b39c7b657081c2adc91b75dd3ad8a91d6f07a7", "type": "github" }, "original": { @@ -1410,11 +1410,11 @@ "tinted-zed": "tinted-zed" }, "locked": { - "lastModified": 1765897595, - "narHash": "sha256-NgTRxiEC5y96zrhdBygnY+mSzk5FWMML39PcRGVJmxg=", + "lastModified": 1766603026, + "narHash": "sha256-J2DDdRqSU4w9NNgkMfmMeaLIof5PXtS9RG7y6ckDvQE=", "owner": "nix-community", "repo": "stylix", - "rev": "e6829552d4bb659ebab00f08c61d8c62754763f3", + "rev": "551df12ee3ebac52c5712058bd97fd9faa4c3430", "type": "github" }, "original": { @@ -1621,11 +1621,11 @@ "systems": "systems_5" }, "locked": { - "lastModified": 1766324177, - "narHash": "sha256-7Y8Pqn12ovZ2nH1y+rxMbliUPhY4cu/iB0cwSNHTMZY=", + "lastModified": 1766773632, + "narHash": "sha256-uizfsoFfsnmukcahOqg81R2YPBkXnY3Im4kljHCtswk=", "owner": "abenz1267", "repo": "walker", - "rev": "fb6152710c450a4b81342db42857de4aea049716", + "rev": "1395d9205253c7038698e1dcca9c4d1d7dfd567b", "type": "github" }, "original": { @@ -1743,11 +1743,11 @@ "xwayland-satellite-unstable": { "flake": false, "locked": { - "lastModified": 1765935116, - "narHash": "sha256-lNyckAdrhNKXsi9pNOBYajntNFlWs+BITVoIZuNuwX0=", + "lastModified": 1766429945, + "narHash": "sha256-9Kv4gWagx/u4RfZJzBMAoagW9ava5waxd+XoTkzqF7E=", "owner": "Supreeeme", "repo": "xwayland-satellite", - "rev": "979eab242e60cf481a31d9de508a1bdaf2dcf7d4", + "rev": "0dde7ca1d3a8e8c5082533d76084e2aa02bef70e", "type": "github" }, "original": { @@ -1763,11 +1763,11 @@ ] }, "locked": { - "lastModified": 1765772419, - "narHash": "sha256-1mQ1K4fqebT54nz13rcRNjd6a+IbNLwLvYyR62EcyE8=", + "lastModified": 1766377218, + "narHash": "sha256-y3g3OqPB0tmRjbHJNnJKivSQRtAJR+/9S1xbxBWEatg=", "owner": "youwen5", "repo": "zen-browser-flake", - "rev": "227e836e43fe7985b4c4f8b0076446a6d66f3343", + "rev": "2f61341b32dd69c07e147188e67e09ba2bb99c33", "type": "github" }, "original": { diff --git a/nixcfgs/users/js0ny/programs/darwin/alt-tab.nix b/nixcfgs/users/js0ny/programs/darwin/alt-tab.nix new file mode 100644 index 0000000..b0fa096 --- /dev/null +++ b/nixcfgs/users/js0ny/programs/darwin/alt-tab.nix @@ -0,0 +1,76 @@ +# brew install alt-tab +{...}: let + hideList = [ + "com.apple.finder" + "com.apple.Preview" + ]; + ignoreList = [ + "com.microsoft.rdc.macos" + "com.teamviewer.TeamViewer" + "org.virtualbox.app.VirtualBoxVM" + "com.parallels." + "com.citrix.XenAppViewer" + "com.citrix.receiver.icaviewer.mac" + "com.nicesoftware.dcvviewer" + "com.apple.ScreenSharing" + ]; + mkHideApps = identifier: { + "hide" = "2"; + "bundleIdentifier" = identifier; + "ignore" = "0"; + }; + mkIgnoreApps = identifier: { + "bundleIdentifier" = identifier; + "hide" = "0"; + "ignore" = "2"; + }; + blocklist = builtins.toJSON (map mkHideApps hideList ++ map mkIgnoreApps ignoreList); +in { + targets.darwin.defaults = { + "com.lwouis.alt-tab-macos" = { + # 0: Small + # 1: Medium + # 2: Large + appearanceSize = 1; + # 0: Thumbnails (Recording permission required) + # 1: App Icons + # 2: Titles + appearanceStyle = 0; + # 0: Normal + # 1: High + # 2: Highest + appearanceVisibility = 2; + # 0: Light + # 1: Dark + # 2: System + appearanceTheme = 2; + + # Shortcut 1: Cmd-Tab - Mimic Alt-Tab in Windows + # U+2318 + holdShortcut = "⌘"; + # U+21e5 + nextWindowShortcut = "⇥"; + # TODO: Shortcut 2: + holdShortcut2 = "⌘"; + + previewFocusedWindow = true; + showTabsAsWindows = false; + hideAppBadges = false; + # 0: Leading + # 1: Center + alignThumbnails = 1; + menubarIcon = 0; + menubarIconShown = false; + # 0: Don't check for update + # 1: Check for update + # 2: Auto Update + updatePolicy = 0; + # 0: Never send crash report + # 1: Ask + # 2: Always send + crashPolicy = 0; + vimKeysEnabled = true; + blacklist = toString blocklist; + }; + }; +} diff --git a/nixcfgs/users/js0ny/programs/duti.nix b/nixcfgs/users/js0ny/programs/darwin/duti.nix similarity index 91% rename from nixcfgs/users/js0ny/programs/duti.nix rename to nixcfgs/users/js0ny/programs/darwin/duti.nix index 11e38b1..95570d9 100644 --- a/nixcfgs/users/js0ny/programs/duti.nix +++ b/nixcfgs/users/js0ny/programs/darwin/duti.nix @@ -10,7 +10,7 @@ sioyek = "info.sioyek.sioyek"; defaultApps = { - "${gvim}" = ["md" "json" "js" "txt" "xml"]; + "${gvim}" = ["md" "json" "js" "txt" "xml" "nix" "yaml" "lock"]; "${iina}" = ["mp4" "mkv"]; # "${firefox}" = ["html"]; "${keka}" = ["7z" "zip" "rar" "tar"]; diff --git a/nixcfgs/users/js0ny/programs/darwin/iina.nix b/nixcfgs/users/js0ny/programs/darwin/iina.nix new file mode 100644 index 0000000..daa8a98 --- /dev/null +++ b/nixcfgs/users/js0ny/programs/darwin/iina.nix @@ -0,0 +1,92 @@ +{...}: { + targets.darwin.defaults = { + "com.colliderli.iina" = { + ### General + # 0: Show welcome window + # 1: Show open file panel + # 2: Do Nothing + actionAfterLaunch = 0; + # Quit after all windows are closed + quitWhenNoOpenedWindow = 1; + # DONT Keep window open after playback finished + keepOpenOnFileEnd = 0; + # DONT Remember File History + iinaLastPlayedFilePath = ""; + recordPlaybackHistory = 0; + recordRecentFiles = 0; + # DONT Check Update and DONT Auto Update + SUAutomaticallyUpdate = 0; + SUEnableAutomaticChecks = 0; + receiveBetaUpdate = 0; + screenshotCopyToClipboard = 1; + + ### UI + # Not Specified: Dark + # 2: Light + # 4: Match System Appearance * + themeMaterial = 4; + # Use left/right button for: + # 0: Speed (Default) - 神人逻辑按一下 》 变成 ×2 再按 《 变成 ×0.5 + # 1: Previous / Next Media + # 2: Fast Forward / Rewind + arrowBtnAction = 2; + # Show chapter position in progress bar + showChapterPos = 1; + # Show remaining time instead of total duration + showRemainingTime = 1; + ## On Screen Display + # Supress OSD for: + # * File Start + disableOSDFileStartMsg = 1; + # * Pause / Resume + disableOSDPauseResumeMsgs = 1; + ## Thumbnail Preview + # Enable thumbnail preview > Include files on a mounted remote drive + enableThumbnailForRemoteFiles = 1; + # Maximum cache size, unit MB (default: 500) + maxThumbnailPreviewCacheSize = 100; + # When entering Picture-in-Picture: + # 0: Do nothing + # 1: Hide + # 2: Minimise + windowBehaviorWhenPip = 1; + + ### Control + # Force Touch to: + # 0: None + # 1: Toggle fullscreen + # 2: Pause / Resume + # 3: Hide OSC + forceTouchAction = 2; + # Accepts first mouse click when not focused + videoViewAcceptsFirstMouse = 1; + ### Key Bindings + currentInputConfigName = "vim"; # See below for input config + ### Advanced + enableAdvancedSettings = 0; + }; + }; + # See ../mpv.nix + # Since iina will build the keybindings from scratch (instead of override mpv's), more keybindings should be added manually + # this can also interact with iina's api + home.file."Library/Application Support/com.colliderli.iina/input_conf/vim.conf" = { + force = true; + text = '' + H seek -30 + J add volume -15 + K add volume 15 + L seek 30 + S screenshot video + f cycle fullscreen + h seek -5 + j add volume -5 + k add volume 5 + l seek 5 + n playlist-next + p playlist-prev + s screenshot + #@iina o open-file + SPACE cycle pause + ''; + }; +} diff --git a/nixcfgs/users/js0ny/programs/desktop/gnome/paperwm.nix b/nixcfgs/users/js0ny/programs/desktop/gnome/paperwm.nix index 6248093..ef82f59 100644 --- a/nixcfgs/users/js0ny/programs/desktop/gnome/paperwm.nix +++ b/nixcfgs/users/js0ny/programs/desktop/gnome/paperwm.nix @@ -6,6 +6,13 @@ {package = pkgs.gnomeExtensions.paperwm;} ]; dconf.settings = { + # Inspect window class with F2 -> `lg` + "org/gnome/shell/extensions/paperwm" = { + winprops = [ + ''{"wm_class":"dev.benz.walker","scratch_layer":true}'' + ''{"wm_class":"org.pulseaudio.pavucontrol","scratch_layer":true}'' + ]; + }; "org/gnome/settings-daemon/plugins/media-keys" = { screensaver = [""]; }; @@ -48,8 +55,5 @@ live-alt-tab = []; live-alt-tab-backward = []; }; - "org/gnome/shell/extensions/paperwm" = { - winprops = [''{"wm_class":"dev.benz.walker","scratch_layer":true}'']; - }; }; } diff --git a/nixcfgs/users/js0ny/programs/discord.nix b/nixcfgs/users/js0ny/programs/discord.nix index ee1b310..6472b8f 100644 --- a/nixcfgs/users/js0ny/programs/discord.nix +++ b/nixcfgs/users/js0ny/programs/discord.nix @@ -14,9 +14,9 @@ plugins = { alwaysAnimate.enable = true; alwaysTrust.enable = true; - clearUrLs.enable = true; + ClearURLs.enable = true; copyFileContents.enable = true; - copyUserUrLs.enable = true; + CopyUserURLs.enable = true; disableCallIdle.enable = true; favoriteEmojiFirst.enable = true; forceOwnerCrown.enable = true; diff --git a/nixcfgs/users/js0ny/programs/fcitx.nix b/nixcfgs/users/js0ny/programs/fcitx.nix deleted file mode 100644 index 7f55259..0000000 --- a/nixcfgs/users/js0ny/programs/fcitx.nix +++ /dev/null @@ -1,284 +0,0 @@ -{pkgs, ...}: { - # Use: https://github.com/TemariVirus/fcitx-ini2nix - i18n.inputMethod = - if pkgs.stdenv.isDarwin - then {enable = false;} - else { - enable = true; - type = "fcitx5"; - fcitx5 = { - waylandFrontend = true; - addons = with pkgs; [ - fcitx5-rime - kdePackages.fcitx5-configtool - kdePackages.fcitx5-qt - fcitx5-gtk - qt6Packages.fcitx5-chinese-addons - ]; - settings = { - "inputMethod" = { - "Groups/0" = { - # Group Name - "Name" = ''Default''; - # Layout - "Default Layout" = ''us''; - # Default Input Method - "DefaultIM" = ''keyboard-us''; - }; - "Groups/0/Items/0" = { - # Name - "Name" = ''rime''; - # Layout - "Layout" = ''''; - }; - "Groups/0/Items/1" = { - # Name - "Name" = ''keyboard-us''; - # Layout - "Layout" = ''''; - }; - "GroupOrder" = { - "0" = ''Default''; - }; - }; - "globalOptions" = { - "Hotkey" = { - # Enumerate when holding modifier of Toggle key - "EnumerateWithTriggerKeys" = ''True''; - # Temporarily Toggle Input Method - "AltTriggerKeys" = ''''; - # Skip first input method while enumerating - "EnumerateSkipFirst" = ''False''; - # Enumerate Input Method Group Forward - "EnumerateGroupForwardKeys" = ''''; - # Enumerate Input Method Group Backward - "EnumerateGroupBackwardKeys" = ''''; - # Time limit in milliseconds for triggering modifier key shortcuts - "ModifierOnlyKeyTimeout" = ''250''; - }; - "Hotkey/TriggerKeys" = { - "0" = ''Zenkaku_Hankaku''; - "1" = ''Hangul''; - }; - "Hotkey/ActivateKeys" = { - "0" = ''Hangul_Hanja''; - }; - "Hotkey/DeactivateKeys" = { - "0" = ''Hangul_Romaja''; - }; - "Hotkey/EnumerateForwardKeys" = { - "0" = ''Super+space''; - }; - "Hotkey/EnumerateBackwardKeys" = { - "0" = ''Shift+Super+space''; - }; - "Hotkey/PrevPage" = { - "0" = ''Up''; - }; - "Hotkey/NextPage" = { - "0" = ''Down''; - }; - "Hotkey/PrevCandidate" = { - "0" = ''Shift+Tab''; - }; - "Hotkey/NextCandidate" = { - "0" = ''Tab''; - }; - "Hotkey/TogglePreedit" = { - "0" = ''Control+Alt+P''; - }; - "Behavior" = { - # Active By Default - "ActiveByDefault" = ''False''; - # Reset state on Focus In - "resetStateWhenFocusIn" = ''No''; - # Share Input State - "ShareInputState" = ''No''; - # Show preedit in application - "PreeditEnabledByDefault" = ''True''; - # Show Input Method Information when switch input method - "ShowInputMethodInformation" = ''True''; - # Show Input Method Information when changing focus - "showInputMethodInformationWhenFocusIn" = ''False''; - # Show compact input method information - "CompactInputMethodInformation" = ''True''; - # Show first input method information - "ShowFirstInputMethodInformation" = ''True''; - # Default page size - "DefaultPageSize" = ''5''; - # Override XKB Option - "OverrideXkbOption" = ''False''; - # Custom XKB Option - "CustomXkbOption" = ''''; - # Force Enabled Addons - "EnabledAddons" = ''''; - # Force Disabled Addons - "DisabledAddons" = ''''; - # Preload input method to be used by default - "PreloadInputMethod" = ''True''; - # Allow input method in the password field - "AllowInputMethodForPassword" = ''False''; - # Show preedit text when typing password - "ShowPreeditForPassword" = ''False''; - # Interval of saving user data in minutes - "AutoSavePeriod" = ''30''; - }; - }; - "addons" = { - "clipboard" = { - "globalSection" = { - # Trigger Key - "TriggerKey" = ''''; - # Paste Primary - "PastePrimaryKey" = ''''; - # Number of entries - "Number of entries" = ''5''; - # Do not show password from password managers - "IgnorePasswordFromPasswordManager" = ''False''; - # Display passwords as plain text - "ShowPassword" = ''False''; - # Seconds before clearing password - "ClearPasswordAfter" = ''30''; - }; - }; - "kimpanel" = { - "globalSection" = { - # Prefer Text Icon - "PreferTextIcon" = ''False''; - }; - }; - "cloudpinyin" = { - "globalSection" = { - # Toggle Key - "Toggle Key" = ''''; - # Minimum Pinyin Length - "MinimumPinyinLength" = ''4''; - # Backend - "Backend" = ''GoogleCN''; - # Proxy - "Proxy" = ''''; - }; - }; - "wayland" = { - "globalSection" = { - # Allow Overriding System XKB Settings (Only support KDE5+ and GNOME) - "Allow Overriding System XKB Settings" = ''True''; - }; - }; - "waylandim" = { - "globalSection" = { - # Detect current running application (Need restart) - "DetectApplication" = ''True''; - # Forward key event instead of commiting text if it is not handled - "PreferKeyEvent" = ''True''; - # Keep virtual keyboard object for V2 Protocol (Need restart) - "PersistentVirtualKeyboard" = ''False''; - }; - }; - "rime" = { - "globalSection" = { - # Preedit Mode - "PreeditMode" = ''"Do not show"''; - # Shared Input State - "InputState" = ''All''; - # Fix embedded preedit cursor at the beginning of the preedit - "PreeditCursorPositionAtBeginning" = ''True''; - # Action when switching input method - "SwitchInputMethodBehavior" = ''"Commit commit preview"''; - # Deploy - "Deploy" = ''''; - # Synchronize - "Synchronize" = ''''; - }; - }; - "classicui" = { - "globalSection" = { - # Vertical Candidate List - "Vertical Candidate List" = ''True''; - # Use mouse wheel to go to prev or next page - "WheelForPaging" = ''True''; - # NOTE: manged by stylix - # Font - # "Font" = ''"LXGW WenKai Medium 14"''; - # # Menu Font - # "MenuFont" = ''"LXGW WenKai 14"''; - # # Tray Font - # "TrayFont" = ''"Sans Bold 10"''; - # # Tray Label Outline Color - # "TrayOutlineColor" = ''''; #000000 - # # Tray Label Text Color - # "TrayTextColor" = ''''; #ffffff - # Theme - # "Theme" = ''plasma''; - # # Dark Theme - # "DarkTheme" = ''plasma''; - # # Follow system light/dark color scheme - # "UseDarkTheme" = ''True''; - # # Follow system accent color if it is supported by theme and desktop - # "UseAccentColor" = ''True''; - # Prefer Text Icon - "PreferTextIcon" = ''False''; - # Show Layout Name In Icon - "ShowLayoutNameInIcon" = ''True''; - # Use input method language to display text - "UseInputMethodLanguageToDisplayText" = ''True''; - # Use Per Screen DPI on X11 - "PerScreenDPI" = ''False''; - # Force font DPI on Wayland - "ForceWaylandDPI" = ''0''; - # Enable fractional scale under Wayland - "EnableFractionalScale" = ''True''; - }; - }; - "quickphrase" = { - "globalSection" = { - # Trigger Key - "TriggerKey" = ''''; - # Choose key modifier - "Choose Modifier" = ''None''; - # Enable Spell check - "Spell" = ''True''; - # Fallback Spell check language - "FallbackSpellLanguage" = ''en''; - }; - }; - "punctuation" = { - "globalSection" = { - # Toggle key - "Hotkey" = ''''; - # Half width punctuation after latin letter or number - "HalfWidthPuncAfterLetterOrNumber" = ''True''; - # Type paired punctuations together (e.g. Quote) - "TypePairedPunctuationsTogether" = ''False''; - # Enabled - "Enabled" = ''True''; - }; - }; - "chttrans" = { - "globalSection" = { - # Translate engine - "Engine" = ''OpenCC''; - # Enabled Input Methods - "EnabledIM" = ''''; - # OpenCC profile for Simplified to Traditional - "OpenCCS2TProfile" = ''default''; - # OpenCC profile for Traditional to Simplified - "OpenCCT2SProfile" = ''default''; - }; - "sections" = { - "Hotkey" = { - "0" = ''Control+Shift+F''; - }; - }; - }; - "notifications" = { - "globalSection" = { - # Hidden Notifications - "HiddenNotifications" = ''''; - }; - }; - }; - }; - }; - }; -} diff --git a/nixcfgs/users/js0ny/programs/rime/default.nix b/nixcfgs/users/js0ny/programs/rime/default.nix new file mode 100644 index 0000000..dacbe28 --- /dev/null +++ b/nixcfgs/users/js0ny/programs/rime/default.nix @@ -0,0 +1,22 @@ +{ + pkgs, + lib, + ... +}: { + imports = [ + ./dicts.nix + ./squirrel.nix + ./fcitx.nix + ]; + home.activation.deployRime = + if pkgs.stdenv.isDarwin + then + lib.hm.dag.entryAfter ["writeBoundary"] '' + /Library/Input\ Methods/Squirrel.app/Contents/MacOS/Squirrel --reload + '' + else + # TODO: Buggy + lib.hm.dag.entryAfter ["writeBoundary"] '' + # ${pkgs.kdePackages.qttools}/bin/qdbus org.fcitx.Fcitx5 /controller org.fcitx.Fcitx.Controller1.SetConfig "fcitx://config/addon/rime/deploy" "" + ''; +} diff --git a/nixcfgs/users/js0ny/programs/rime.nix b/nixcfgs/users/js0ny/programs/rime/dicts.nix similarity index 91% rename from nixcfgs/users/js0ny/programs/rime.nix rename to nixcfgs/users/js0ny/programs/rime/dicts.nix index 082e56e..ee9731a 100644 --- a/nixcfgs/users/js0ny/programs/rime.nix +++ b/nixcfgs/users/js0ny/programs/rime/dicts.nix @@ -1,8 +1,4 @@ -{ - pkgs, - lib, - ... -}: let +{pkgs, ...}: let version = "v13.3.12"; rimeWanxiang = pkgs.fetchzip { url = "https://github.com/amzxyz/rime_wanxiang/releases/download/${version}/rime-wanxiang-zrm-fuzhu.zip"; @@ -87,7 +83,6 @@ then "Library/Rime" else ".local/share/fcitx5/rime"; in { - imports = [./fcitx.nix]; home.file.${rimePath} = { source = rimeConfigFiltered; recursive = true; @@ -172,15 +167,4 @@ in { enable = true; }; }; - - home.activation.deployRime = - if pkgs.stdenv.isDarwin - then - lib.hm.dag.entryAfter ["writeBoundary"] '' - /Library/Input\ Methods/Squirrel.app/Contents/MacOS/Squirrel --reload - '' - else - lib.hm.dag.entryAfter ["writeBoundary"] '' - # ${pkgs.kdePackages.qttools}/bin/qdbus org.fcitx.Fcitx5 /controller org.fcitx.Fcitx.Controller1.SetConfig "fcitx://config/addon/rime/deploy" "" - ''; } diff --git a/nixcfgs/users/js0ny/programs/rime/fcitx.nix b/nixcfgs/users/js0ny/programs/rime/fcitx.nix new file mode 100644 index 0000000..19d0ea2 --- /dev/null +++ b/nixcfgs/users/js0ny/programs/rime/fcitx.nix @@ -0,0 +1,286 @@ +{ + pkgs, + lib, + ... +}: +lib.mkIf pkgs.stdenv.isLinux { + # Use: https://github.com/TemariVirus/fcitx-ini2nix + i18n.inputMethod = { + enable = true; + type = "fcitx5"; + fcitx5 = { + waylandFrontend = true; + addons = with pkgs; [ + fcitx5-rime + kdePackages.fcitx5-configtool + kdePackages.fcitx5-qt + fcitx5-gtk + qt6Packages.fcitx5-chinese-addons + ]; + settings = { + "inputMethod" = { + "Groups/0" = { + # Group Name + "Name" = ''Default''; + # Layout + "Default Layout" = ''us''; + # Default Input Method + "DefaultIM" = ''keyboard-us''; + }; + "Groups/0/Items/0" = { + # Name + "Name" = ''rime''; + # Layout + "Layout" = ''''; + }; + "Groups/0/Items/1" = { + # Name + "Name" = ''keyboard-us''; + # Layout + "Layout" = ''''; + }; + "GroupOrder" = { + "0" = ''Default''; + }; + }; + "globalOptions" = { + "Hotkey" = { + # Enumerate when holding modifier of Toggle key + "EnumerateWithTriggerKeys" = ''True''; + # Temporarily Toggle Input Method + "AltTriggerKeys" = ''''; + # Skip first input method while enumerating + "EnumerateSkipFirst" = ''False''; + # Enumerate Input Method Group Forward + "EnumerateGroupForwardKeys" = ''''; + # Enumerate Input Method Group Backward + "EnumerateGroupBackwardKeys" = ''''; + # Time limit in milliseconds for triggering modifier key shortcuts + "ModifierOnlyKeyTimeout" = ''250''; + }; + "Hotkey/TriggerKeys" = { + "0" = ''Zenkaku_Hankaku''; + "1" = ''Hangul''; + }; + "Hotkey/ActivateKeys" = { + "0" = ''Hangul_Hanja''; + }; + "Hotkey/DeactivateKeys" = { + "0" = ''Hangul_Romaja''; + }; + "Hotkey/EnumerateForwardKeys" = { + "0" = ''Super+space''; + }; + "Hotkey/EnumerateBackwardKeys" = { + "0" = ''Shift+Super+space''; + }; + "Hotkey/PrevPage" = { + "0" = ''Up''; + }; + "Hotkey/NextPage" = { + "0" = ''Down''; + }; + "Hotkey/PrevCandidate" = { + "0" = ''Shift+Tab''; + }; + "Hotkey/NextCandidate" = { + "0" = ''Tab''; + }; + "Hotkey/TogglePreedit" = { + "0" = ''Control+Alt+P''; + }; + "Behavior" = { + # Active By Default + "ActiveByDefault" = ''False''; + # Reset state on Focus In + "resetStateWhenFocusIn" = ''No''; + # Share Input State + "ShareInputState" = ''No''; + # Show preedit in application + "PreeditEnabledByDefault" = ''True''; + # Show Input Method Information when switch input method + "ShowInputMethodInformation" = ''True''; + # Show Input Method Information when changing focus + "showInputMethodInformationWhenFocusIn" = ''False''; + # Show compact input method information + "CompactInputMethodInformation" = ''True''; + # Show first input method information + "ShowFirstInputMethodInformation" = ''True''; + # Default page size + "DefaultPageSize" = ''5''; + # Override XKB Option + "OverrideXkbOption" = ''False''; + # Custom XKB Option + "CustomXkbOption" = ''''; + # Force Enabled Addons + "EnabledAddons" = ''''; + # Force Disabled Addons + "DisabledAddons" = ''''; + # Preload input method to be used by default + "PreloadInputMethod" = ''True''; + # Allow input method in the password field + "AllowInputMethodForPassword" = ''False''; + # Show preedit text when typing password + "ShowPreeditForPassword" = ''False''; + # Interval of saving user data in minutes + "AutoSavePeriod" = ''30''; + }; + }; + "addons" = { + "clipboard" = { + "globalSection" = { + # Trigger Key + "TriggerKey" = ''''; + # Paste Primary + "PastePrimaryKey" = ''''; + # Number of entries + "Number of entries" = ''5''; + # Do not show password from password managers + "IgnorePasswordFromPasswordManager" = ''False''; + # Display passwords as plain text + "ShowPassword" = ''False''; + # Seconds before clearing password + "ClearPasswordAfter" = ''30''; + }; + }; + "kimpanel" = { + "globalSection" = { + # Prefer Text Icon + "PreferTextIcon" = ''False''; + }; + }; + "cloudpinyin" = { + "globalSection" = { + # Toggle Key + "Toggle Key" = ''''; + # Minimum Pinyin Length + "MinimumPinyinLength" = ''4''; + # Backend + "Backend" = ''GoogleCN''; + # Proxy + "Proxy" = ''''; + }; + }; + "wayland" = { + "globalSection" = { + # Allow Overriding System XKB Settings (Only support KDE5+ and GNOME) + "Allow Overriding System XKB Settings" = ''True''; + }; + }; + "waylandim" = { + "globalSection" = { + # Detect current running application (Need restart) + "DetectApplication" = ''True''; + # Forward key event instead of commiting text if it is not handled + "PreferKeyEvent" = ''True''; + # Keep virtual keyboard object for V2 Protocol (Need restart) + "PersistentVirtualKeyboard" = ''False''; + }; + }; + "rime" = { + "globalSection" = { + # Preedit Mode + "PreeditMode" = ''"Do not show"''; + # Shared Input State + "InputState" = ''All''; + # Fix embedded preedit cursor at the beginning of the preedit + "PreeditCursorPositionAtBeginning" = ''True''; + # Action when switching input method + "SwitchInputMethodBehavior" = ''"Commit commit preview"''; + # Deploy + "Deploy" = ''''; + # Synchronize + "Synchronize" = ''''; + }; + }; + "classicui" = { + "globalSection" = { + # Vertical Candidate List + "Vertical Candidate List" = ''True''; + # Use mouse wheel to go to prev or next page + "WheelForPaging" = ''True''; + # NOTE: manged by stylix + # Font + # "Font" = ''"LXGW WenKai Medium 14"''; + # # Menu Font + # "MenuFont" = ''"LXGW WenKai 14"''; + # # Tray Font + # "TrayFont" = ''"Sans Bold 10"''; + # # Tray Label Outline Color + # "TrayOutlineColor" = ''''; #000000 + # # Tray Label Text Color + # "TrayTextColor" = ''''; #ffffff + # Theme + # "Theme" = ''plasma''; + # # Dark Theme + # "DarkTheme" = ''plasma''; + # # Follow system light/dark color scheme + # "UseDarkTheme" = ''True''; + # # Follow system accent color if it is supported by theme and desktop + # "UseAccentColor" = ''True''; + # Prefer Text Icon + "PreferTextIcon" = ''False''; + # Show Layout Name In Icon + "ShowLayoutNameInIcon" = ''True''; + # Use input method language to display text + "UseInputMethodLanguageToDisplayText" = ''True''; + # Use Per Screen DPI on X11 + "PerScreenDPI" = ''False''; + # Force font DPI on Wayland + "ForceWaylandDPI" = ''0''; + # Enable fractional scale under Wayland + "EnableFractionalScale" = ''True''; + }; + }; + "quickphrase" = { + "globalSection" = { + # Trigger Key + "TriggerKey" = ''''; + # Choose key modifier + "Choose Modifier" = ''None''; + # Enable Spell check + "Spell" = ''True''; + # Fallback Spell check language + "FallbackSpellLanguage" = ''en''; + }; + }; + "punctuation" = { + "globalSection" = { + # Toggle key + "Hotkey" = ''''; + # Half width punctuation after latin letter or number + "HalfWidthPuncAfterLetterOrNumber" = ''True''; + # Type paired punctuations together (e.g. Quote) + "TypePairedPunctuationsTogether" = ''False''; + # Enabled + "Enabled" = ''True''; + }; + }; + "chttrans" = { + "globalSection" = { + # Translate engine + "Engine" = ''OpenCC''; + # Enabled Input Methods + "EnabledIM" = ''''; + # OpenCC profile for Simplified to Traditional + "OpenCCS2TProfile" = ''default''; + # OpenCC profile for Traditional to Simplified + "OpenCCT2SProfile" = ''default''; + }; + "sections" = { + "Hotkey" = { + "0" = ''Control+Shift+F''; + }; + }; + }; + "notifications" = { + "globalSection" = { + # Hidden Notifications + "HiddenNotifications" = ''''; + }; + }; + }; + }; + }; + }; +} diff --git a/nixcfgs/users/js0ny/programs/rime/squirrel.nix b/nixcfgs/users/js0ny/programs/rime/squirrel.nix new file mode 100644 index 0000000..994e727 --- /dev/null +++ b/nixcfgs/users/js0ny/programs/rime/squirrel.nix @@ -0,0 +1,22 @@ +{ + lib, + pkgs, + ... +}: +lib.mkIf pkgs.stdenv.isDarwin { + targets.darwin.defaults = { + "com.apple.inputsources.plist" = { + "AppleEnabledThirdPartyInputSources" = [ + { + "Bundle ID" = "im.rime.inputmethod.Squirrel"; + "Input Mode" = "im.rime.inputmethod.Squirrel.Hans"; + "InputSourceKind" = "Input Mode"; + } + { + "Bundle ID" = "im.rime.inputmethod.Squirrel"; + "InputSourceKind" = "Keyboard Input Method"; + } + ]; + }; + }; +} diff --git a/nixcfgs/users/js0ny/zen.nix b/nixcfgs/users/js0ny/zen.nix index e9b782b..90e802d 100644 --- a/nixcfgs/users/js0ny/zen.nix +++ b/nixcfgs/users/js0ny/zen.nix @@ -18,7 +18,7 @@ ./programs/firefox ./programs/emacs.nix ./programs/zed-editor.nix - ./programs/rime.nix + ./programs/rime ./programs/sdcv.nix ./programs/fzf.nix ./programs/sops.nix @@ -33,7 +33,9 @@ ./programs/anki.nix ./programs/sioyek.nix # ./programs/retroarch.nix # Package broken on macOS - ./programs/duti.nix + ./programs/darwin/duti.nix + ./programs/darwin/alt-tab.nix + ./programs/darwin/iina.nix ../../modules/home/do-not-track.nix ../../modules/home/darwin.nix @@ -45,5 +47,16 @@ ../../modules/home/dev/nix.nix ]; + targets.darwin.defaults = { + ".GlobalPreferences" = { + # Accent Colour: Pink + "AppleAccentColor" = 6; + # Folder Colour + "AppleIconAppearanceTintColor" = "Yellow"; + # Icon & Widget Style + "AppleInterfaceStyle" = "Dark"; + }; + }; + home.stateVersion = "25.05"; } diff --git a/nixcfgs/users/js0ny/zephyrus.nix b/nixcfgs/users/js0ny/zephyrus.nix index 342e1a3..a7c476f 100644 --- a/nixcfgs/users/js0ny/zephyrus.nix +++ b/nixcfgs/users/js0ny/zephyrus.nix @@ -41,7 +41,7 @@ in { # ./programs/xilinx.nix ./programs/mime.nix ./programs/zed-editor.nix - ./programs/rime.nix + ./programs/rime ./programs/sdcv.nix ./programs/fzf.nix ./programs/libreoffice.nix