diff options
| author | Fuwn <[email protected]> | 2024-08-28 20:36:04 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2024-08-28 20:36:04 -0700 |
| commit | f3c31e4ad7fab36e151f3a2e207fafb1eda1a787 (patch) | |
| tree | e265a1a5270b4522049110b8bc5aa13fda142c2f /home/ebisu/meta | |
| parent | many (diff) | |
| download | nixos-config-f3c31e4ad7fab36e151f3a2e207fafb1eda1a787.tar.xz nixos-config-f3c31e4ad7fab36e151f3a2e207fafb1eda1a787.zip | |
hi
Diffstat (limited to 'home/ebisu/meta')
160 files changed, 6859 insertions, 0 deletions
diff --git a/home/ebisu/meta/communication/default.nix b/home/ebisu/meta/communication/default.nix new file mode 100644 index 0000000..551e90c --- /dev/null +++ b/home/ebisu/meta/communication/default.nix @@ -0,0 +1,12 @@ +{ pkgs, ... }: +{ + imports = [ + ./discord + ./irc.nix + ]; + + home.packages = with pkgs; [ + revolt-desktop + newsboat + ]; +} diff --git a/home/ebisu/meta/communication/discord/default.nix b/home/ebisu/meta/communication/discord/default.nix new file mode 100644 index 0000000..5e8f79d --- /dev/null +++ b/home/ebisu/meta/communication/discord/default.nix @@ -0,0 +1,9 @@ +{ pkgs, ... }: { + imports = [ + ./vesktop + ]; + + home.packages = with pkgs; [ + # discord-canary + ]; +} diff --git a/home/ebisu/meta/communication/discord/vesktop/default.nix b/home/ebisu/meta/communication/discord/vesktop/default.nix new file mode 100644 index 0000000..edae1bc --- /dev/null +++ b/home/ebisu/meta/communication/discord/vesktop/default.nix @@ -0,0 +1,649 @@ +{ pkgs, ... }: { + home.packages = with pkgs; [ + vesktop + ]; + + services.arrpc.enable = false; + + xdg.configFile."vesktop/settings.json".text = '' + { + "discordBranch": "canary", + "arRPC": "on", + "splashColor": "rgba(255, 255, 255, 0.6)", + "splashBackground": "rgba(21, 14, 13, 0.52)", + "enableMenu": false, + "splashTheming": true, + "staticTitle": false, + "disableMinSize": true, + "minimizeToTray": false, + "tray": false, + "appBadge": false + } + ''; + + xdg.configFile."vesktop/settings/quickCss.css".text = '' + /** + * @name Dark Matter + * @author Tropical#8908, Hammock#3110 + * @version 3.0.0 + * @description A cold, dark & frosty theme. + * @source https://github.com/DiscordStyles/DarkMatter/ + */ + + @import url('https://DiscordStyles.github.io/DarkMatter/src/base.css'); + + /* Variables */ + :root { + --avatar-size: 32px; + --background-image: url('https://images6.alphacoders.com/109/1093313.jpg'); + --home-image: url('https://shinobu.fuwn.workers.dev/shinobu'); + --background-solid: #150e0d85; + --background-solid-dark: #0f0a0985; + --background-solid-darker: #0b070685; + --accent: 216, 161, 110; + --accent-alt: 196, 141, 90; + } + ''; + + xdg.configFile."vesktop/settings/settings.json".text = '' + { + "notifyAboutUpdates": true, + "autoUpdate": true, + "autoUpdateNotification": true, + "useQuickCss": true, + "themeLinks": [], + "enabledThemes": [], + "enableReactDevtools": true, + "frameless": true, + "transparent": false, + "winCtrlQ": false, + "macosTranslucency": false, + "disableMinSize": false, + "winNativeTitleBar": false, + "plugins": { + "BadgeAPI": { + "enabled": true + }, + "CommandsAPI": { + "enabled": true + }, + "ContextMenuAPI": { + "enabled": true + }, + "MemberListDecoratorsAPI": { + "enabled": true + }, + "MessageAccessoriesAPI": { + "enabled": true + }, + "MessageDecorationsAPI": { + "enabled": true + }, + "MessageEventsAPI": { + "enabled": true + }, + "MessagePopoverAPI": { + "enabled": true + }, + "NoticesAPI": { + "enabled": true + }, + "ServerListAPI": { + "enabled": true + }, + "NoTrack": { + "enabled": true + }, + "Settings": { + "enabled": true, + "settingsLocation": "aboveActivity" + }, + "SupportHelper": { + "enabled": true + }, + "AlwaysAnimate": { + "enabled": true + }, + "AlwaysTrust": { + "enabled": true + }, + "AnonymiseFileNames": { + "enabled": true, + "method": 0, + "randomisedLength": 7, + "consistent": "image" + }, + "WebRichPresence (arRPC)": { + "enabled": true + }, + "BANger": { + "enabled": false + }, + "BetterFolders": { + "enabled": false, + "sidebar": true, + "showFolderIcon": 1, + "closeAllHomeButton": false, + "keepIcons": false, + "sidebarAnim": true, + "closeOthers": false, + "closeAllFolders": false, + "forceOpen": false + }, + "BetterGifAltText": { + "enabled": true + }, + "BetterNotesBox": { + "enabled": false + }, + "BetterRoleDot": { + "enabled": false + }, + "BetterUploadButton": { + "enabled": true + }, + "BiggerStreamPreview": { + "enabled": true + }, + "BlurNSFW": { + "enabled": false + }, + "CallTimer": { + "enabled": true, + "format": "human" + }, + "ClearURLs": { + "enabled": true + }, + "ColorSighted": { + "enabled": true + }, + "ConsoleShortcuts": { + "enabled": false + }, + "CopyUserURLs": { + "enabled": true + }, + "CrashHandler": { + "enabled": true, + "attemptToPreventCrashes": true, + "attemptToNavigateToHome": true + }, + "CustomRPC": { + "enabled": false + }, + "Dearrow": { + "enabled": true + }, + "EmoteCloner": { + "enabled": true + }, + "Experiments": { + "enabled": true, + "enableIsStaff": false + }, + "F8Break": { + "enabled": false + }, + "FakeNitro": { + "enabled": false, + "enableEmojiBypass": true, + "emojiSize": 48, + "transformEmojis": true, + "enableStickerBypass": true, + "stickerSize": 160, + "transformStickers": true, + "transformCompoundSentence": false, + "enableStreamQualityBypass": true + }, + "FakeProfileThemes": { + "enabled": false + }, + "FavoriteEmojiFirst": { + "enabled": true + }, + "FavoriteGifSearch": { + "enabled": true + }, + "FixSpotifyEmbeds": { + "enabled": true, + "volume": 5 + }, + "ForceOwnerCrown": { + "enabled": false + }, + "FriendInvites": { + "enabled": false + }, + "GameActivityToggle": { + "enabled": true + }, + "GifPaste": { + "enabled": false + }, + "GreetStickerPicker": { + "enabled": true + }, + "HideAttachments": { + "enabled": false + }, + "iLoveSpam": { + "enabled": false + }, + "IgnoreActivities": { + "enabled": false + }, + "ImageZoom": { + "enabled": true, + "saveZoomValues": true, + "invertScroll": true, + "nearestNeighbour": false, + "square": false, + "zoom": 2, + "size": 100, + "zoomSpeed": 0.5 + }, + "InvisibleChat": { + "enabled": true, + "savedPasswords": "password, Password" + }, + "KeepCurrentChannel": { + "enabled": false + }, + "LastFMRichPresence": { + "enabled": false + }, + "LoadingQuotes": { + "enabled": true, + "replaceEvents": true + }, + "MemberCount": { + "enabled": true + }, + "MessageClickActions": { + "enabled": false + }, + "MessageLinkEmbeds": { + "enabled": true, + "automodEmbeds": "never", + "listMode": "blacklist", + "idList": "" + }, + "MessageLogger": { + "enabled": true, + "deleteStyle": "text", + "ignoreBots": false, + "ignoreSelf": false, + "ignoreUsers": "", + "ignoreChannels": "", + "ignoreGuilds": "" + }, + "MessageTags": { + "enabled": false + }, + "MoreCommands": { + "enabled": true + }, + "MoreKaomoji": { + "enabled": true + }, + "MoreUserTags": { + "enabled": false + }, + "Moyai": { + "enabled": false, + "volume": 0.5, + "quality": "Normal", + "triggerWhenUnfocused": true, + "ignoreBots": true, + "ignoreBlocked": true + }, + "MutualGroupDMs": { + "enabled": true + }, + "NoBlockedMessages": { + "enabled": false + }, + "NoDevtoolsWarning": { + "enabled": true + }, + "NoF1": { + "enabled": true + }, + "NoMosaic": { + "enabled": false + }, + "NoPendingCount": { + "enabled": false + }, + "NoProfileThemes": { + "enabled": false + }, + "NoReplyMention": { + "enabled": false + }, + "NoScreensharePreview": { + "enabled": true + }, + "NoTypingAnimation": { + "enabled": true + }, + "NoUnblockToJump": { + "enabled": true + }, + "NormalizeMessageLinks": { + "enabled": true + }, + "NSFWGateBypass": { + "enabled": false + }, + "OnePingPerDM": { + "enabled": true, + "channelToAffect": "both_dms", + "allowMentions": false, + "allowEveryone": false + }, + "oneko": { + "enabled": true + }, + "OpenInApp": { + "enabled": false + }, + "PermissionFreeWill": { + "enabled": false + }, + "PermissionsViewer": { + "enabled": true, + "permissionsSortOrder": 0, + "defaultPermissionsDropdownState": false + }, + "petpet": { + "enabled": true + }, + "PictureInPicture": { + "enabled": false + }, + "PinDMs": { + "enabled": false + }, + "PlainFolderIcon": { + "enabled": false + }, + "PlatformIndicators": { + "enabled": true, + "list": true, + "badges": true, + "messages": true, + "colorMobileIndicator": true + }, + "PreviewMessage": { + "enabled": false + }, + "PronounDB": { + "enabled": true, + "pronounsFormat": "LOWERCASE", + "pronounSource": 0, + "showSelf": true, + "showInMessages": true, + "showInProfile": true + }, + "QuickMention": { + "enabled": false + }, + "QuickReply": { + "enabled": false + }, + "ReactErrorDecoder": { + "enabled": true + }, + "ReadAllNotificationsButton": { + "enabled": true + }, + "RelationshipNotifier": { + "enabled": true, + "offlineRemovals": true, + "groups": true, + "servers": true, + "notices": false, + "friends": true, + "friendRequestCancels": true + }, + "RevealAllSpoilers": { + "enabled": false + }, + "ReverseImageSearch": { + "enabled": true + }, + "RoleColorEverywhere": { + "enabled": true, + "chatMentions": true, + "memberList": true, + "voiceUsers": true + }, + "SearchReply": { + "enabled": true + }, + "SecretRingToneEnabler": { + "enabled": true + }, + "SendTimestamps": { + "enabled": false + }, + "ServerListIndicators": { + "enabled": true, + "mode": 2 + }, + "ShikiCodeblocks": { + "enabled": true, + "theme": "https://raw.githubusercontent.com/shikijs/shiki/0b28ad8ccfbf2615f2d9d38ea8255416b8ac3043/packages/shiki/themes/dark-plus.json", + "tryHljs": "SECONDARY", + "useDevIcon": "GREYSCALE", + "bgOpacity": 100 + }, + "ShowAllMessageButtons": { + "enabled": false + }, + "ShowConnections": { + "enabled": true, + "iconSpacing": 1, + "iconSize": 32 + }, + "ShowHiddenChannels": { + "enabled": true, + "hideUnreads": true, + "showMode": 0, + "defaultAllowedUsersAndRolesDropdownState": true + }, + "ShowMeYourName": { + "enabled": true, + "mode": "nick-user", + "displayNames": false, + "inReplies": false + }, + "SilentMessageToggle": { + "enabled": false + }, + "SilentTyping": { + "enabled": true, + "showIcon": true, + "isEnabled": true + }, + "SortFriendRequests": { + "enabled": true, + "showDates": true + }, + "SpotifyControls": { + "enabled": true, + "hoverControls": true, + "useSpotifyUris": true + }, + "SpotifyCrack": { + "enabled": true, + "noSpotifyAutoPause": true, + "keepSpotifyActivityOnIdle": false + }, + "SpotifyShareCommands": { + "enabled": true + }, + "StartupTimings": { + "enabled": true + }, + "TextReplace": { + "enabled": false + }, + "ThemeAttributes": { + "enabled": false + }, + "TimeBarAllActivities": { + "enabled": false + }, + "Translate": { + "enabled": true, + "autoTranslate": false + }, + "TypingIndicator": { + "enabled": false + }, + "TypingTweaks": { + "enabled": false + }, + "Unindent": { + "enabled": false + }, + "UnsuppressEmbeds": { + "enabled": false + }, + "UrbanDictionary": { + "enabled": false + }, + "UserVoiceShow": { + "enabled": true + }, + "USRBG": { + "enabled": false, + "nitroFirst": true, + "voiceBackground": true + }, + "ValidUser": { + "enabled": false + }, + "VoiceChatDoubleClick": { + "enabled": true + }, + "VcNarrator": { + "enabled": false + }, + "VencordToolbox": { + "enabled": false + }, + "ViewIcons": { + "enabled": false + }, + "ViewRaw": { + "enabled": false + }, + "VoiceMessages": { + "enabled": false + }, + "WebContextMenus": { + "enabled": true, + "addBack": true + }, + "WebKeybinds": { + "enabled": true + }, + "WhoReacted": { + "enabled": false + }, + "Wikisearch": { + "enabled": false + }, + "SuperReactionTweaks": { + "enabled": false + }, + "ChatInputButtonAPI": { + "enabled": true + }, + "BetterGifPicker": { + "enabled": false + }, + "ClientTheme": { + "enabled": false + }, + "Decor": { + "enabled": false + }, + "FixCodeblockGap": { + "enabled": false + }, + "FixYoutubeEmbeds": { + "enabled": false + }, + "DisableCallIdle": { + "enabled": true + }, + "NewGuildSettings": { + "enabled": true, + "guild": true, + "everyone": true, + "role": true + }, + "ShowHiddenThings": { + "enabled": false + }, + "PartyMode": { + "enabled": false, + "superIntensePartyMode": 0 + }, + "MessageUpdaterAPI": { + "enabled": true + }, + "AutomodContext": { + "enabled": false + }, + "BetterRoleContext": { + "enabled": false + }, + "BetterSessions": { + "enabled": false + }, + "BetterSettings": { + "enabled": false + }, + "CtrlEnterSend": { + "enabled": false + }, + "CustomIdle": { + "enabled": false + }, + "DontRoundMyTimestamps": { + "enabled": false + }, + "FriendsSince": { + "enabled": false + }, + "ImageLink": { + "enabled": false + }, + "ImplicitRelationships": { + "enabled": false + }, + "ServerInfo": { + "enabled": true + } + }, + "notifications": { + "timeout": 5000, + "position": "bottom-right", + "useNative": "not-focused", + "logLimit": 50 + }, + "cloud": { + "authenticated": false, + "url": "https://api.vencord.dev/", + "settingsSync": false, + "settingsSyncVersion": 1717817629006 + } + } + ''; +} diff --git a/home/ebisu/meta/communication/irc.nix b/home/ebisu/meta/communication/irc.nix new file mode 100644 index 0000000..61a2ebf --- /dev/null +++ b/home/ebisu/meta/communication/irc.nix @@ -0,0 +1,7 @@ +{ pkgs, ... }: { + home.packages = with pkgs; [ + catgirl + litterbox + pounce + ]; +} diff --git a/home/ebisu/meta/default.nix b/home/ebisu/meta/default.nix new file mode 100644 index 0000000..2b92591 --- /dev/null +++ b/home/ebisu/meta/default.nix @@ -0,0 +1,19 @@ +{ ... }: +{ + imports = [ + ./communication + ./desktop + ./development + ./editor + ./education + ./filesystem + # ./gaming + ./multimedia + ./network + ./rice + ./scripts + ./steam + ./system + ./utility + ]; +} diff --git a/home/ebisu/meta/desktop/agnostic/default.nix b/home/ebisu/meta/desktop/agnostic/default.nix new file mode 100644 index 0000000..4531cc4 --- /dev/null +++ b/home/ebisu/meta/desktop/agnostic/default.nix @@ -0,0 +1,12 @@ +{ pkgs, ... }: +{ + home.packages = with pkgs; [ + showmethekey + brightnessctl + bibata-cursors + xorg.xlsclients + libnotify + # lemurs + # emptty + ]; +} diff --git a/home/ebisu/meta/desktop/default.nix b/home/ebisu/meta/desktop/default.nix new file mode 100644 index 0000000..061a773 --- /dev/null +++ b/home/ebisu/meta/desktop/default.nix @@ -0,0 +1,8 @@ +{ ... }: +{ + imports = [ + ./agnostic + ./wayland + # ./xorg + ]; +} diff --git a/home/ebisu/meta/desktop/wayland/clipboard.nix b/home/ebisu/meta/desktop/wayland/clipboard.nix new file mode 100644 index 0000000..05784b9 --- /dev/null +++ b/home/ebisu/meta/desktop/wayland/clipboard.nix @@ -0,0 +1,8 @@ +{ pkgs +, ... +}: { + home.packages = with pkgs; [ + wl-clipboard + cliphist + ]; +} diff --git a/home/ebisu/meta/desktop/wayland/default.nix b/home/ebisu/meta/desktop/wayland/default.nix new file mode 100644 index 0000000..9f5fc47 --- /dev/null +++ b/home/ebisu/meta/desktop/wayland/default.nix @@ -0,0 +1,21 @@ +{ pkgs, ... }: +{ + imports = [ + ./hyprland + ./waybar + ./clipboard.nix + ./mako.nix + ./screenshot.nix + ./wlogout.nix + ]; + + home.packages = with pkgs; [ + gammastep + wlr-randr + ydotool + swappy + swww + rofi-wayland + hyprpicker + ]; +} diff --git a/home/ebisu/meta/desktop/wayland/hyprland/default.nix b/home/ebisu/meta/desktop/wayland/hyprland/default.nix new file mode 100644 index 0000000..507274d --- /dev/null +++ b/home/ebisu/meta/desktop/wayland/hyprland/default.nix @@ -0,0 +1,33 @@ +{ inputs, pkgs, ... }: +{ + imports = [ + ./hypridle.nix + ./hyprland + ./hyprlock.nix + # ./hyprpaper.nix + ]; + + wayland.windowManager.hyprland = { + enable = true; + package = inputs.hyprland.packages.${pkgs.system}.hyprland; + xwayland.enable = true; + + systemd = { + enable = true; + + variables = [ "--all" ]; + }; + + plugins = [ + # inputs.hycov.packages.${pkgs.system}.hycov + # inputs.Hyprspace.packages.${pkgs.system}.Hyprspace + # inputs.hyprland-plugins.packages.${pkgs.stdenv.hostPlatform.system}.hyprtrails + ]; + }; + + xdg.configFile."hypr/xdph.conf".text = '' + screencopy { + max_fps = 0 + } + ''; +} diff --git a/home/ebisu/meta/desktop/wayland/hyprland/hypridle.nix b/home/ebisu/meta/desktop/wayland/hyprland/hypridle.nix new file mode 100644 index 0000000..d1b0835 --- /dev/null +++ b/home/ebisu/meta/desktop/wayland/hyprland/hypridle.nix @@ -0,0 +1,35 @@ +{ pkgs, ... }: +{ + services.hypridle = { + enable = true; + + settings = { + "$lock_command" = "pidof ${pkgs.hyprlock}/bin/hyprlock || ${pkgs.hyprlock}/bin/hyprlock"; + # $suspend_command = pidof steam || systemctl suspend || loginctl suspend + + general = { + lock_cmd = "$lock_command"; + # before_sleep_cmd = $suspend_command + before_sleep_cmd = "${pkgs.playerctl}/bin/playerctl pause"; + ignore_dbus_inhibit = false; + ignore_systemd_inhibit = false; + }; + + listener = [ + { + timeout = 180; # 3 minutes + on-timeout = "$lock_command"; + } + { + timeout = 240; # 4 minutes + on-timeout = "hyprctl dispatch dpms off"; + on-resume = "hyprctl dispatch dpms on"; + } + # { + # timeout = 540; # 9 minutes + # on-timeout = "$suspend_cmd"; + # } + ]; + }; + }; +} diff --git a/home/ebisu/meta/desktop/wayland/hyprland/hyprland/animations.nix b/home/ebisu/meta/desktop/wayland/hyprland/hyprland/animations.nix new file mode 100644 index 0000000..c47c164 --- /dev/null +++ b/home/ebisu/meta/desktop/wayland/hyprland/hyprland/animations.nix @@ -0,0 +1,86 @@ +_: { + wayland.windowManager.hyprland = { + extraConfig = '' + # animations { + # enabled = yes + + # # bezier = myBezier, 0.05, 0.9, 0.1, 1.05 + + # # animation = windows, 1, 5, myBezier + # # animation = windowsOut, 1, 7, default, popin + # # animation = border, 1, 10, default + # # animation = fade, 1, 7, default + # # animation = workspaces, 1, 6, default, slidevert + + # # bezier = overshot,0.5,0.1,0.4,1.2 + + # # animation = global, 1, 3, default + # # animation = workspaces, 1, 4, default + # # animation = windowsMove, 1, 2, default + # # animation = fade, 1, 2, default + + # bezier = overshot, 0.05, 0.5, 0.1, 1.05 + # bezier = smoothOut, 0.36, 0, 0.66, -0.56 + # bezier = smoothIn, 0.25, 0.8, 0.5, 1 + + # animation = windows, 1, 5, overshot, slide + # animation = windowsOut, 1, 4, smoothOut, slide + # animation = windowsMove, 1, 4, default + # animation = border, 1, 10, default + # animation = fade, 1, 10, smoothIn + # animation = fadeDim, 1, 10, smoothIn + # animation = workspaces, 1, 6, default + # } + + bezier = smoothIn, 0.25, 1, 0.5, 1 + bezier = wind, 0.05, 0.9, 0.1, 1.06 + bezier = winIn, 0.1, 1.1, 0.1, 1.05 + bezier = linear, 1, 1, 1, 1 + + animations { + enabled = yes + + # buttery_smoooooooth... (slide) + # animation = windows, 1, 5, default, slide + # animation = windowsOut, 1, 8, smoothIn, slide + # animation = windowsMove, 1, 7, default + # animation = fade, 1, 5, smoothIn + # animation = fadeOut, 1, 4, smoothIn + # animation = fadeDim, 1, 3, smoothIn + # animation = workspaces, 1, 5, default, slidefadevert + # animation = specialWorkspace, 1, 5, default, fade + + # buttery_smoooooooth... (Popin...) + # animation = windows, 1, 3, default, popin 70% + # animation = windowsOut, 1, 20, default, popin 85% + # animation = windowsMove, 1, 7, default + # animation = fade, 1, 6, smoothIn + # animation = fadeOut, 1, 3, smoothIn + # animation = fadeDim, 1, 3, smoothIn + # animation = workspaces, 1, 5, wind, slidefadevert 40% + + # fasssstt popin + animation = windows, 1, 2, default, popin 80% + animation = windowsOut, 1, 5, default, popin 90% + animation = windowsMove, 1, 5, default + animation = layers, 1, 3, default, popin 90% + animation = fade, 1, 4, smoothIn + animation = fadeOut, 1, 2, smoothIn + animation = fadeDim, 1, 3, smoothIn + animation = workspaces, 1, 3, default, slidefadevert 15% + animation = specialWorkspace, 1, 3, default, slidefadevert 15% + + # Random... + # animation = windows, 1, 5, wind, slide + # animation = windowsIn, 1, 4, winIn, slide + # animation = windowsOut, 1 , 7, smoothIn, slide + # animation = windowsMove, 1, 6, default + # animation = fade, 1, 5, smoothIn + # animation = fadeOut, 1, 3, smoothIn + # animation = fadeDim, 1, 3, smoothIn + # animation = workspaces, 1, 4, wind, slidefadevert 15% + # animation = specialWorkspace, 1, 3, default, slidefadevert 15% + } + ''; + }; +} diff --git a/home/ebisu/meta/desktop/wayland/hyprland/hyprland/binds.nix b/home/ebisu/meta/desktop/wayland/hyprland/hyprland/binds.nix new file mode 100644 index 0000000..4059ba5 --- /dev/null +++ b/home/ebisu/meta/desktop/wayland/hyprland/hyprland/binds.nix @@ -0,0 +1,209 @@ +_: { + wayland.windowManager.hyprland = { + settings = { + "$mod" = "SUPER"; + "$mail" = "mailspring --password-store=\"gnome-libsecret\" --enable-features=UseOzonePlatform --ozone-platform=wayland"; + "$script_path" = "$HOME/.config/hypr/hyprland/scripts"; + "$term" = "kitty"; + + bind = ( + builtins.concatLists + (builtins.genList + ( + x: + let + ws = + let + c = (x + 1) / 10; + in + builtins.toString (x + 1 - (c * 10)); + in + [ + # Switch pseudo-tag (workspaces) + "$mod, ${ws}, exec, $script_path/switch_workspace ${toString (x + 1)}" + # "$mod, ${ws}, split-workspace, ${toString (x + 1)}" + + # Move window to pseudo-tag (workspace) + "$mod SHIFT, ${ws}, exec, $script_path/move_window_to_workspace ${toString (x + 1)}" + # "$mod SHIFT, ${ws}, split-movetoworkspacesilent, ${toString (x + 1)}" + ] + ) + 10) + ++ + [ + # Scratchpads + "$mod, apostrophe, exec, hyprctl dispatch togglespecialworkspace simple_calculator" + "$mod SHIFT, RETURN, exec, hyprctl dispatch togglespecialworkspace simple_terminal" + "$mod SHIFT, c, exec, hyprctl dispatch togglespecialworkspace chatgpt" + "$mod SHIFT, s, exec, hyprctl dispatch togglespecialworkspace spotify" + "$mod SHIFT, apostrophe, exec, hyprctl dispatch togglespecialworkspace calculator" + + # Focus + "$mod, k, movefocus, u" + "$mod, j, movefocus, d" + "$mod, l, movefocus, r" + "$mod, h, movefocus, l" + + # "$mod, j, layoutmsg, cyclenext" + # "$mod, j, layoutmsg, cycleprev" + + # "$mod, tab, hycov:toggleoverview" + # "$mod SHIFT, tab, overview:toggle" + + # Emoji picker + "$mod, GRAVE, exec, rofi -modi emoji -show emoji" + + # Volume control + "$mod, MINUS, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-" + "$mod SHIFT, MINUS, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 15%-" + "$mod, EQUAL, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+" + "$mod SHIFT, EQUAL, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 15%+" + + # Session control + "$mod SHIFT, Q, exec, wlogout" + "$mod SHIFT, R, exec, hyprctl reload" + + # Window control + "$mod, F, fullscreen" + # "$mod SHIFT, F, fullscreen, 2" + "$mod SHIFT, F, exec, hyprctl dispatch fakefullscreen && $script_path/fake_fullscreen_status" + "$mod, G, togglefloating" + "$mod, P, pseudo" + "$mod SHIFT, P, pin" + "$mod, T, togglesplit" + "$mod, U, focusurgentorlast" + "$mod, Q, killactive" + "$mod, S, exec, hyprctl keyword window:sticky 1" + "$mod, b, exec, pkill -SIGUSR1 waybar" + "$mod, SPACE, layoutmsg, swapwithmaster" + "$mod, V, exec, $script_path/toggle_layout" + + # Application binds + "$mod, W, exec, $BROWSER" + "$mod SHIFT, W, exec, $term -e sudo nmtui" + "$mod, E, exec, $mail" + "$mod SHIFT, R, exec, $term -e htop" + "$mod, R, exec, rofi -show run" + "$mod SHIFT, D, exec, bitwarden-desktop" + "$mod, RETURN, exec, $term" + "$mod SHIFT, N, exec, $BROWSER https://sumi.news" + "$mod, M, exec, spotify" + "$mod SHIFT, M, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle" + "$mod ALT, A, exec, hyprpicker -a" + + # Launchers + "$mod, D, exec, rofi -show combi" + "$mod, C, exec, cliphist list | rofi -dmenu | cliphist decode | wl-copy" + + # Spotify control + "$mod, P, exec, spt pb --toggle" + "$mod SHIFT, P, exec, mpc pause; pauseallmpv" + "$mod, BRACKETLEFT, exec, spt pb --seek -10" + "$mod SHIFT, BRACKETLEFT, exec, spt pb --seek -60" + "$mod, BRACKETRIGHT, exec, spt pb --seek +10" + "$mod SHIFT, BRACKETRIGHT, exec, spt pb --seek +60" + "$mod, COMMA, exec, spt pb --pp" + "$mod, PERIOD, exec, spt pb --next" + "$mod SHIFT, PERIOD, exec, spt pb --previous" + + # Gaps control + "$mod, a, exec, $script_path/toggle_gaps" + "$mod SHIFT, a, exec, bash -c 'hyprctl keyword general:gaps_in 5; hyprctl keyword general:gaps_out 10'" + + # Increment gaps + "$mod, mouse_up, exec, hyprctl keyword general:gaps_out `expr $(hyprctl getoption general:gaps_out | awk '{ print $3 }') + 3`" + "$mod, mouse_up, exec, hyprctl keyword general:gaps_in `expr $(hyprctl getoption general:gaps_in | awk '{ print $3 }') + 2`" + + # Decrement gaps + "$mod, mouse_down, exec, hyprctl keyword general:gaps_out `expr $(hyprctl getoption general:gaps_out | awk '{ print $3 }') - 3`" + "$mod, mouse_down, exec, hyprctl keyword general:gaps_in `expr $(hyprctl getoption general:gaps_in | awk '{ print $3 }') - 2`" + + # Move focus to monitor + "$mod, LEFT, exec, $script_path/move_focus_to_monitor left" + "$mod, RIGHT, exec, $script_path/move_focus_to_monitor right" + + # Move window to monitor + "$mod SHIFT, h, exec, $script_path/move_window_to_monitor left" + "$mod SHIFT, l, exec, $script_path/move_window_to_monitor right" + + # Screenshot + ", Print, exec, screenshot --area" + "$mod SHIFT, Print, exec, screenshot --window" + "$mod CTRL, Print, exec, screenshot --monitor" + "$mod, Print, exec, screenshot --now" + "$mod SHIFT, v, exec, screenshot --now --clipboard && hyprctl dispatch togglespecialworkspace chatgpt && ydotool key 42:1 1:1 1:0 42:0 29:1 47:1 29:0 47:0" + + # Media keys + # ... + ] + ); + + binde = ( + [ + # Increment gaps + "$mod, Z, exec, hyprctl --batch \"keyword general:gaps_out `expr $(hyprctl getoption general:gaps_out | awk '{ print $3 }') + 3`; keyword general:gaps_in `expr $(hyprctl getoption general:gaps_in | awk '{ print $3 }') + 2`\"" + + # Decrement gaps + "$mod, X, exec, hyprctl --batch \"keyword general:gaps_out `expr $(hyprctl getoption general:gaps_out | awk '{ print $3 }') - 3`; keyword general:gaps_in `expr $(hyprctl getoption general:gaps_in | awk '{ print $3 }') - 2`\"" + + # Resize active window + "$mod SHIFT, UP, resizeactive, 0 -50" + "$mod SHIFT, DOWN, resizeactive, 0 50" + "$mod SHIFT, RIGHT, resizeactive, 50 0" + "$mod SHIFT, LEFT, resizeactive, -50 0" + + # Move active window + "$mod ALT, k, moveactive, 0 -100" + "$mod ALT, j, moveactive, 0 100" + "$mod ALT, l, moveactive, 100 0" + "$mod ALT, h, moveactive, -100 0" + ] + ); + + bindm = ( + [ + # Move window with mouse + "$mod, mouse:272, movewindow" + "$mod, mouse:273, resizewindow" + "$mod SHIFT, mouse:273, resizewindow 1" + ] + ); + }; + + extraConfig = '' + # Media keys + bind = , XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle + bind = , XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 0%- && wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+ + bind = , XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 0%+ && wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%- + bind = , XF86AudioPrev, exec, playerctl previous + bind = , XF86AudioNext, exec, playerctl next + bind = , XF86AudioPause, exec, playerctl play-pause + bind = , XF86AudioPlay, exec, playerctl play-pause + bind = , XF86AudioStop, exec, playerctl stop + bind = , XF86AudioRewind, exec, playerctl position -10 + bind = , XF86AudioForward, exec, playerctl position +10 + bind = , XF86AudioMedia, exec, spotify + bind = , XF86AudioMicMute, exec, pactl set-source-mute @DEFAULT_SOURCE@ toggle + + # Other media keys + bind = , XF86Calculator, exec, $term -e bc -l + bind = , XF86Sleep, exec, sudo -A zzz + bind = , XF86WWW, exec, $BROWSER + bind = , XF86DOS, exec, $term + bind = , XF86ScreenSaver, exec, pidof hyprlock || hyprlock && hyprctl dispatch dpms off + bind = , XF86TaskPane, exec, $term -e htop + bind = , XF86Mail, exec, $mail + bind = , XF86MyComputer, exec, $term -e ranger + bind = , XF86Launch1, exec, hyprctl dispatch dpms off + + # Touchpad control + bind = , XF86TouchpadToggle, exec, (synclient | grep 'TouchpadOff.*1' && synclient TouchpadOff=0) || synclient TouchpadOff=1 + bind = , XF86TouchpadOff, exec, synclient TouchpadOff=1 + bind = , XF86TouchpadOn, exec, synclient TouchpadOff=0 + + # Brightness control + bind = , XF86MonBrightnessUp, exec, xbacklight -inc 15 + bind = , XF86MonBrightnessDown, exec, xbacklight -dec 15 + ''; + }; +} diff --git a/home/ebisu/meta/desktop/wayland/hyprland/hyprland/decoration.nix b/home/ebisu/meta/desktop/wayland/hyprland/hyprland/decoration.nix new file mode 100644 index 0000000..feb9145 --- /dev/null +++ b/home/ebisu/meta/desktop/wayland/hyprland/hyprland/decoration.nix @@ -0,0 +1,43 @@ +_: { + wayland.windowManager.hyprland.settings.decoration = { + rounding = 10; + drop_shadow = true; + shadow_ignore_window = true; + shadow_range = 8; + shadow_render_power = 10; + shadow_offset = "2 2"; + "col.shadow" = "rgba(00000055)"; # 2A + + blurls = [ + "gtk-layer-shell" + "lockscreen" + ]; + + # active_opacity = 0.9 + # inactive_opacity = 0.7 + # fullscreen_opacity = 1.0 + active_opacity = 1.0; + inactive_opacity = 0.95; + + blur = { + enabled = true; + xray = true; + special = false; + # size = 1; + passes = 2; + ignore_opacity = true; + new_optimizations = true; + # vibrancy = 0.1696; + # noise = 0.01; + brightness = 1; + contrast = 1; + + popups = true; + popups_ignorealpha = 0.6; + }; + + dim_special = 0.35; + dim_inactive = false; + dim_strength = 0.1; + }; +} diff --git a/home/ebisu/meta/desktop/wayland/hyprland/hyprland/default.nix b/home/ebisu/meta/desktop/wayland/hyprland/hyprland/default.nix new file mode 100644 index 0000000..d01ddaf --- /dev/null +++ b/home/ebisu/meta/desktop/wayland/hyprland/hyprland/default.nix @@ -0,0 +1,39 @@ +_: { + imports = [ + ./animations.nix + ./binds.nix + ./decoration.nix + ./environment.nix + ./executions.nix + ./general.nix + ./plugins.nix + ./rules.nix + ./workspaces.nix + ]; + + xdg.configFile = ( + (builtins.listToAttrs ( + map + (script: { + name = "hypr/hyprland/scripts/${script}"; + + value = { + source = ./scripts/${script}; + }; + }) + [ + "common.sh" + "fake_fullscreen_status" + # "hycov_easymotion" + "initialise_waybar" + "initialise_xdg_portal" + "move_focus_to_monitor" + "move_window_to_monitor" + "move_window_to_workspace" + "switch_workspace" + "toggle_gaps" + "toggle_layout" + ] + )) + ); +} diff --git a/home/ebisu/meta/desktop/wayland/hyprland/hyprland/environment.nix b/home/ebisu/meta/desktop/wayland/hyprland/hyprland/environment.nix new file mode 100644 index 0000000..73690ac --- /dev/null +++ b/home/ebisu/meta/desktop/wayland/hyprland/hyprland/environment.nix @@ -0,0 +1,80 @@ +_: +let cursorSize = "18"; in +{ + wayland.windowManager.hyprland.settings.env = [ + # Proton + "PROTON_ENABLE_NGX_UPDATER, 1" + + # Cursor + "XCURSOR_SIZE, ${cursorSize}" + "HYPRCURSOR_SIZE, ${cursorSize}" + "HYPERCURSOR_THEME, Bibata-Modern-Ice" # WhiteSur-cursors + "XCURSOR_THEME, Bibata-Modern-Ice" + + # Wayland & Xwayland + "GDK_BACKEND, wayland,x11,*" + "SDL_VIDEODRIVER, wayland" + "CLUTTER_BACKEND, wayland" + "XWAYLAND_NO_GLAMOR, 1" # Gamescope + + # Nvidia + "LIBVA_DRIVER_NAME, nvidia" + "GBM_BACKEND, nvidia-drm" + "__GLX_VENDOR_LIBRARY_NAME, nvidia" + "__VK_LAYER_NV_optimus, NVIDIA_only" + "__NV_PRIME_RENDER_OFFLOAD, 1" + "NVD_BACKEND, direct" + + # OpenGL + "__GL_GSYNC_ALLOWED, 1" + "__GL_VRR_ALLOWED, 1" + "__GL_MaxFramesAllowed, 1" + + # Electron + # "ELECTRON_OZONE_PLATFORM_HINT, auto" + "OZONE_PLATFORM, wayland" + + # Qt + "QT_AUTO_SCREEN_SCALE_FACTOR, 1" + "QT_QPA_PLATFORM, wayland;xcb" + "QT_WAYLAND_DISABLE_WINDOWDECORATION, 1" + "QT_QPA_PLATFORMTHEME, qt5ct" + # "QT_STYLE_OVERRIDE, kvantum" + + # wlroots + "WLR_NO_HARDWARE_CURSORS, 1" + "WLR_DRM_NO_ATOMIC, 1" + "WLR_USE_LIBINPUT, 1" + "WLR_RENDERER_ALLOW_SOFTWARE, 1" + # "WLR_DRM_DEVICES, /dev/dri/card0" + # "WLR_EGL_NO_MODIFIERS, 1" + + # XDG + "XDG_SESSION_TYPE, wayland" + "XDG_CURRENT_DESKTOP, Hyprland" + "XDG_SESSION_DESKTOP, Hyprland" + + # Mozilla + "MOZ_ENABLE_WAYLAND, 1" + "MOZ_DISABLE_RDD_SANDBOX, 1" + + # Fcitx + # https://fcitx-im.org/wiki/Using_Fcitx_5_on_Wayland + "QT_IM_MODULE, fcitx" + "XMODIFIERS, @im=fcitx" + # "GTK_IM_MODULE, wayland" + # "GTK_IM_MODULE, fcitx" + "SDL_IM_MODULE, fcitx" + "GLFW_IM_MODULE, ibus" + "INPUT_METHOD, fcitx" + + # GTK + "GTK_USE_PORTAL, 1" + + # Java + "_JAVA_AWT_WM_NONREPARENTING, 1" + + # SSH + # "SSH_AUTH_SOCK, $XDG_RUNTIME_DIR/ssh-agent.socket" + ]; +} diff --git a/home/ebisu/meta/desktop/wayland/hyprland/hyprland/executions.nix b/home/ebisu/meta/desktop/wayland/hyprland/hyprland/executions.nix new file mode 100644 index 0000000..ad25ea5 --- /dev/null +++ b/home/ebisu/meta/desktop/wayland/hyprland/hyprland/executions.nix @@ -0,0 +1,53 @@ +{ pkgs, ... }: +{ + wayland.windowManager.hyprland.settings = { + exec-once = ([ + # One-shots + "hyprctl dispatch workspace 1" + "swww-daemon" + "gammastep -l 45.540750:-122.385330 >/dev/null" + "${pkgs.pyprland}/bin/pypr" + "hyprpm reload" + "swaddle" + # "${pkgs.waybar}/bin/waybar" + "waybar" + "hyprctl setcursor Bibata-Modern-Ice 18" + + # Fcitx5 + "fcitx5-remote -r" + "fcitx5 -d --replace" + "fcitx5-remote -r" + + # KWallet + # "pam_kwallet_init" + # "kwalletd6" + + # GNOME/Keyring + "gnome-keyring-daemon --replace --components=pkcs11,secrets,ssh,gpg" + "/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 || /usr/libexec/polkit-gnome-authentication-agent-1" + + # XDG, XDPH, & Qt + "dbus-update-activation-environment --systemd --all" + "dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP" + "systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP" + "systemctl --user import-environment QT_QPA_PLATFORMTHEME" + "$script_path/initialise_xdg_portal" + + # Clipboard + "wl-paste --type text --watch cliphist store" + "wl-paste --type image --watch cliphist store" + + # JamesDSP & Solaar + "jamesdsp -t" + # "solaar -w hide" + + # SSH + # "killall -q ssh-agent" + # "eval $(ssh-agent -c)" + # "set -Ux SSH_AUTH_SOCK $SSH_AUTH_SOCK" + # "set -Ux SSH_AGENT_PID $SSH_AGENT_PID" + # "set -Ux SSH_AUTH_SOCK $SSH_AUTH_SOCK" + # "export SSH_AUTH_SOCK=\"$XDG_RUNTIME_DIR/ssh-agent.socket\"" + ]); + }; +} diff --git a/home/ebisu/meta/desktop/wayland/hyprland/hyprland/general.nix b/home/ebisu/meta/desktop/wayland/hyprland/hyprland/general.nix new file mode 100644 index 0000000..92d7c67 --- /dev/null +++ b/home/ebisu/meta/desktop/wayland/hyprland/hyprland/general.nix @@ -0,0 +1,119 @@ +{ config, ... }: { + wayland.windowManager.hyprland = { + settings = { + monitor = [ + "HDMI-A-2, [email protected], 0x0, 1" + "DP-2, [email protected], 1920x0, 1" + "DP-1, [email protected], 3840x0, 1" + ]; + + source = "${config.home.homeDirectory}/.cache/wal/colors-hyprland"; + + general = { + gaps_in = 5; + gaps_out = 10; + border_size = 0; + layout = "master"; + allow_tearing = true; + resize_on_border = true; + no_focus_fallback = true; + }; + + input = { + kb_layout = "us"; + # kb_variant = + # kb_model = + # kb_options = + # kb_rules = + repeat_rate = 35; # 50 + repeat_delay = 250; # 200 + follow_mouse = 1; + special_fallthrough = true; + + touchpad = { + natural_scroll = true; + disable_while_typing = true; + clickfinger_behavior = true; + scroll_factor = 0.15; + tap-to-click = true; + middle_button_emulation = true; + }; + + sensitivity = -0.5; + accel_profile = "flat"; + scroll_factor = 1.0; + # natural_scroll = false; + }; + + binds = { + allow_workspace_cycles = true; + scroll_event_delay = 0; + workspace_back_and_forth = true; + }; + + dwindle = { + pseudotile = true; + preserve_split = true; + force_split = 2; + smart_split = false; + smart_resizing = false; + no_gaps_when_only = 0; + special_scale_factor = 0.98; + }; + + master = { + allow_small_split = true; + new_status = "master"; + mfact = 0.55; + # no_gaps_when_only = yes; + orientation = "left"; + inherit_fullscreen = false; + }; + + gestures = { + workspace_swipe = true; + workspace_swipe_distance = 700; + workspace_swipe_fingers = 4; + workspace_swipe_cancel_ratio = 0.2; + workspace_swipe_min_speed_to_force = 5; + workspace_swipe_direction_lock = true; + workspace_swipe_direction_lock_threshold = 10; + workspace_swipe_create_new = true; + }; + + misc = { + vrr = false; + vfr = false; + enable_swallow = true; + swallow_regex = "^(kitty|footclient|foot|Alacritty|wezterm)$"; + disable_hyprland_logo = true; + disable_splash_rendering = true; + force_default_wallpaper = 0; + mouse_move_enables_dpms = true; + # key_press_enables_dpms = true; + # focus_on_activate = true; + animate_manual_resizes = true; + # animate_mouse_windowdragging = false; + mouse_move_focuses_monitor = true; + # new_window_takes_over_fullscreen = 2; + allow_session_lock_restore = true; + initial_workspace_tracking = false; + }; + + cursor = { + hide_on_key_press = true; + enable_hyprcursor = true; + }; + + xwayland = { + force_zero_scaling = true; + }; + + debug = { + watchdog_timeout = 0; + disable_logs = false; + damage_blink = false; + }; + }; + }; +} diff --git a/home/ebisu/meta/desktop/wayland/hyprland/hyprland/plugins.nix b/home/ebisu/meta/desktop/wayland/hyprland/hyprland/plugins.nix new file mode 100644 index 0000000..61d73e3 --- /dev/null +++ b/home/ebisu/meta/desktop/wayland/hyprland/hyprland/plugins.nix @@ -0,0 +1,69 @@ +_: { + wayland.windowManager.hyprland.settings.plugin = { + # split-monitor-workspaces = { + # count = 10; + # keep_focused = 0; + # enable_notifications = 0; + # }; + + hyprtrails = { + color = "rgba(cfddf619)"; + }; + + hyprfocus = { + enabled = true; + animate_floating = true; + animate_workspacechange = true; + focus_animation = "flash"; + + bezier = [ + "bezIn, 0.5, 0.0, 1.0, 0.5" + "bezOut, 0.0, 0.5, 0.5, 1.0" + "overshot, 0.05, 0.9, 0.1, 1.05" + "smoothOut, 0.36, 0, 0.66, -0.56" + "smoothIn, 0.25, 1, 0.5, 1" + "realsmooth, 0.28, 0.29, .69, 1.08" + ]; + + flash = { + flash_opacity = 0.85; + in_bezier = "realsmooth"; + in_speed = 0.5; + out_bezier = "realsmooth"; + out_speed = 3; + }; + + shrink = { + shrink_percentage = 0.99; + in_bezier = "realsmooth"; + in_speed = 1; + out_bezier = "realsmooth"; + out_speed = 2; + }; + }; + + hycov = { + overview_gappo = 10; # gaps width from screen edge + overview_gappi = 10; # gaps width from clients + enable_hotarea = 0; # enable mouse cursor hotarea, when cursor enter hotarea, it will toggle overview + enable_click_action = 1; # enable mouse left button jump and right button kill in overview mode + hotarea_monitor = "all"; # monitor name which hotarea is in, default is all + hotarea_pos = 1; # position of hotarea (1: bottom left, 2: bottom right, 3: top left, 4: top right) + hotarea_size = 10; # hotarea size, 10x10 + swipe_fingers = 4; # finger number of gesture,move any directory + move_focus_distance = 100; # distance for movefocus,only can use 3 finger to move + enable_gesture = 0; # enable gesture + auto_exit = 1; # enable auto exit when no client in overview + auto_fullscreen = 0; # auto make active window maximize after exit overview + only_active_workspace = 0; # only overview the active workspace + only_active_monitor = 0; # only overview the active monitor + enable_alt_release_exit = 1; # alt swith mode arg,see readme for detail + alt_replace_key = "Super_L"; # alt swith mode arg,see readme for detail + alt_toggle_auto_next = 0; # auto focus next window when toggle overview in alt swith mode + click_in_cursor = 1; # when click to jump,the target windwo is find by cursor, not the current foucus window. + height_of_titlebar = 0; # height deviation of title bar height + show_special = 0; # show windwos in special workspace in overview. + raise_float_to_top = 1; # raise the window that is floating before to top after leave overview mode + }; + }; +} diff --git a/home/ebisu/meta/desktop/wayland/hyprland/hyprland/rules.nix b/home/ebisu/meta/desktop/wayland/hyprland/hyprland/rules.nix new file mode 100644 index 0000000..d933d5e --- /dev/null +++ b/home/ebisu/meta/desktop/wayland/hyprland/hyprland/rules.nix @@ -0,0 +1,79 @@ +_: { + wayland.windowManager.hyprland = { + settings = { + # Layer Rules + layerrule = [ + "animation slide, notifications" + "noanim, selection" + "noanim, picker" + ]; + + windowrulev2 = [ + # Dialog Rules + "float, class:file_progress" + "float, class:confirm" + "float, class:dialog" + "float, class:download" + "float, class:notification" + "float, class:error" + "float, class:splash" + "float, class:confirmreset" + "float, title:Open File" + "float, title:Save File" + "float, title:branchdialog" + "float, title:^(Open File)(.*)$" + "float, title:^(Select a File)(.*)$" + "float, title:^(Choose wallpaper)(.*)$" + "float, title:^(Open Folder)(.*)$" + "float, title:^(Save As)(.*)$" + "float, title:^(Library)(.*)$" + "float, initialClass:^(xdg-desktop-portal-.*)$" + + # Control Application Rules + "float, class:^(Network)$" + "float, class:^(pavucontrol)$" + "float, class:^(Color Picker)$" + "float, class:^(File Picker)$" + "float, class:^(nm-connection-editor)$" + "float, class:pavucontrol-qt" + "float, class:pavucontrol" + "float, title:^(Media viewer)$" + "float, title:^(Volume Control)$" + "float, title:^(Picture-in-Picture)$" + "float, class:^(blueberry.py)$" + "float, class:Lxappearance" + "pseudo, class:fcitx" + "size 50% 50%, title:^(Volume Control)$" + + # Application Rules + "float, class:^(transmission-gtk)$" + "float, class:viewnior" + "float, class:feh" + "float, class:^(steam)$" + "float, class:file-roller" + "center, class:feh" + "workspace 9, initialTitle:^(Spotify Premium)$" + "tile, initialTitle:^(Photopea)$" + "tile, initialTitle:^(WorldsPlayer by Worlds Inc)$" + # "size 75% 75%, class:feh" + + # XWayland Video Bridge + "noblur, class:^(xwaylandvideobridge)$" + "noanim, class:^(xwaylandvideobridge)$" + "noinitialfocus, class:^(xwaylandvideobridge)$" + "opacity 0.0 override, class:^(xwaylandvideobridge)$" + "maxsize 1 1, class:^(xwaylandvideobridge)$" + + # Tearing + "immediate, class:.*\.exe" + "immediate, class:(steam_app)" + + # Idle Inhibit + # "idleinhibit fullscreen, class:^(*)$" + # "idleinhibit fullscreen, title:^(*)$" + "idleinhibit fullscreen, fullscreen:1" + "idleinhibit focus, class:mpv" + ]; + }; + }; +} diff --git a/home/ebisu/meta/desktop/wayland/hyprland/hyprland/scripts/common.sh b/home/ebisu/meta/desktop/wayland/hyprland/hyprland/scripts/common.sh new file mode 100644 index 0000000..25be5b6 --- /dev/null +++ b/home/ebisu/meta/desktop/wayland/hyprland/hyprland/scripts/common.sh @@ -0,0 +1,146 @@ +#!/usr/bin/env bash + +# . "$(dirname "$(readlink -f "${BASH_SOURCE[0]}" 2>/dev/null || echo "${0}")" || true)/common.sh" +# or +# . "${HOME}/.config/hypr/hyprland/scripts/common.sh" + +get_hyprctl_monitors() { + hyprctl monitors -j || true +} + +get_hyprctl_workspaces() { + hyprctl workspaces -j || true +} + +get_focused_monitor() { + (get_hyprctl_monitors || true) | + jq -r '.[] | select(.focused) | .name' +} + +get_active_monitor() { + get_focused_monitor +} + +get_active_workspaces() { + local monitor=$1 + + (get_hyprctl_workspaces || true) | + (jq -r ".[] | select(.monitor == \"${monitor}\") | .id" || true) | + grep -v '-' +} + +get_active_workspace() { + local monitor=$1 + + (get_hyprctl_monitors || true) | + jq -r ".[] | select(.name == \"${monitor}\") | .activeWorkspace.id" +} + +get_current_workspace() { + (hyprctl activeworkspace -j || true) | + jq -r ".id" +} + +get_empty_workspace() { + local monitor=$1 + + (hyprctl workspaces -j || true) | + (jq -r ".[] | select(.monitor == \"${monitor}\" and .windows == 0) | .id" || true) | + (grep -v '-' || true) | + head -n 1 +} + +get_workspace_client_count() { + local workspace=$1 + + (hyprctl workspaces -j || true) | jq -r ".[] | select(.id == ${workspace}) | .windows" +} + +get_relative_target_workspace() { + target_workspace=$1 + workspace=0 + + case "$(get_focused_monitor)" in + "HDMI-A-2") + workspace=$((target_workspace + 10)) + ;; + "DP-2") + workspace=${target_workspace} + ;; + "DP-1") + workspace=$((target_workspace + 20)) + ;; + *) + exit 1 + ;; + esac + + echo "${workspace}" +} + +is_monitor_fullscreen() { + monitor=$1 + + (hyprctl workspaces -j || true) | + jq -r ".[] | select(.monitor == \"${monitor}\") | select(.id == $(get_active_workspace "${monitor}" || true)) | .hasfullscreen" +} + +get_relative_target_monitor() { + direction=$1 + ignore_fullscreen=${2:-0} + + case $(get_focused_monitor) in + "HDMI-A-2") + if [[ "${direction}" == "right" ]]; then + target_monitor="DP-2" + else + target_monitor="DP-1" + fi + ;; + "DP-2") + if [[ "${direction}" == "right" ]]; then + target_monitor="DP-1" + else + target_monitor="HDMI-A-2" + fi + ;; + "DP-1") + if [[ "${direction}" == "left" ]]; then + target_monitor="DP-2" + else + target_monitor="HDMI-A-2" + fi + ;; + *) + exit 1 + ;; + esac + + if [[ "$(is_monitor_fullscreen "${target_monitor}")" == "true" && "${ignore_fullscreen}" = 0 ]]; then + case $target_monitor in + "HDMI-A-2") + if [[ "$direction" == "right" ]]; then + target_monitor="DP-2" + else + target_monitor="DP-1" + fi + ;; + "DP-2") + if [[ "$direction" == "right" ]]; then + target_monitor="DP-1" + else + target_monitor="HDMI-A-2" + fi + ;; + "DP-1") + if [[ "$direction" == "left" ]]; then + target_monitor="DP-2" + else + target_monitor="HDMI-A-2" + fi + ;; + esac + fi + + echo "${target_monitor}" +} diff --git a/home/ebisu/meta/desktop/wayland/hyprland/hyprland/scripts/fake_fullscreen_status b/home/ebisu/meta/desktop/wayland/hyprland/hyprland/scripts/fake_fullscreen_status new file mode 100755 index 0000000..e198758 --- /dev/null +++ b/home/ebisu/meta/desktop/wayland/hyprland/hyprland/scripts/fake_fullscreen_status @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +. "${HOME}/.config/hypr/hyprland/scripts/common.sh" + +previous_id=$(cat /tmp/fake_fullscreen_notify_id 2>/dev/null) +previous_id_flag="" + +if [[ -n "${previous_id}" ]]; then + previous_id_flag="-r ${previous_id}" +fi + +id=$(notify-send -p ${previous_id_flag} "$(hyprctl activewindow -j | jq -r '.title') + +Fake fullscreen is $([[ "$(hyprctl activewindow -j | jq -r '.fakeFullscreen')" == "true" ]] && + echo "enabled" || + echo "disabled").") + +echo "${id}" >/tmp/fake_fullscreen_notify_id diff --git a/home/ebisu/meta/desktop/wayland/hyprland/hyprland/scripts/hycov_easymotion b/home/ebisu/meta/desktop/wayland/hyprland/hyprland/scripts/hycov_easymotion new file mode 100755 index 0000000..ab7c3bb --- /dev/null +++ b/home/ebisu/meta/desktop/wayland/hyprland/hyprland/scripts/hycov_easymotion @@ -0,0 +1,10 @@ +#!/usr/bin/env dash + +workspace_name=$(hyprctl -j activeworkspace | jq -r '.name') + +if [ "${workspace_name}" = "OVERVIEW" ]; then + hyprctl dispatch hycov:leaveoverview +else + hyprctl dispatch hycov:enteroverview + hyprctl dispatch 'easymotion action:hyprctl --batch "dispatch focuswindow address:{} ; dispatch hycov:leaveoverview"' +fi diff --git a/home/ebisu/meta/desktop/wayland/hyprland/hyprland/scripts/initialise_gtk b/home/ebisu/meta/desktop/wayland/hyprland/hyprland/scripts/initialise_gtk new file mode 100755 index 0000000..861aa12 --- /dev/null +++ b/home/ebisu/meta/desktop/wayland/hyprland/hyprland/scripts/initialise_gtk @@ -0,0 +1,19 @@ +#!/usr/bin/env dash + +THEME='WhiteSur-Dark' +ICONS='WhiteSur-dark' +FONT='SF Pro Text' +# CURSOR='WhiteSur-cursors' +CURSOR='Bibata-Modern-Ice' +CURSOR_SIZE='18' +SCHEMA='gsettings set org.gnome.desktop.interface' + +apply_themes() { + ${SCHEMA} gtk-theme "${THEME}" + ${SCHEMA} icon-theme "${ICONS}" + ${SCHEMA} cursor-theme "${CURSOR}" + ${SCHEMA} cursor-size "${CURSOR_SIZE}" + ${SCHEMA} font-name "${FONT}" +} + +apply_themes diff --git a/home/ebisu/meta/desktop/wayland/hyprland/hyprland/scripts/initialise_waybar b/home/ebisu/meta/desktop/wayland/hyprland/hyprland/scripts/initialise_waybar new file mode 100755 index 0000000..09f7ff9 --- /dev/null +++ b/home/ebisu/meta/desktop/wayland/hyprland/hyprland/scripts/initialise_waybar @@ -0,0 +1,19 @@ +#!/usr/bin/env dash + +CONFIG_FILES="${HOME}/.config/waybar/config.json ${HOME}/.config/waybar/default-modules.json ${HOME}/.config/waybar/style.css ${HOME}/.cache/wal/colors-waybar.css" + +trap "pkill -x waybar" EXIT + +\cp -r ~/.cache/wal/colors-waybar.css ~/.config/waybar/ + +while true; do + if ! pgrep -x "waybar" >/dev/null; then + waybar -c ~/.config/waybar/config.json -s ~/.config/waybar/style.css & + fi + + inotifywait -e create,modify ${CONFIG_FILES} + + pkill -x waybar + + while pgrep -x waybar >/dev/null; do sleep 0.5; done +done diff --git a/home/ebisu/meta/desktop/wayland/hyprland/hyprland/scripts/initialise_xdg_portal b/home/ebisu/meta/desktop/wayland/hyprland/hyprland/scripts/initialise_xdg_portal new file mode 100755 index 0000000..10470eb --- /dev/null +++ b/home/ebisu/meta/desktop/wayland/hyprland/hyprland/scripts/initialise_xdg_portal @@ -0,0 +1,13 @@ +#!/usr/bin/env dash + +sleep 1 + +killall -e xdg-desktop-portal-hyprland +killall -e xdg-desktop-portal-wlr +killall xdg-desktop-portal + +/usr/lib/xdg-desktop-portal-hyprland & + +sleep 2 + +/usr/lib/xdg-desktop-portal & diff --git a/home/ebisu/meta/desktop/wayland/hyprland/hyprland/scripts/move_focus_to_monitor b/home/ebisu/meta/desktop/wayland/hyprland/hyprland/scripts/move_focus_to_monitor new file mode 100755 index 0000000..27562a9 --- /dev/null +++ b/home/ebisu/meta/desktop/wayland/hyprland/hyprland/scripts/move_focus_to_monitor @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +. "${HOME}/.config/hypr/hyprland/scripts/common.sh" + +target_monitor=$(get_relative_target_monitor "$1" 1) + +if [[ -n "${target_monitor}" ]]; then + hyprctl dispatch focusmonitor "${target_monitor}" +fi diff --git a/home/ebisu/meta/desktop/wayland/hyprland/hyprland/scripts/move_window_to_monitor b/home/ebisu/meta/desktop/wayland/hyprland/hyprland/scripts/move_window_to_monitor new file mode 100755 index 0000000..06e4f94 --- /dev/null +++ b/home/ebisu/meta/desktop/wayland/hyprland/hyprland/scripts/move_window_to_monitor @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +. "${HOME}/.config/hypr/hyprland/scripts/common.sh" + +target_monitor=$(get_relative_target_monitor "$1") +target_workspace=$(get_active_workspace "${target_monitor}") + +# target_workspace=$(get_empty_workspace $target_monitor) + +# if [[ -z "$target_workspace" ]]; then +# target_workspace=$(get_active_workspaces $target_monitor | head -n 1) +# fi + +if [[ -n "${target_workspace}" ]]; then + hyprctl dispatch movetoworkspace "${target_workspace}" +fi diff --git a/home/ebisu/meta/desktop/wayland/hyprland/hyprland/scripts/move_window_to_workspace b/home/ebisu/meta/desktop/wayland/hyprland/hyprland/scripts/move_window_to_workspace new file mode 100755 index 0000000..4256a9f --- /dev/null +++ b/home/ebisu/meta/desktop/wayland/hyprland/hyprland/scripts/move_window_to_workspace @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +. "${HOME}/.config/hypr/hyprland/scripts/common.sh" + +initial_active_workspace="$(get_current_workspace)" +target_workspace="$(get_relative_target_workspace "${1}")" + +hyprctl dispatch movetoworkspace "${target_workspace}" + +if [[ $(get_workspace_client_count "${target_workspace}") -gt 2 ]]; then + hyprctl dispatch workspace "${initial_active_workspace}" +fi diff --git a/home/ebisu/meta/desktop/wayland/hyprland/hyprland/scripts/source.bak/screenshot.ab b/home/ebisu/meta/desktop/wayland/hyprland/hyprland/scripts/source.bak/screenshot.ab new file mode 100644 index 0000000..6bc510d --- /dev/null +++ b/home/ebisu/meta/desktop/wayland/hyprland/hyprland/scripts/source.bak/screenshot.ab @@ -0,0 +1,158 @@ +let current_date_time = unsafe $date +%Y-%m-%d-%H-%M-%S$ +let output_directory = "{unsafe $xdg-user-dir PICTURES$}/Screenshots" +let output_file = "Screenshot_{current_date_time}_{unsafe $echo \$RANDOM$}.png" + +fun notify_command(message: Text): Null { + unsafe $notify-send -h string:x-canonical-private-synchronous:shot-notify -u low "{message}"$ +} + +fun notify(clipboard: Bool, type: Text): Null { + notify_command("Screenshot copied to clipboard. ({type})") + + if not clipboard { + if unsafe $test -f "{output_directory}/{output_file}" && + echo 'true' || + echo 'false'$ == "true" + { + // unsafe $feh "{output_directory}/{output_file}"$ + + notify_command("Screenshot saved. ({type})") + } else { + notify_command("Screenshot deleted.") + } + } +} + +fun get_hyprctl_monitors(): Text { + return $hyprctl monitors -j || true$ failed { + notify_command("Failed to get monitors.") + + fail status + } +} + +fun get_focused_monitor(): Text { + let monitors = get_hyprctl_monitors() failed { + notify_command("Failed to get monitors.") + + fail status + } + + return $echo {monitors} | jq -r '.[] | select(.focused) | .name'$ failed { + notify_command("Failed to get focused monitor.") + + fail status + } +} + +fun screenshot_now(clipboard: Bool): Null { + if clipboard { + unsafe $(grim - || true) | wl-copy$ + } else { + unsafe $cd "{output_directory}" && + grim - | + tee "{output_file}" | + wl-copy$ + } + + notify(clipboard, "now") +} + +fun screenshot_window(clipboard: Bool): Null { + let width_position = unsafe $hyprctl activewindow | + grep 'at:' | + cut -d':' -f2 | + tr -d ' ' | + tail -n1$ + let width_size = unsafe $hyprctl activewindow | + grep 'size:' | + cut -d':' -f2 | + tr -d ' ' | + tail -n1 | + sed s/,/x/g$ + + if clipboard { + unsafe $grim -g "{width_position} {width_size}" - | wl-copy$ + } else { + unsafe $cd "{output_directory}" && + grim -g "{width_position} {width_size}" - | + tee "{output_file}" | + wl-copy$ + } + + notify(clipboard, "window") +} + +fun screenshot_monitor(clipboard: Bool): Null { + if clipboard { + unsafe $grim -o "{get_focused_monitor()}" - | wl-copy$ + } else { + unsafe $cd "{output_directory}" && + grim -o "{get_focused_monitor()}" - | + tee "{output_file}" | + wl-copy$ + } + + notify(clipboard, "monitor") +} + +fun screenshot_area(clipboard: Bool): Null { + // slurp -b 1B1F28CC -c E06B74ff -s C778DD0D -w 2 + + if clipboard { + unsafe $grim -g "{unsafe $slurp$}" - | wl-copy$ + } else { + unsafe $cd "{output_directory}" && + grim -g "{unsafe $slurp$}" - | + tee "{output_file}" | + wl-copy$ + } + + notify(clipboard, "area") +} + +fun screenshot(mode: Text, clipboard: Bool): Null { + if { + mode == "now" { + screenshot_now(clipboard) + } + mode == "window" { + screenshot_window(clipboard) + } + mode == "monitor" { + screenshot_monitor(clipboard) + } + mode == "area" { + screenshot_area(clipboard) + } + else { + echo "usage: {unsafe $echo "\${0}"$} [flags]\n" + echo "flags:" + echo " --now" + echo " --window" + echo " --area" + echo " --monitor" + echo " --clipboard" + echo " --help" + echo "" + } + } +} + +main { + if unsafe $test -d "{output_directory}" && + echo 'true' || + echo 'false'$ == "false" + { + $mkdir -p "{output_directory}"$ failed { + notify_command("Failed to create output directory.") + + fail status + } + } + + screenshot( + unsafe $echo "\${1}" | sed -E s/--//g$, + unsafe $echo "\${2}"$ == "--clipboard" + ) +} diff --git a/home/ebisu/meta/desktop/wayland/hyprland/hyprland/scripts/switch_workspace b/home/ebisu/meta/desktop/wayland/hyprland/hyprland/scripts/switch_workspace new file mode 100755 index 0000000..fc8900c --- /dev/null +++ b/home/ebisu/meta/desktop/wayland/hyprland/hyprland/scripts/switch_workspace @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +. "${HOME}/.config/hypr/hyprland/scripts/common.sh" + +hyprctl dispatch workspace "$(get_relative_target_workspace "${1}")" diff --git a/home/ebisu/meta/desktop/wayland/hyprland/hyprland/scripts/toggle_gaps b/home/ebisu/meta/desktop/wayland/hyprland/hyprland/scripts/toggle_gaps new file mode 100755 index 0000000..d593ab2 --- /dev/null +++ b/home/ebisu/meta/desktop/wayland/hyprland/hyprland/scripts/toggle_gaps @@ -0,0 +1,13 @@ +#!/usr/bin/env dash + +inner_gap_size=5 +outer_gap_size=10 + +if [ "$(hyprctl getoption general:gaps_in | awk '{print $3}' || true)" -eq 0 ] && + [ "$(hyprctl getoption general:gaps_out | awk '{print $3}' || true)" -eq 0 ]; then + hyprctl keyword general:gaps_in "${inner_gap_size}" + hyprctl keyword general:gaps_out "${outer_gap_size}" +else + hyprctl keyword general:gaps_in 0 + hyprctl keyword general:gaps_out 0 +fi diff --git a/home/ebisu/meta/desktop/wayland/hyprland/hyprland/scripts/toggle_layout b/home/ebisu/meta/desktop/wayland/hyprland/hyprland/scripts/toggle_layout new file mode 100755 index 0000000..1ef8774 --- /dev/null +++ b/home/ebisu/meta/desktop/wayland/hyprland/hyprland/scripts/toggle_layout @@ -0,0 +1,22 @@ +#!/usr/bin/env dash + +layout=$(hyprctl -j getoption general:layout) +new_layout="" + +case "$(echo "${layout}" | jq -r .str)" in +dwindle) + hyprctl keyword general:layout master + + new_layout="master" + + ;; +master) + hyprctl keyword general:layout dwindle + + new_layout="dwindle" + + ;; +*) ;; +esac + +notify-send "You've changed the layout to ${new_layout}." diff --git a/home/ebisu/meta/desktop/wayland/hyprland/hyprland/workspaces.nix b/home/ebisu/meta/desktop/wayland/hyprland/hyprland/workspaces.nix new file mode 100644 index 0000000..99599d3 --- /dev/null +++ b/home/ebisu/meta/desktop/wayland/hyprland/hyprland/workspaces.nix @@ -0,0 +1,45 @@ +{ config, pkgs, ... }: +{ + wayland.windowManager.hyprland.settings.workspace = + ( + let + generateWorkspaces = + monitor: workspaces: offset: + builtins.genList ( + x: + let + ws = + let + c = (x + 1) / workspaces; + in + builtins.toString (x + 1 - (c * workspaces)); + in + [ "${toString (x + offset + 1)}, monitor:${monitor}" ] + ) workspaces; + generateWorkspacesAll = + monitors: tags: + builtins.concatLists ( + builtins.map ( + monitor: + generateWorkspaces (builtins.elemAt monitors monitor) tags ( + builtins.elemAt (builtins.genList (index: index * tags) (builtins.length monitors)) monitor + ) + ) (builtins.genList (index: index) (builtins.length monitors)) + ); + in + builtins.concatLists ( + generateWorkspacesAll [ + "DP-2" + "HDMI-A-2" + "DP-1" + ] 10 + ) + ) + ++ [ + "special:simple_terminal, on-created-empty:[float;center;size 50% 65%] ${pkgs.kitty}/bin/kitty --class simple_terminal" + "special:simple_calculator, on-created-empty:[float;center;size 50% 50%] ${pkgs.kitty}/bin/kitty --class simple_calculator -e bc -lq" + "special:chatgpt, on-created-empty:[float;center;size 65% 75%] thorium --user-data-dir=${config.home.homeDirectory}/.local/share/thorium-browser-chatgpt --app='https://chatgpt.com/'" + "special:spotify, on-created-empty:[float;center;size 65% 90%] ${pkgs.spotify}/bin/spotify" + "special:calculator, on-created-empty:[float;center;size 50% 50%] ${pkgs.qalculate-gtk}/bin/qalculate-gtk" + ]; +} diff --git a/home/ebisu/meta/desktop/wayland/hyprland/hyprlock.nix b/home/ebisu/meta/desktop/wayland/hyprland/hyprlock.nix new file mode 100644 index 0000000..2577702 --- /dev/null +++ b/home/ebisu/meta/desktop/wayland/hyprland/hyprlock.nix @@ -0,0 +1,85 @@ +{ config, ... }: +let + colourScheme = builtins.fromJSON ( + builtins.readFile "${config.home.homeDirectory}/.cache/wal/colors.json" + ); + replaceHash = str: builtins.replaceStrings [ "#" ] [ "" ] str; +in +{ + programs.hyprlock = { + enable = true; + + settings = { + general = { + disable_loading_bar = false; + hide_cursor = true; + ignore_empty_input = true; + grace = 10; + }; + + background = [ { path = "${config.home.homeDirectory}/.local/share/bg"; } ]; + + input-field = [ + { + # Size & Position + size = "500, 75"; + position = "0, 0"; + + # Other + fade_on_empty = true; + dots_size = 0.2; + dots_spacing = 0.5; + outline_thickness = 3; + placeholder_text = ""; + fail_text = ""; + + # Colour + outer_color = "rgb(1D2433)"; # bg + inner_color = "rgb(1D2433)"; # bg + font_color = "rgb(BDD9F2)"; # fg + check_color = "rgb(9BB8F2)"; # blue + fail_color = "rgb(D67C8E)"; # red + capslock_color = "rgb(D6A37C)"; # orange + + # Shadow + shadow_passes = 1; + shadow_size = 8; + shadow_boost = 0.6; + } + ]; + + label = [ + { + # Text + text = "cmd[update:60000] LC_ALL='ja_JP.utf8' TZ=America/Los_Angeles date '+%H時%M分'"; + position = "75, -75"; + color = "rgba(9BB8F290)"; # blue + + # Font + font_size = 120; + font_family = "SF Pro, Hiragino Sans"; + + # Shadow + shadow_passes = 1; + shadow_size = 6; + shadow_boost = 0.75; + } + { + # Text + text = "cmd[update:60000] LC_ALL='ja_JP.utf8' TZ=America/Los_Angeles date '+%b%-e日(%a)'"; + position = "75, 0"; + color = "rgba(9BB8F270)"; # blue + + # Font + font_size = 40; + font_family = "SF Pro, Hiragino Sans"; + + # Shadow + shadow_passes = 1; + shadow_size = 4; + shadow_boost = 0.9; + } + ]; + }; + }; +} diff --git a/home/ebisu/meta/desktop/wayland/hyprland/hyprpaper.nix b/home/ebisu/meta/desktop/wayland/hyprland/hyprpaper.nix new file mode 100644 index 0000000..ce6c79a --- /dev/null +++ b/home/ebisu/meta/desktop/wayland/hyprland/hyprpaper.nix @@ -0,0 +1,12 @@ +{ + services.hyprpaper = { + enable = true; + + settings = { + preload = "~/Pictures/wallpaper.png"; + wallpaper = ",~/Pictures/wallpaper.png"; + splash = false; + ipc = true; + }; + }; +} diff --git a/home/ebisu/meta/desktop/wayland/hyprland/inspo.txt b/home/ebisu/meta/desktop/wayland/hyprland/inspo.txt new file mode 100644 index 0000000..39d2483 --- /dev/null +++ b/home/ebisu/meta/desktop/wayland/hyprland/inspo.txt @@ -0,0 +1,4 @@ +https://github.com/codingjerk/dotfiles/blob/main/config/hypr/hyprland.conf +https://github.com/JoshM-Yoru/dotfiles/blob/main/hypr/hyprland.conf +https://github.com/end-4/dots-hyprland/blob/main/.config/hypr/hyprland.conf +https://github.com/Andy3153/hyprland-rice
\ No newline at end of file diff --git a/home/ebisu/meta/desktop/wayland/mako.nix b/home/ebisu/meta/desktop/wayland/mako.nix new file mode 100644 index 0000000..4ec2a09 --- /dev/null +++ b/home/ebisu/meta/desktop/wayland/mako.nix @@ -0,0 +1,59 @@ +{ pkgs, config, ... }: +let + colourScheme = builtins.fromJSON ( + builtins.readFile "${config.home.homeDirectory}/.cache/wal/colors.json" + ); +in +{ + services.mako.enable = true; + + xdg.configFile."mako/config".text = '' + font=SF Mono 11 + + layer=overlay + + anchor=top-right + width=330 + padding=10 + margin=10 + border-radius=10 + outer-margin=0 + + default-timeout=5000 + max-history=0 + ignore-timeout=1 + + format=%s\n%b + + icons=1 + # max-icon-size=32 + + max-visible=-1 + + border-color=#00000040 + border-size=1 + + background-color=${colourScheme.colors.color0} + text-color=${colourScheme.colors.color15} + + # [urgency=low] + # border-color=${colourScheme.colors.color2} + # background-color=${colourScheme.colors.color4} + # text-color=${colourScheme.colors.color6} + + # [urgency=normal] + # border-color=${colourScheme.colors.color1} + # background-color=${colourScheme.colors.color3} + # text-color=${colourScheme.colors.color5} + # default-timeout=10000 + # ignore-timeout=1 + + # [urgency=high] + # font=Sauce Code Pro 16 + # border-color=${colourScheme.colors.color1} + # background-color=${colourScheme.colors.color2} + # text-color=${colourScheme.colors.color6} + # default-timeout=0 + # ignore-timeout=1 + ''; +} diff --git a/home/ebisu/meta/desktop/wayland/screenshot.nix b/home/ebisu/meta/desktop/wayland/screenshot.nix new file mode 100644 index 0000000..5900ee2 --- /dev/null +++ b/home/ebisu/meta/desktop/wayland/screenshot.nix @@ -0,0 +1,6 @@ +{ pkgs, ... }: { + home.packages = with pkgs; [ + grim + slurp + ]; +} diff --git a/home/ebisu/meta/desktop/wayland/waybar/default.nix b/home/ebisu/meta/desktop/wayland/waybar/default.nix new file mode 100644 index 0000000..698ebb3 --- /dev/null +++ b/home/ebisu/meta/desktop/wayland/waybar/default.nix @@ -0,0 +1,96 @@ +{ pkgs, ... }: +{ + programs.waybar = { + enable = true; + style = ./waybar/style.css; + + settings = ( + let + defaultModules = (import ./waybar/default-modules.nix { inherit pkgs; }); + hyprland-workspaces-base = { + disable-scroll = true; + disable-markup = false; + all-outputs = false; + format = "{icon}"; + }; + in + [ + ( + defaultModules + // { + output = "HDMI-A-2"; + "hyprland/workspaces" = hyprland-workspaces-base // { + format-icons = { + "11" = "一"; + "12" = "二"; + "13" = "三"; + "14" = "四"; + "15" = "五"; + "16" = "六"; + "17" = "七"; + "18" = "八"; + "19" = "九"; + "20" = "十"; + }; + }; + } + ) + ( + defaultModules + // { + output = "DP-2"; + "hyprland/workspaces" = hyprland-workspaces-base // { + format-icons = { + "1" = "一"; + "2" = "二"; + "3" = "三"; + "4" = "四"; + "5" = "五"; + "6" = "六"; + "7" = "七"; + "8" = "八"; + "9" = "九"; + "10" = "十"; + }; + }; + } + ) + ( + defaultModules + // { + output = "DP-1"; + "hyprland/workspaces" = hyprland-workspaces-base // { + format-icons = { + "21" = "一"; + "22" = "二"; + "23" = "三"; + "24" = "四"; + "25" = "五"; + "26" = "六"; + "27" = "七"; + "28" = "八"; + "29" = "九"; + "30" = "十"; + }; + }; + } + ) + ] + ); + }; + + xdg.configFile = ( + let + scripts = [ "mediaplayer.py" ]; + in + (builtins.listToAttrs ( + map (script: { + name = "waybar/scripts/${script}"; + + value = { + source = ./waybar/scripts/${script}; + }; + }) scripts + )) + ); +} diff --git a/home/ebisu/meta/desktop/wayland/waybar/waybar/default-modules.nix b/home/ebisu/meta/desktop/wayland/waybar/waybar/default-modules.nix new file mode 100644 index 0000000..07d741d --- /dev/null +++ b/home/ebisu/meta/desktop/wayland/waybar/waybar/default-modules.nix @@ -0,0 +1,231 @@ +{ pkgs, ... }: +let + python-shell = pkgs.mkShell { + packages = [ + (pkgs.python3.withPackages (python-pkgs: [ python-pkgs.pygobject3 ])) + pkgs.playerctl + pkgs.gobject-introspection + ]; + }; +in +{ + layer = "top"; + position = "top"; + margin-left = 8; + margin-right = 8; + height = 40; + + bluetooth = { + format = ""; + on-click = "${pkgs.blueberry}/bin/blueberry"; + }; + + clock = { + locale = "ja_JP.utf8"; + interval = 5; + tooltip-format = "<tt><small>{calendar}</small></tt>"; + # format = "{:%m月 %d日 %H:%M:%S}"; + format = "{:L%m月 %d日 %H:%M}"; + format-alt = "{:L%G年%b %d日 %A}"; + }; + + # For when clock doesn't work + "custom/clock" = { + exec = "date '+%m月 %d日 %H:%M'"; + tooltip = false; + interval = 5; + }; + + cpu = { + interval = 5; + format = " {usage}% ({load})"; + + states = { + warning = 70; + critical = 90; + }; + + on-click = "${pkgs.kitty}/bin/kitty -e '${pkgs.bottom}/bin/btm'"; + }; + + memory = { + interval = 5; + format = " {}%"; + format-alt = " {used:0.1f}/{total:0.1f}ギガ"; + + # I might remove these. I have 64GB of RAM .... + states = { + warning = 70; + critical = 90; + }; + }; + + network = { + interval = 1; + # format-wifi = " {bandwidthUpBytes} {bandwidthDownBytes}", + # format-ethernet = " {bandwidthUpBytes} {bandwidthDownBytes}", + format = " {bandwidthUpBytes} {bandwidthDownBytes}"; + format-disconnected = "⚠ Disconnected"; + tooltip-format = "{ifname}: {ipaddr}"; + on-click = "${pkgs.kitty}/bin/kitty -e 'nmtui'"; + }; + + "hyprland/mode" = { + format = "{}"; + tooltip = false; + }; + + "hyprland/window" = { + format = "{}"; + max-length = 120; + separate-outputs = true; + icon = false; + + rewrite = { + "(.*) - Thorium" = " $1"; + "(.*) - NVIM" = " $1"; + "ChatGPT" = " ChatGPT"; + "~(.*)" = " ~$1"; + "…(.*)" = " …$1"; + "zsh" = " ~"; + "fish" = " ~"; + "kitty" = " ~"; + "Volume Control" = " Volume Control"; + "Bluetooth" = " Bluetooth"; + "JamesDSP for Linux" = " JamesDSP"; + }; + }; + + pulseaudio = { + scroll-step = 1; + format = "{icon} {volume}%"; + # format-bluetooth = "{volume}% {icon} {format_source}"; + # format-bluetooth-muted = " {icon} {format_source}"; + format-muted = ""; + + format-icons = { + headphone = ""; + hands-free = "וֹ"; + headset = ""; + phone = ""; + portable = ""; + car = ""; + + default = [ "" ]; + }; + + on-click = "pactl set-sink-mute @DEFAULT_SINK@ toggle"; + on-click-right = "${pkgs.pavucontrol}/bin/pavucontrol"; + on-scroll-up = "pactl set-sink-volume @DEFAULT_SINK@ +2%"; + on-scroll-down = "pactl set-sink-volume @DEFAULT_SINK@ -2%"; + }; + + tray = { + spacing = 10; + show-passive-items = true; + }; + + "image#album-art" = { + path = "/tmp/mediaplayer_art"; + size = 22.5; # (18 + (18 / 4)) + interval = 5; + on-click = "${pkgs.playerctl}/bin/playerctl play-pause"; + }; + + "custom/media" = { + format = "{icon} {}"; + return-type = "json"; + max-length = 40; + + format-icons = { + spotify = " "; + default = " "; + }; + + escape = true; + exec = "${python-shell}/bin/python3 ~/.config/waybar/scripts/mediaplayer.py 2> /dev/null"; + on-click = "${pkgs.playerctl}/bin/playerctl play-pause"; + on-scroll-up = "${pkgs.playerctl}/bin/playerctl next"; + on-scroll-down = "${pkgs.playerctl}/bin/playerctl previous"; + }; + + cava = { + framerate = 280; + autosens = 1; + sensitivity = 3; + bars = 26; + lower_cutoff_freq = 50; + higher_cutoff_freq = 10000; + method = "pipewire"; + source = "auto"; + stereo = true; + reverse = true; + bar_delimiter = 0; + monstercat = false; + waves = false; + hide_on_silence = true; + noise_reduction = 0.77; + input_delay = 0; + on-click = "${pkgs.playerctl}/bin/playerctl play-pause"; + + # actions = { + # on-click-right = "mode"; + # }; + + # format-icons = ["░", "▒", "▓", "█", "█", "█", "█", "█"] + # format-icons = ["⎺", "⎻", "⎼", "⎽", "⎼", "⎻", "⎺", "⎹"] + # format-icons = ["▏", "▎", "▍", "▌", "▋", "▊", "▉", "█"] + format-icons = [ + "⠁" + "⠃" + "⠇" + "⠋" + "⠛" + "⠟" + "⠿" + "⣿" + ]; + # format-icons = ["◰", "◳", "◲", "◱", "▘", "▝", "▖", "▗"] + # format-icons = ["▖", "▗", "▘", "▝", "▚", "▞", "▛", "▟"] + # format-icons = ["▁", "▂", "▃", "▄", "▅", "▆", "▇", "█", "▉", "▊"] + # format-icons = ["⎯", "⎰", "⎱", "⎲", "⎳", "⎴", "⎵", "⎶"] + # format-icons = ["⎺", "⎻", "⎼", "⎽", "⎾", "⎿", "⏀", "⏁"] + # format-icons = ["♪", "♫", "♬", "♭", "♮", "♯", "♩", "♪"] + # format-icons = ["→", "⇉", "⇒", "⇉", "→", "⇉", "⇒", "⇉"] + # format-icons = ["·", ":", "⁙", "⁘", "⁙", ":", "·", "•"] + # format-icons = ["○", "◔", "◑", "◕", "●", "◍", "◎", "◉"] + # format-icons = ["△", "▲", "▴", "▸", "▶", "▹", "►", "▻"] + # format-icons = ["◇", "◈", "◉", "◍", "◎", "◯", "⦿", "◑"] + # format-icons = ["-", "–", "—", "––", "–––", "——", "———", "——––"] + # format-icons = ["-", "=", "≡", "≣", "≠", "≢", "≜", "≝"] + # format-icons = ["✓", "✔", "✕", "✖", "✗", "✘", "✙", "✚"] + # format-icons = ["✩", "✪", "✫", "✬", "✭", "✮", "✯", "✰"] + }; + + "custom/gpu" = { + exec = "nvidia-smi --query-gpu=utilization.gpu --format=csv,noheader | sed 's/ %/%/'"; + interval = 5; + format = " {}"; + on-click = "${pkgs.kitty}/bin/kitty -e '${pkgs.nvtopPackages.nvidia}/bin/nvtop'"; + }; + + modules-left = [ + "hyprland/workspaces" + "hyprland/window" + "custom/media" + "image#album-art" + ]; + + modules-center = [ "clock" ]; + + modules-right = [ + # "cava" + # "network" + "tray" + "cpu" + "custom/gpu" + "memory" + "bluetooth" + "pulseaudio" + ]; +} diff --git a/home/ebisu/meta/desktop/wayland/waybar/waybar/scripts/mediaplayer.py b/home/ebisu/meta/desktop/wayland/waybar/waybar/scripts/mediaplayer.py new file mode 100755 index 0000000..c44ee0b --- /dev/null +++ b/home/ebisu/meta/desktop/wayland/waybar/waybar/scripts/mediaplayer.py @@ -0,0 +1,152 @@ +#!/usr/bin/env python3 + +import argparse +import logging +import os +import sys +import signal +import gi +import json + +gi.require_version("Playerctl", "2.0") + +from gi.repository import Playerctl, GLib + +logger = logging.getLogger(__name__) + + +def write_output(text, player): + logger.info("Writing output") + + output = { + "text": text, + "class": "custom-" + player.props.player_name, + "alt": player.props.player_name, + "art": player.props.metadata["mpris:artUrl"], + } + + sys.stdout.write(json.dumps(output) + "\n") + sys.stdout.flush() + + +def on_play(player, status, manager): + logger.info("Received new playback status") + on_metadata(player, player.props.metadata, manager) + + +def on_metadata(player, metadata, manager): + logger.info("Received new metadata") + + track_info = "" + + if ( + player.props.player_name == "spotify" + and "mpris:trackid" in metadata.keys() + and ":ad:" in player.props.metadata["mpris:trackid"] + ): + track_info = "AD PLAYING" + elif player.get_artist() != "" and player.get_title() != "": + track_info = "{title} - {artist}".format( + artist=player.get_artist(), title=player.get_title() + ) + else: + track_info = player.get_title() + + if "file://" in player.props.metadata["mpris:artUrl"]: + os.system( + f"cp $(echo '{player.props.metadata['mpris:artUrl']}' | sed -E 's/file:\\/\\///g') /tmp/mediaplayer_art" + ) + else: + os.system( + f"curl --silent $(echo '{player.props.metadata['mpris:artUrl']}' | sed -E 's/file:\\/\\///g') --output /tmp/mediaplayer_art" + ) + + # if player.props.status != 'Playing' and track_info: + # track_info = ' ' + track_info + + write_output(track_info, player) + + +def on_player_appeared(manager, player, selected_player=None): + if player is not None and ( + selected_player is None or player.name == selected_player + ): + init_player(manager, player) + else: + logger.debug("New player appeared, but it's not the selected player, skipping") + + +def on_player_vanished(manager, player): + logger.info("Player has vanished") + sys.stdout.write("\n") + sys.stdout.flush() + os.system("rm /tmp/mediaplayer_art") + + +def init_player(manager, name): + logger.debug("Initialize player: {player}".format(player=name.name)) + + player = Playerctl.Player.new_from_name(name) + + player.connect("playback-status", on_play, manager) + player.connect("metadata", on_metadata, manager) + manager.manage_player(player) + on_metadata(player, player.props.metadata, manager) + + +def signal_handler(sig, frame): + logger.debug("Received signal to stop, exiting") + sys.stdout.write("\n") + sys.stdout.flush() + # loop.quit() + sys.exit(0) + + +def parse_arguments(): + parser = argparse.ArgumentParser() + + parser.add_argument("-v", "--verbose", action="count", default=0) + parser.add_argument("--player") + + return parser.parse_args() + + +def main(): + arguments = parse_arguments() + logging.basicConfig( + stream=sys.stderr, + level=logging.DEBUG, + format="%(name)s %(levelname)s %(message)s", + ) + + logger.setLevel(max((3 - arguments.verbose) * 10, 0)) + logger.debug("Arguments received {}".format(vars(arguments))) + + manager = Playerctl.PlayerManager() + loop = GLib.MainLoop() + + manager.connect( + "name-appeared", lambda *args: on_player_appeared(*args, arguments.player) + ) + manager.connect("player-vanished", on_player_vanished) + signal.signal(signal.SIGINT, signal_handler) + signal.signal(signal.SIGTERM, signal_handler) + signal.signal(signal.SIGPIPE, signal.SIG_DFL) + + for player in manager.props.player_names: + if arguments.player is not None and arguments.player != player.name: + logger.debug( + "{player} is not the filtered player, skipping it".format( + player=player.name + ) + ) + + continue + + init_player(manager, player) + + loop.run() + + +if __name__ == "__main__": + main() diff --git a/home/ebisu/meta/desktop/wayland/waybar/waybar/scripts/mediaplayer.py.bak b/home/ebisu/meta/desktop/wayland/waybar/waybar/scripts/mediaplayer.py.bak new file mode 100755 index 0000000..1630d97 --- /dev/null +++ b/home/ebisu/meta/desktop/wayland/waybar/waybar/scripts/mediaplayer.py.bak @@ -0,0 +1,128 @@ +#!/usr/bin/env python3 +import argparse +import logging +import sys +import signal +import gi +import json +gi.require_version('Playerctl', '2.0') +from gi.repository import Playerctl, GLib + +logger = logging.getLogger(__name__) + + +def write_output(text, player): + logger.info('Writing output') + + output = {'text': text, + 'class': 'custom-' + player.props.player_name, + 'alt': player.props.player_name} + + sys.stdout.write(json.dumps(output) + '\n') + sys.stdout.flush() + + +def on_play(player, status, manager): + logger.info('Received new playback status') + on_metadata(player, player.props.metadata, manager) + + +def on_metadata(player, metadata, manager): + logger.info('Received new metadata') + track_info = '' + + if player.props.player_name == 'spotify' and \ + 'mpris:trackid' in metadata.keys() and \ + ':ad:' in player.props.metadata['mpris:trackid']: + track_info = 'AD PLAYING' + elif player.get_artist() != '' and player.get_title() != '': + track_info = '{artist} - {title}'.format(artist=player.get_artist(), + title=player.get_title()) + else: + track_info = player.get_title() + + if player.props.status != 'Playing' and track_info: + track_info = ' ' + track_info + write_output(track_info, player) + + +def on_player_appeared(manager, player, selected_player=None): + if player is not None and (selected_player is None or player.name == selected_player): + init_player(manager, player) + else: + logger.debug("New player appeared, but it's not the selected player, skipping") + + +def on_player_vanished(manager, player): + logger.info('Player has vanished') + sys.stdout.write('\n') + sys.stdout.flush() + + +def init_player(manager, name): + logger.debug('Initialize player: {player}'.format(player=name.name)) + player = Playerctl.Player.new_from_name(name) + player.connect('playback-status', on_play, manager) + player.connect('metadata', on_metadata, manager) + manager.manage_player(player) + on_metadata(player, player.props.metadata, manager) + + +def signal_handler(sig, frame): + logger.debug('Received signal to stop, exiting') + sys.stdout.write('\n') + sys.stdout.flush() + # loop.quit() + sys.exit(0) + + +def parse_arguments(): + parser = argparse.ArgumentParser() + + # Increase verbosity with every occurrence of -v + parser.add_argument('-v', '--verbose', action='count', default=0) + + # Define for which player we're listening + parser.add_argument('--player') + + return parser.parse_args() + + +def main(): + arguments = parse_arguments() + + # Initialize logging + logging.basicConfig(stream=sys.stderr, level=logging.DEBUG, + format='%(name)s %(levelname)s %(message)s') + + # Logging is set by default to WARN and higher. + # With every occurrence of -v it's lowered by one + logger.setLevel(max((3 - arguments.verbose) * 10, 0)) + + # Log the sent command line arguments + logger.debug('Arguments received {}'.format(vars(arguments))) + + manager = Playerctl.PlayerManager() + loop = GLib.MainLoop() + + manager.connect('name-appeared', lambda *args: on_player_appeared(*args, arguments.player)) + manager.connect('player-vanished', on_player_vanished) + + signal.signal(signal.SIGINT, signal_handler) + signal.signal(signal.SIGTERM, signal_handler) + signal.signal(signal.SIGPIPE, signal.SIG_DFL) + + for player in manager.props.player_names: + if arguments.player is not None and arguments.player != player.name: + logger.debug('{player} is not the filtered player, skipping it' + .format(player=player.name) + ) + continue + + init_player(manager, player) + + loop.run() + + +if __name__ == '__main__': + main() diff --git a/home/ebisu/meta/desktop/wayland/waybar/waybar/style.css b/home/ebisu/meta/desktop/wayland/waybar/waybar/style.css new file mode 100644 index 0000000..121c792 --- /dev/null +++ b/home/ebisu/meta/desktop/wayland/waybar/waybar/style.css @@ -0,0 +1,134 @@ +@import "/home/ebisu/.cache/wal/colors-waybar.css"; + +* { + /* font-family: CartographCF Nerd Font, Iosevka Nerd Font, cursive; */ + /* font-family: Noto Sans Mono, Sarasa Mono J, cursive; */ + /* font-family: SF Mono, cursive; */ + /* font-family: MesloLGS NF; */ + font-family: SF Pro, Hiragino Sans, cursive; + font-size: 15px; +} + +window#waybar { + background-color: rgba(0, 0, 0, 0); + color: @foreground; + /* -gtk-icon-shadow: */ + /* -1px 0 #ffffff, */ + /* 0 1px #ffffff, */ + /* 1px 0 #ffffff, */ + /* 0 -1px #ffffff; */ +} + +#battery, +#cava, +#custom-know, +#clock, +#custom-clock, +#backlight, +#cpu, +#custom-keyboard-layout, +#memory, +#mode, +#custom-weather, +#network, +#pulseaudio, +#temperature, +#tray, +#idle_inhibitor, +#window, +#bluetooth, +#custom-power, +#workspaces, +#custom-media, +#custom-gpu, +#custom-PBPbattery { + /* padding: 0.25rem 0.75rem; */ + /* margin: 10px 5px 0px 0; */ + padding: 5px 15px; + margin: 10px 1rem 0px 0; + background-color: @background; + border-radius: 10px; /* 9 */ + color: @foreground; +} + +#image { + margin-top: 10px; + border-top-right-radius: 10px; + border-bottom-right-radius: 10px; + background-color: @background; + margin-right: 1rem; + padding-right: 1rem; +} + +#image > * { + border-radius: 10px; +} + +#image.empty { + background-color: transparent; + min-width: 0; + min-height: 0; + margin: 0; + padding: 0; +} + +window#waybar #custom-media { + border-top-right-radius: 0; + border-bottom-right-radius: 0; + padding-right: 1rem; + margin-right: 0; +} + +window#waybar.empty #window { + background-color: transparent; + padding: 0; + margin: 0; +} + +window#custom-media.empty #window { + background-color: transparent; +} + +#workspaces button.active { + color: @color11; +} + +#workspaces button:hover { + background-color: unset; +} + +#pulseaudio { + border-top-left-radius: 0; + border-bottom-left-radius: 0; + margin-left: 0; + padding-left: 0.5rem; +} + +#bluetooth { + border-top-right-radius: 0; + border-bottom-right-radius: 0; + margin-right: 0; + padding-right: 0.5rem; +} + +#memory { + border-top-left-radius: 0; + border-bottom-left-radius: 0; + margin-left: 0; + padding-left: 0.5rem; +} + +#custom-gpu { + border-radius: 0; + margin-right: 0; + margin-left: 0; + padding-right: 0.5rem; + padding-left: 0.5rem; +} + +#cpu { + border-top-right-radius: 0; + border-bottom-right-radius: 0; + margin-right: 0; + padding-right: 0.5rem; +} diff --git a/home/ebisu/meta/desktop/wayland/waybar/waybar/style.css.bak b/home/ebisu/meta/desktop/wayland/waybar/waybar/style.css.bak new file mode 100644 index 0000000..3858c71 --- /dev/null +++ b/home/ebisu/meta/desktop/wayland/waybar/waybar/style.css.bak @@ -0,0 +1,221 @@ +@import "colors-waybar.css"; + +* { + font-family: CartographCF Nerd Font, Iosevka Nerd Font, cursive; + font-size: 14px; +} + +window#waybar { + background-color: rgba(0, 0, 0, 0); + color: @foreground; + transition-property: background-color; + transition-duration: 0.5s; +} + +window#waybar.hidden { + opacity: 0.1; +} + +#window { + color: @foreground; +} + +#clock, +#cpu, +#memory, +#custom-media, +#tray, +#mode, +#workspaces, +#battery, +#idle_inhibitor, +#window, +#custom-power-menu, +#custom-wallpaper, +#custom-launcher, +#custom-spotify, +#custom-weather, +#custom-theme, +#custom-weather.severe, +#custom-weather.sunnyDay, +#custom-weather.clearNight, +#custom-weather.cloudyFoggyDay, +#custom-weather.cloudyFoggyNight, +#custom-weather.rainyDay, +#custom-weather.rainyNight, +#custom-weather.showyIcyDay, +#custom-weather.snowyIcyNight, +#custom-weather.default { + color: @foreground; + padding: 2px 10px; + background-color: @background; + border-radius: 8px; + margin: 6px 3px 0; +} + +#window { + color: @color8; +} + +#custom-launcher { + color: @color9; + padding: 0 20px 0 20px; + margin-left: 8px; +} + +#cpu { + /* color: @color10; */ + color: @foreground; +} + +#memory { + /* color: @color11; */ + color: @foreground; +} + +#workspaces {} + +#workspaces button { + color: @color10; + box-shadow: inset 0 -3px transparent; + margin-right: 0em; + transition: all 0.5s cubic-bezier(0.55, -0.68, 0.48, 1.68); +} + +#workspaces button.active { + color: @foreground; + margin-right: 0em; + transition: all 0.5s cubic-bezier(0.55, -0.68, 0.48, 1.68); +} + +/* If workspaces is the leftmost module, omit left margin */ +.modules-left>widget:first-child>#workspaces { + margin-left: 0; +} + +/* If workspaces is the rightmost module, omit right margin */ +.modules-right>widget:last-child>#workspaces { + margin-right: 0; +} + +#tray {} + +#tray>.passive { + -gtk-icon-effect: dim; +} + +#tray>.needs-attention { + -gtk-icon-effect: highlight; + background-color: #eb4d4b; +} + +#custom-spotify { + /* color: @color10; */ + color: @color8; +} + +#custom-wallpaper { + padding: 0 18px 0 12px; + color: @color14; +} + +#custom-theme { + padding: 0 18px 0 12px; + color: @color13; +} + +#bluetooth, +#backlight, +#pulseaudio, +#network { + color: @color5; + background-color: @background; + padding: 0 12px; + margin: 6px 0 0; +} + +#bluetooth { + border-radius: 8px 0px 0px 8px; + /* color: @color11; */ + margin-left: 3px; + border-right: none; +} + +#network { + color: @color13; + padding-right: 14px; + border-right: none; + border-left: none; +} + +#network.disconnected { + color: @color11; +} + +#pulseaudio { + /* color: @color10; */ + border-left: none; + /* border-right: none; */ + border-radius: 0 8px 8px 0; + padding-right: 12px; +} + +#pulseaudio.muted { + color: @color11; +} + +#backlight { + margin-right: 3px; + padding-right: 8px; + color: @color13; + border-radius: 0 8px 8px 0; + border-left: none; +} + +#battery { + color: @color9; + border-radius: 8px; + padding: 0 12px; +} + +#battery.critical, +#battery.warning, +#battery.full, +#battery.plugged { + color: @color15; +} + +#clock { + color: @foreground; + margin-left: 6px; +} + +#custom-power-menu { + color: @color10; + margin-right: 8px; + padding: 0 12px 0 10px; +} + +@keyframes blink { + to { + background-color: rgba(30, 34, 42, 0.5); + color: #abb2bf; + } +} + +tooltip { + border-radius: 15px; + padding: 15px; + background-color: @background; + color: @foreground; + font-family: CartographCF Nerd Font; +} + +tooltip label { + padding: 5px; + color: @foreground; +} + +label:focus { + background-color: @background; +} diff --git a/home/ebisu/meta/desktop/wayland/wlogout.nix b/home/ebisu/meta/desktop/wayland/wlogout.nix new file mode 100644 index 0000000..5e20380 --- /dev/null +++ b/home/ebisu/meta/desktop/wayland/wlogout.nix @@ -0,0 +1,114 @@ +{ pkgs, config, ... }: +{ + home.packages = with pkgs; [ wlogout ]; + + xdg.configFile = { + "wlogout/layout".text = '' + { + "label" : "lock", + "action" : "hyprlock", + "text" : "鍵をかける", + "keybind" : "l" + } + { + "label" : "hibernate", + "action" : "hyprctl dispatch dpms off", + "text" : "ハイブネート", + "keybind" : "h" + } + { + "label" : "logout", + "action" : "hyprctl dispatch exit", + "text" : "WMを出る", + "keybind" : "e" + } + { + "label" : "shutdown", + "action" : "doas systemctl poweroff -i", + "text" : "シャットダウン", + "keybind" : "s" + } + { + "label" : "suspend", + "action" : "doas systemctl suspend -i && hyprlock", + "text" : "寝", + "keybind" : "u" + } + { + "label" : "reboot", + "action" : "doas systemctl reboot -i", + "text" : "再起動", + "keybind" : "r" + } + ''; + + "wlogout/style.css".text = '' + @import "/home/${config.home.username}/.cache/wal/colors-waybar.css"; + + * { + background-image: none; + box-shadow: none; + } + + window { + background-color: rgba(0, 0, 0, 0.5); + } + + button { + opacity: 0.95; + border-radius: 10px; + border-color: black; + text-decoration-color: @foreground; + color: @foreground; + background-color: @background; + border-style: none; + background-repeat: no-repeat; + background-position: center; + background-size: 25%; + margin: 5px; + } + + button:focus, + button:active, + button:hover { + background-color: @color11; + } + + #lock { + background-image: image( + url("/home/${config.home.username}/.nix-profile/share/wlogout/icons/lock.png") + ); + } + + #logout { + background-image: image( + url("/home/${config.home.username}/.nix-profile/share/wlogout/icons/logout.png") + ); + } + + #suspend { + background-image: image( + url("/home/${config.home.username}/.nix-profile/share/wlogout/icons/suspend.png") + ); + } + + #hibernate { + background-image: image( + url("/home/${config.home.username}/.nix-profile/share/wlogout/icons/hibernate.png") + ); + } + + #shutdown { + background-image: image( + url("/home/${config.home.username}/.nix-profile/share/wlogout/icons/shutdown.png") + ); + } + + #reboot { + background-image: image( + url("/home/${config.home.username}/.nix-profile/share/wlogout/icons/reboot.png") + ); + } + ''; + }; +} diff --git a/home/ebisu/meta/desktop/xorg/default.nix b/home/ebisu/meta/desktop/xorg/default.nix new file mode 100644 index 0000000..801a736 --- /dev/null +++ b/home/ebisu/meta/desktop/xorg/default.nix @@ -0,0 +1,17 @@ +{ pkgs, ... }: { + home.packages = with pkgs; [ + gifsicle + main + unclutter + xcape + xcolor + xclip + xsel + # xrootgif + xwallpaper + xbanish + xdotool + clipnotify + sxhkd + ]; +} diff --git a/home/ebisu/meta/development/database/default.nix b/home/ebisu/meta/development/database/default.nix new file mode 100644 index 0000000..95f57eb --- /dev/null +++ b/home/ebisu/meta/development/database/default.nix @@ -0,0 +1,6 @@ +{ pkgs, ... }: { + home.packages = with pkgs; [ + diesel-cli + redis + ]; +} diff --git a/home/ebisu/meta/development/default.nix b/home/ebisu/meta/development/default.nix new file mode 100644 index 0000000..7f2a70f --- /dev/null +++ b/home/ebisu/meta/development/default.nix @@ -0,0 +1,10 @@ +_: { + imports = [ + ./database + ./git + ./infrastructure + ./languages + ./nix + ./tools + ]; +} diff --git a/home/ebisu/meta/development/git/default.nix b/home/ebisu/meta/development/git/default.nix new file mode 100644 index 0000000..260b0f6 --- /dev/null +++ b/home/ebisu/meta/development/git/default.nix @@ -0,0 +1,8 @@ +{ pkgs, ... }: { + home.packages = with pkgs; [ + delta + gh + onefetch + gitoxide + ]; +} diff --git a/home/ebisu/meta/development/infrastructure/default.nix b/home/ebisu/meta/development/infrastructure/default.nix new file mode 100644 index 0000000..7f43f0b --- /dev/null +++ b/home/ebisu/meta/development/infrastructure/default.nix @@ -0,0 +1,7 @@ +{ pkgs, ... }: { + home.packages = with pkgs; [ + flyctl + nodePackages_latest.wrangler + nodePackages_latest.vercel + ]; +} diff --git a/home/ebisu/meta/development/languages/agnostic/default.nix b/home/ebisu/meta/development/languages/agnostic/default.nix new file mode 100644 index 0000000..e726fae --- /dev/null +++ b/home/ebisu/meta/development/languages/agnostic/default.nix @@ -0,0 +1,6 @@ +{ pkgs, ... }: { + home.packages = with pkgs; [ + clang + mold + ]; +} diff --git a/home/ebisu/meta/development/languages/assembly/default.nix b/home/ebisu/meta/development/languages/assembly/default.nix new file mode 100644 index 0000000..b593a41 --- /dev/null +++ b/home/ebisu/meta/development/languages/assembly/default.nix @@ -0,0 +1,7 @@ +{ pkgs, ... }: { + home.packages = with pkgs; [ + nasm + # nasmfmt + yasm + ]; +} diff --git a/home/ebisu/meta/development/languages/cobol/default.nix b/home/ebisu/meta/development/languages/cobol/default.nix new file mode 100644 index 0000000..82e5464 --- /dev/null +++ b/home/ebisu/meta/development/languages/cobol/default.nix @@ -0,0 +1,5 @@ +{ pkgs, ... }: { + home.packages = with pkgs; [ + gnu-cobol + ]; +} diff --git a/home/ebisu/meta/development/languages/crystal/default.nix b/home/ebisu/meta/development/languages/crystal/default.nix new file mode 100644 index 0000000..51a0846 --- /dev/null +++ b/home/ebisu/meta/development/languages/crystal/default.nix @@ -0,0 +1,6 @@ +{ pkgs, ... }: { + home.packages = with pkgs; [ + crystal + shards + ]; +} diff --git a/home/ebisu/meta/development/languages/csharp/default.nix b/home/ebisu/meta/development/languages/csharp/default.nix new file mode 100644 index 0000000..b8f8285 --- /dev/null +++ b/home/ebisu/meta/development/languages/csharp/default.nix @@ -0,0 +1,5 @@ +{ pkgs, ... }: { + home.packages = with pkgs; [ + dotnetCorePackages.dotnet_9.sdk + ]; +} diff --git a/home/ebisu/meta/development/languages/default.nix b/home/ebisu/meta/development/languages/default.nix new file mode 100644 index 0000000..05cfd95 --- /dev/null +++ b/home/ebisu/meta/development/languages/default.nix @@ -0,0 +1,25 @@ +_: { + imports = [ + ./agnostic + # ./assembly + ./cobol + ./crystal + # ./csharp + ./gleam + ./go + # ./hare + ./haskell + ./javascript + ./jvm + ./nim + ./other + ./protobuf + ./python + ./rust + # ./shell + ./tex + # ./vlang + ./yaml + ./zig + ]; +} diff --git a/home/ebisu/meta/development/languages/gleam/default.nix b/home/ebisu/meta/development/languages/gleam/default.nix new file mode 100644 index 0000000..de1ab92 --- /dev/null +++ b/home/ebisu/meta/development/languages/gleam/default.nix @@ -0,0 +1,7 @@ +{ pkgs, ... }: { + home.packages = with pkgs; [ + gleam + rebar3 + erlang_nox + ]; +} diff --git a/home/ebisu/meta/development/languages/go/default.nix b/home/ebisu/meta/development/languages/go/default.nix new file mode 100644 index 0000000..a248efd --- /dev/null +++ b/home/ebisu/meta/development/languages/go/default.nix @@ -0,0 +1,7 @@ +{ pkgs, ... }: { + programs.go.enable = true; + + home.packages = with pkgs; [ + gopls + ]; +} diff --git a/home/ebisu/meta/development/languages/hare/default.nix b/home/ebisu/meta/development/languages/hare/default.nix new file mode 100644 index 0000000..79fc13b --- /dev/null +++ b/home/ebisu/meta/development/languages/hare/default.nix @@ -0,0 +1,5 @@ +{ pkgs, ... }: { + home.packages = with pkgs; [ + hare + ]; +} diff --git a/home/ebisu/meta/development/languages/haskell/default.nix b/home/ebisu/meta/development/languages/haskell/default.nix new file mode 100644 index 0000000..f9a17ce --- /dev/null +++ b/home/ebisu/meta/development/languages/haskell/default.nix @@ -0,0 +1,8 @@ +{ pkgs, ... }: { + home.packages = with pkgs; [ + ghc + haskellPackages.cabal-fmt + # haskellPackages.pier + stack + ]; +} diff --git a/home/ebisu/meta/development/languages/javascript/default.nix b/home/ebisu/meta/development/languages/javascript/default.nix new file mode 100644 index 0000000..26b320d --- /dev/null +++ b/home/ebisu/meta/development/languages/javascript/default.nix @@ -0,0 +1,9 @@ +{ pkgs, ... }: { + home.packages = with pkgs; [ + bun + # deno + nodePackages_latest.nodejs + # typescript + yarn-berry + ]; +} diff --git a/home/ebisu/meta/development/languages/jvm/default.nix b/home/ebisu/meta/development/languages/jvm/default.nix new file mode 100644 index 0000000..86f9708 --- /dev/null +++ b/home/ebisu/meta/development/languages/jvm/default.nix @@ -0,0 +1,6 @@ +{ pkgs, ... }: { + home.packages = with pkgs; [ + # kotlin + cfr + ]; +} diff --git a/home/ebisu/meta/development/languages/nim/default.nix b/home/ebisu/meta/development/languages/nim/default.nix new file mode 100644 index 0000000..4dcb2cf --- /dev/null +++ b/home/ebisu/meta/development/languages/nim/default.nix @@ -0,0 +1,7 @@ +{ pkgs, ... }: { + home.packages = with pkgs; [ + nim + nimble + nimlangserver + ]; +} diff --git a/home/ebisu/meta/development/languages/other/default.nix b/home/ebisu/meta/development/languages/other/default.nix new file mode 100644 index 0000000..a0c7eb0 --- /dev/null +++ b/home/ebisu/meta/development/languages/other/default.nix @@ -0,0 +1,7 @@ +{ pkgs +, ... +}: { + home.packages = with pkgs; [ + uxn + ]; +} diff --git a/home/ebisu/meta/development/languages/protobuf/default.nix b/home/ebisu/meta/development/languages/protobuf/default.nix new file mode 100644 index 0000000..21dd9f7 --- /dev/null +++ b/home/ebisu/meta/development/languages/protobuf/default.nix @@ -0,0 +1,5 @@ +{ pkgs, ... }: { + home.packages = with pkgs; [ + protobuf + ]; +} diff --git a/home/ebisu/meta/development/languages/python/default.nix b/home/ebisu/meta/development/languages/python/default.nix new file mode 100644 index 0000000..34112a2 --- /dev/null +++ b/home/ebisu/meta/development/languages/python/default.nix @@ -0,0 +1,10 @@ +{ pkgs, ... }: { + home.packages = with pkgs; [ + python312 + rye + mypy + black + ]; + + programs.poetry.enable = true; +} diff --git a/home/ebisu/meta/development/languages/rust/default.nix b/home/ebisu/meta/development/languages/rust/default.nix new file mode 100644 index 0000000..02360d1 --- /dev/null +++ b/home/ebisu/meta/development/languages/rust/default.nix @@ -0,0 +1,10 @@ +{ pkgs, ... }: { + home.packages = with pkgs; [ + cargo-outdated + cargo-watch + cargo-make + cargo-cache + # cargo-clean-all + rustup + ]; +} diff --git a/home/ebisu/meta/development/languages/shell/default.nix b/home/ebisu/meta/development/languages/shell/default.nix new file mode 100644 index 0000000..6476dca --- /dev/null +++ b/home/ebisu/meta/development/languages/shell/default.nix @@ -0,0 +1,5 @@ +{ pkgs, ... }: { + home.packages = with pkgs; [ + amber-lang + ]; +} diff --git a/home/ebisu/meta/development/languages/tex/default.nix b/home/ebisu/meta/development/languages/tex/default.nix new file mode 100644 index 0000000..0b88179 --- /dev/null +++ b/home/ebisu/meta/development/languages/tex/default.nix @@ -0,0 +1,5 @@ +{ pkgs, ... }: { + home.packages = with pkgs; [ + tectonic + ]; +} diff --git a/home/ebisu/meta/development/languages/vlang/default.nix b/home/ebisu/meta/development/languages/vlang/default.nix new file mode 100644 index 0000000..d9da941 --- /dev/null +++ b/home/ebisu/meta/development/languages/vlang/default.nix @@ -0,0 +1,5 @@ +{ pkgs, ... }: { + home.packages = with pkgs; [ + vlang + ]; +} diff --git a/home/ebisu/meta/development/languages/yaml/default.nix b/home/ebisu/meta/development/languages/yaml/default.nix new file mode 100644 index 0000000..cd91d5e --- /dev/null +++ b/home/ebisu/meta/development/languages/yaml/default.nix @@ -0,0 +1,5 @@ +{ pkgs, ... }: { + home.packages = with pkgs; [ + yamllint + ]; +} diff --git a/home/ebisu/meta/development/languages/zig/default.nix b/home/ebisu/meta/development/languages/zig/default.nix new file mode 100644 index 0000000..98f1ad9 --- /dev/null +++ b/home/ebisu/meta/development/languages/zig/default.nix @@ -0,0 +1,9 @@ +{ pkgs, ... }: { + imports = [ + ./zls + ]; + + home.packages = with pkgs; [ + zig + ]; +} diff --git a/home/ebisu/meta/development/languages/zig/zls/default.nix b/home/ebisu/meta/development/languages/zig/zls/default.nix new file mode 100644 index 0000000..7aba4eb --- /dev/null +++ b/home/ebisu/meta/development/languages/zig/zls/default.nix @@ -0,0 +1,12 @@ +{ pkgs, ... }: { + home.packages = with pkgs; [ + zls + ]; + + xdg.configFile."zls.json".text = '' + { + "enable_build_on_save": true, + "build_on_save_step": "check" + } + ''; +} diff --git a/home/ebisu/meta/development/nix/default.nix b/home/ebisu/meta/development/nix/default.nix new file mode 100644 index 0000000..6fa9049 --- /dev/null +++ b/home/ebisu/meta/development/nix/default.nix @@ -0,0 +1,12 @@ +{ pkgs, ... }: { + home.packages = with pkgs; [ + nil + statix + alejandra + nurl + nix-init + nix-prefetch-git + nixpkgs-fmt + nixfmt-rfc-style + ]; +} diff --git a/home/ebisu/meta/development/tools/build/default.nix b/home/ebisu/meta/development/tools/build/default.nix new file mode 100644 index 0000000..6dff41a --- /dev/null +++ b/home/ebisu/meta/development/tools/build/default.nix @@ -0,0 +1,10 @@ +{ pkgs, ... }: { + home.packages = with pkgs; [ + cmake + just + tup + meson + ninja + sccache + ]; +} diff --git a/home/ebisu/meta/development/tools/default.nix b/home/ebisu/meta/development/tools/default.nix new file mode 100644 index 0000000..982b281 --- /dev/null +++ b/home/ebisu/meta/development/tools/default.nix @@ -0,0 +1,20 @@ +{ pkgs +, ... +}: { + imports = [ + ./build + ]; + + home.packages = with pkgs; [ + clang-tools + gtkwave + highlight + hyperfine + sloc + shfmt + wakatime-cli + linuxKernel.packages.linux_lqx.perf + radare2 + global + ]; +} diff --git a/home/ebisu/meta/editor/default.nix b/home/ebisu/meta/editor/default.nix new file mode 100644 index 0000000..183fb72 --- /dev/null +++ b/home/ebisu/meta/editor/default.nix @@ -0,0 +1,12 @@ +{ pkgs, config, ... }: +{ + imports = [ ./vscode-fhs.nix ]; + + home.packages = with pkgs; [ + emacs + neovide + # jetbrains.clion + lunarvim + zed-editor + ]; +} diff --git a/home/ebisu/meta/editor/vscode-fhs.nix b/home/ebisu/meta/editor/vscode-fhs.nix new file mode 100644 index 0000000..59f6b73 --- /dev/null +++ b/home/ebisu/meta/editor/vscode-fhs.nix @@ -0,0 +1,23 @@ +{ pkgs, ... }: +{ + home.packages = with pkgs; [ vscode-fhs ]; + + xdg.configFile."code-flags.conf".text = '' + --enable-features=UseOzonePlatform,WaylandWindowDecorations,WebRTCPipeWireCapturer,TouchpadOverscrollHistoryNavigation + --ozone-platform=wayland + --ignore-gpu-blocklist + --enable-gpu-rasterization + --enable-zero-copy + --disable-gpu-driver-bug-workarounds + --enable-features=VaapiVideoDecoder + --enable-native-gpu-memory-buffers + --disable-features=UseSkiaRenderer + --use-cmd-decoder=passthrough + --process-per-site + --force-dark-mode + --enable-features=WebUIDarkMode + --enable-unsafe-webgpu + --gtk-version=4 + --enable-wayland-ime + ''; +} diff --git a/home/ebisu/meta/education/calculator/default.nix b/home/ebisu/meta/education/calculator/default.nix new file mode 100644 index 0000000..a8bcc7f --- /dev/null +++ b/home/ebisu/meta/education/calculator/default.nix @@ -0,0 +1,7 @@ +{ pkgs, ... }: { + home.packages = with pkgs; [ + gavin-bc + qalculate-gtk + programmer-calculator + ]; +} diff --git a/home/ebisu/meta/education/default.nix b/home/ebisu/meta/education/default.nix new file mode 100644 index 0000000..ccddf02 --- /dev/null +++ b/home/ebisu/meta/education/default.nix @@ -0,0 +1,10 @@ +{ pkgs, ... }: { + imports = [ + ./calculator + ]; + + home.packages = with pkgs; [ + anki-bin + obsidian + ]; +} diff --git a/home/ebisu/meta/filesystem/archive/default.nix b/home/ebisu/meta/filesystem/archive/default.nix new file mode 100644 index 0000000..f52123b --- /dev/null +++ b/home/ebisu/meta/filesystem/archive/default.nix @@ -0,0 +1,8 @@ +{ pkgs, ... }: { + home.packages = with pkgs; [ + unrar + xar + pigz + unzip + ]; +} diff --git a/home/ebisu/meta/filesystem/core/bat/default.nix b/home/ebisu/meta/filesystem/core/bat/default.nix new file mode 100644 index 0000000..c1dad3f --- /dev/null +++ b/home/ebisu/meta/filesystem/core/bat/default.nix @@ -0,0 +1,6 @@ +{ pkgs, ... }: { + programs.bat = { + enable = true; + config.pager = "less -FR"; + }; +} diff --git a/home/ebisu/meta/filesystem/core/default.nix b/home/ebisu/meta/filesystem/core/default.nix new file mode 100644 index 0000000..6408adb --- /dev/null +++ b/home/ebisu/meta/filesystem/core/default.nix @@ -0,0 +1,13 @@ +{ pkgs, ... }: { + imports = [ + ./bat + ./eza + ]; + + home.packages = with pkgs; [ + dogdns + duf + fd + rm-improved + ]; +} diff --git a/home/ebisu/meta/filesystem/core/eza/default.nix b/home/ebisu/meta/filesystem/core/eza/default.nix new file mode 100644 index 0000000..a8d2f57 --- /dev/null +++ b/home/ebisu/meta/filesystem/core/eza/default.nix @@ -0,0 +1,7 @@ +_: { + programs.eza = { + enable = true; + icons = true; + enableFishIntegration = true; + }; +} diff --git a/home/ebisu/meta/filesystem/default.nix b/home/ebisu/meta/filesystem/default.nix new file mode 100644 index 0000000..c830b18 --- /dev/null +++ b/home/ebisu/meta/filesystem/default.nix @@ -0,0 +1,20 @@ +{ pkgs, ... }: +{ + imports = [ + ./archive + ./core + ]; + + programs.nnn.enable = true; + # programs.lf.enable = true; + + home.packages = with pkgs; [ + cinnamon.nemo + dust + dysk + gparted + # file-roller + ncdu + file + ]; +} diff --git a/home/ebisu/meta/gaming/default.nix b/home/ebisu/meta/gaming/default.nix new file mode 100644 index 0000000..2d86ea0 --- /dev/null +++ b/home/ebisu/meta/gaming/default.nix @@ -0,0 +1,17 @@ +{ pkgs, ... }: { + programs.gamemode = { + enable = true; + enableRenice = true; + }; + + home.packages = with pkgs; [ + steam + lutris + gamescope + # xivlauncher + mangohud + ttyper + runelite + sidequest + ]; +} diff --git a/home/ebisu/meta/language/default.nix b/home/ebisu/meta/language/default.nix new file mode 100644 index 0000000..d1fa5b1 --- /dev/null +++ b/home/ebisu/meta/language/default.nix @@ -0,0 +1,7 @@ +{ pkgs, ... }: { + home.packages = with pkgs; [ + codespell + jiten + tagainijisho + ]; +} diff --git a/home/ebisu/meta/multimedia/audio/default.nix b/home/ebisu/meta/multimedia/audio/default.nix new file mode 100644 index 0000000..7944a63 --- /dev/null +++ b/home/ebisu/meta/multimedia/audio/default.nix @@ -0,0 +1,19 @@ +{ pkgs, ... }: { + imports = [ + ./spotify + ]; + + home.packages = with pkgs; [ + alsa-plugins + # blanket + blueberry + cava + cmus + easyeffects + pavucontrol + pulsemixer + jamesdsp + # lsp-plugins + playerctl + ]; +} diff --git a/home/ebisu/meta/multimedia/audio/spotify/default.nix b/home/ebisu/meta/multimedia/audio/spotify/default.nix new file mode 100644 index 0000000..5276e07 --- /dev/null +++ b/home/ebisu/meta/multimedia/audio/spotify/default.nix @@ -0,0 +1,11 @@ +{ pkgs, ... }: { + home.packages = with pkgs; [ + # spotify-edge + spotify + spotify-player + spicetify-cli + ncspot + psst + playerctl + ]; +} diff --git a/home/ebisu/meta/multimedia/browser/default.nix b/home/ebisu/meta/multimedia/browser/default.nix new file mode 100644 index 0000000..176bc9c --- /dev/null +++ b/home/ebisu/meta/multimedia/browser/default.nix @@ -0,0 +1,19 @@ +{ pkgs, inputs, ... }: +{ + imports = [ + ./thorium.nix + # ./ungoogled-chromium.nix + ]; + + home.packages = with pkgs; [ + # elinks + geckodriver + # lynx + # vieb + # ladybird + web-ext + firefox + tor-browser + (pkgs.callPackage ./zen-browser-bin.nix { }) + ]; +} diff --git a/home/ebisu/meta/multimedia/browser/thorium.nix b/home/ebisu/meta/multimedia/browser/thorium.nix new file mode 100644 index 0000000..e789275 --- /dev/null +++ b/home/ebisu/meta/multimedia/browser/thorium.nix @@ -0,0 +1,47 @@ +{ pkgs, lib, ... }: +let + thorium-archive = pkgs.fetchurl { + url = "https://github.com/Alex313031/thorium/releases/download/M126.0.6478.246/Thorium_Browser_126.0.6478.246_Th24_SSE4.AppImage"; + hash = "sha256-izYbx/mSA+l7fAh917SauHopk3UlUJo+7NjkyIGpnNA="; + }; + + version = "126.0.6478.246_Th24"; + + # https://discourse.nixos.org/t/creating-a-nix-derivation-for-an-appimage/31927 + thorium = pkgs.appimageTools.wrapType2 { + pname = "thorium"; + version = version; + src = "${thorium-archive}"; + + meta = with lib; { + description = "Chromium fork named after radioactive element No. 90. Windows and MacOS/Raspi/Android/Special builds are in different repositories, links are towards the top of the README.md."; + sourceProvenance = with sourceTypes; [ binaryNativeCode ]; + homepage = "https://thorium.rocks/"; + license = licenses.bsd3; + platforms = platforms.linux; + mainProgram = "thorium-browser"; + }; + }; +in +{ + home.packages = [ thorium ]; + + xdg.configFile."thorium-flags.conf".text = '' + --enable-features=UseOzonePlatform,WaylandWindowDecorations,WebRTCPipeWireCapturer,TouchpadOverscrollHistoryNavigation + --ozone-platform=wayland + --ignore-gpu-blocklist + --enable-gpu-rasterization + --enable-zero-copy + --disable-gpu-driver-bug-workarounds + --enable-features=VaapiVideoDecoder + --enable-native-gpu-memory-buffers + --disable-features=UseSkiaRenderer + --use-cmd-decoder=passthrough + --process-per-site + --force-dark-mode + --enable-features=WebUIDarkMode + --enable-unsafe-webgpu + --gtk-version=4 + --enable-wayland-ime + ''; +} diff --git a/home/ebisu/meta/multimedia/browser/ungoogled-chromium.nix b/home/ebisu/meta/multimedia/browser/ungoogled-chromium.nix new file mode 100644 index 0000000..d492697 --- /dev/null +++ b/home/ebisu/meta/multimedia/browser/ungoogled-chromium.nix @@ -0,0 +1,23 @@ +{ pkgs, ... }: +{ + home.packages = with pkgs; [ ungoogled-chromium ]; + + xdg.configFile."chromium-flags.conf".text = '' + --enable-features=UseOzonePlatform,WaylandWindowDecorations,WebRTCPipeWireCapturer,TouchpadOverscrollHistoryNavigation + --ozone-platform=wayland + --ignore-gpu-blocklist + --enable-gpu-rasterization + --enable-zero-copy + --disable-gpu-driver-bug-workarounds + --enable-features=VaapiVideoDecoder + --enable-native-gpu-memory-buffers + --disable-features=UseSkiaRenderer + --use-cmd-decoder=passthrough + --process-per-site + --force-dark-mode + --enable-features=WebUIDarkMode + --enable-unsafe-webgpu + --gtk-version=4 + --enable-wayland-ime + ''; +} diff --git a/home/ebisu/meta/multimedia/browser/zen-browser-bin.nix b/home/ebisu/meta/multimedia/browser/zen-browser-bin.nix new file mode 100644 index 0000000..51a95db --- /dev/null +++ b/home/ebisu/meta/multimedia/browser/zen-browser-bin.nix @@ -0,0 +1,128 @@ +{ + stdenv, + lib, + fetchzip, + makeDesktopItem, + autoPatchelfHook, + wrapGAppsHook3, + copyDesktopItems, + gtk3, + alsa-lib, + dbus-glib, + xorg, + pciutils, + libva, + pipewire, + libglvnd, +}: +let + desktopItem = makeDesktopItem { + name = "zen-browser"; + desktopName = "Zen Browser"; + genericName = "Web Browser"; + categories = [ + "Network" + "WebBrowser" + ]; + keywords = [ + "internet" + "www" + "browser" + "web" + "explorer" + ]; + exec = "zen %u"; + icon = "zen"; + mimeTypes = [ + "text/html" + "text/xml" + "application/xhtml+xml" + "application/vnd.mozilla.xul+xml" + "x-scheme-handler/http" + "x-scheme-handler/https" + ]; + startupNotify = true; + startupWMClass = "zen-alpha"; + terminal = false; + actions = { + new-window = { + name = "New Window"; + exec = "zen --new-window %u"; + }; + new-private-window = { + name = "New Private Window"; + exec = "zen --private-window %u"; + }; + profile-manager-window = { + name = "Profile Manager"; + exec = "zen --ProfileManager %u"; + }; + }; + }; +in +stdenv.mkDerivation rec { + pname = "zen-browser-bin"; + version = "1.0.0-a.32"; + + src = fetchzip { + url = "https://github.com/zen-browser/desktop/releases/download/${version}/zen.linux-specific.tar.bz2"; + hash = "sha256-5Z+RG5UwSHM6sC1WT5KHgwL0cco2DlMTSteEfnLGrlo="; + }; + + desktopItems = [ desktopItem ]; + + nativeBuildInputs = [ + autoPatchelfHook + wrapGAppsHook3 + copyDesktopItems + ]; + + buildInputs = [ + gtk3 + alsa-lib + dbus-glib + xorg.libXtst + ]; + + installPhase = '' + runHook preInstall + + mkdir -p $out/lib + cp -r $src $out/lib/zen/ + + mkdir -p $out/bin + ln -s $out/lib/zen/zen $out/bin/zen + + for n in {16,32,48,64,128}; do + size=$n"x"$n + mkdir -p $out/share/icons/hicolor/$size/apps + file="default"$n".png" + cp $out/lib/zen/browser/chrome/icons/default/$file $out/share/icons/hicolor/$size/apps/zen.png + done + + runHook postInstall + ''; + + preFixup = '' + gappsWrapperArgs+=( + --prefix LD_LIBRARY_PATH : "${ + lib.makeLibraryPath [ + pciutils + pipewire + libva + libglvnd + ] + }" + ) + gappsWrapperArgs+=(--set MOZ_LEGACY_PROFILES 1) + wrapGApp $out/lib/zen/zen + ''; + + meta = with lib; { + license = licenses.mpl20; + maintainers = with maintainers; [ mordrag ]; + description = "Experience tranquillity while browsing the web without people tracking you! "; + platforms = platforms.linux; + mainProgram = "zen"; + }; +} diff --git a/home/ebisu/meta/multimedia/default.nix b/home/ebisu/meta/multimedia/default.nix new file mode 100644 index 0000000..86da8c4 --- /dev/null +++ b/home/ebisu/meta/multimedia/default.nix @@ -0,0 +1,16 @@ +{ pkgs, ... }: { + imports = [ + ./audio + ./browser + ./document + ./image + ./video + ]; + + home.packages = with pkgs; [ + blender + epr + nicotine-plus + qbittorrent + ]; +} diff --git a/home/ebisu/meta/multimedia/document/default.nix b/home/ebisu/meta/multimedia/document/default.nix new file mode 100644 index 0000000..d6ddbc7 --- /dev/null +++ b/home/ebisu/meta/multimedia/document/default.nix @@ -0,0 +1,8 @@ +{ pkgs, ... }: { + home.packages = with pkgs; [ + libreoffice-fresh + manga-cli + zathura + thunderbird + ]; +} diff --git a/home/ebisu/meta/multimedia/image/ahoviewer.nix b/home/ebisu/meta/multimedia/image/ahoviewer.nix new file mode 100644 index 0000000..38524dc --- /dev/null +++ b/home/ebisu/meta/multimedia/image/ahoviewer.nix @@ -0,0 +1,54 @@ +{ + pkgs ? import <nixpkgs> { }, +}: +pkgs.stdenv.mkDerivation rec { + pname = "ahoviewer"; + version = "42e16f9"; + + src = pkgs.fetchFromGitHub { + owner = "ahodesuka"; + repo = pname; + rev = "42e16f94b78496e3e346f0d127baa569039a6757"; + sha256 = "sha256-HcijKiExwyBoWDvMlJ5AMA0U7BtS9EfcA54nfQ/iGvE="; + }; + + buildInputs = with pkgs; [ + meson + ninja + gtkmm3 + gtk3 + libconfig + libxml2 + curl + gst_all_1.gstreamer + gst_all_1.gst-plugins-base + libpeas + libsecret + libzip + ]; + + nativeBuildInputs = [ pkgs.pkg-config ]; + + configurePhase = '' + meson setup build --buildtype=release + ''; + + buildPhase = '' + cd build + ninja + cd .. + ''; + + installPhase = '' + mkdir -p $out/bin + cp build/src/ahoviewer $out/bin + ''; + + meta = with pkgs.lib; { + description = "A GTK image viewer, manga reader, and booru browser"; + homepage = "https://github.com/ahodesuka/ahoviewer"; + license = licenses.mit; + maintainers = with maintainers; [ ]; + platforms = platforms.linux; + }; +} diff --git a/home/ebisu/meta/multimedia/image/default.nix b/home/ebisu/meta/multimedia/image/default.nix new file mode 100644 index 0000000..5ff22b8 --- /dev/null +++ b/home/ebisu/meta/multimedia/image/default.nix @@ -0,0 +1,16 @@ +{ pkgs, ... }: +{ + home.packages = with pkgs; [ + (pkgs.callPackage ./ahoviewer.nix { }) + emulsion + feh + imv + gallery-dl + gthumb + nsxiv + pngcrush + viewnior + viu + optipng + ]; +} diff --git a/home/ebisu/meta/multimedia/video/anime/default.nix b/home/ebisu/meta/multimedia/video/anime/default.nix new file mode 100644 index 0000000..471bb7a --- /dev/null +++ b/home/ebisu/meta/multimedia/video/anime/default.nix @@ -0,0 +1,7 @@ +{ pkgs, ... }: +{ + home.packages = with pkgs; [ + ani-cli + # miru + ]; +} diff --git a/home/ebisu/meta/multimedia/video/default.nix b/home/ebisu/meta/multimedia/video/default.nix new file mode 100644 index 0000000..1d5a964 --- /dev/null +++ b/home/ebisu/meta/multimedia/video/default.nix @@ -0,0 +1,18 @@ +{ pkgs, ... }: { + imports = [ + ./anime + ]; + + home.packages = with pkgs; [ + mplayer + mpv + yt-dlp + ytfzf + clapper + streamlink-twitch-gui-bin + uxplay + ffmpeg + streamlink + streamlink-twitch-gui-bin + ]; +} diff --git a/home/ebisu/meta/network/default.nix b/home/ebisu/meta/network/default.nix new file mode 100644 index 0000000..a7ea06e --- /dev/null +++ b/home/ebisu/meta/network/default.nix @@ -0,0 +1,6 @@ +{ + imports = [ + ./smolnet + ./tools + ]; +} diff --git a/home/ebisu/meta/network/smolnet/bollux/default.nix b/home/ebisu/meta/network/smolnet/bollux/default.nix new file mode 100644 index 0000000..4d26eee --- /dev/null +++ b/home/ebisu/meta/network/smolnet/bollux/default.nix @@ -0,0 +1,65 @@ +{ pkgs, lib, ... }: +let + bollux = + pkgs.stdenvNoCC.mkDerivation rec { + pname = "bollux"; + version = "0.4.1"; + + nativeBuildInputs = [ + pkgs.makeWrapper + ]; + + buildInputs = [ + pkgs.bashInteractive + ]; + + dontBuild = true; + + makeFlags = [ + "PREFIX=$(out)" + ]; + + src = pkgs.fetchFromGitea { + domain = "tildegit.org"; + owner = "acdw"; + repo = "bollux"; + rev = "f472e60f1164f0dc025d06db2a13ff4e8ebee1a2"; + hash = "sha256-mo2qWCPfW+dUaYcJLsos/vR5nJ8n1eABy8Zy8OZsfVg="; + }; + + patches = [ + # https://tildegit.org/acdw/bollux/issues/13#issuecomment-9786 + ./fix_lesskey_nag.patch + ]; + + postInstall = '' + wrapProgram $out/bin/bollux --prefix PATH : ${lib.makeBinPath [ + pkgs.bashInteractive + pkgs.iconv + pkgs.openssl + pkgs.less + pkgs.coreutils + ]} + ''; + + meta = with lib; { + description = "a Gemini browser in like, idk, 96% pure Bash"; + homepage = "https://tildegit.org/acdw/bollux"; + license = licenses.mit; + platforms = platforms.all; + mainProgram = "bollux"; + }; + }; +in +{ + home.packages = [ + # I'll update this later and move the above derivation to its own package + # once I push my entire NixOS system configuration. + # (pkgs.callPackage /path/to/pkgs/bollux.nix { + # src = bollux; + # }) + bollux + ]; + + xdg.configFile."bollux/bollux.conf".text = ''''; +} diff --git a/home/ebisu/meta/network/smolnet/bollux/fix_lesskey_nag.patch b/home/ebisu/meta/network/smolnet/bollux/fix_lesskey_nag.patch new file mode 100644 index 0000000..329b886 --- /dev/null +++ b/home/ebisu/meta/network/smolnet/bollux/fix_lesskey_nag.patch @@ -0,0 +1,13 @@ +diff --git i/bollux w/bollux +index 267418e..090217e 100755 +--- i/bollux ++++ w/bollux +@@ -1130,7 +1130,7 @@ display() { # display METADATA [TITLE] + # text, and pre-formatted text shouldn't wrap. + less_cmd+=(-S) + # Load the keybindings (see `lesskey'). +- mklesskey && less_cmd+=(-k "$BOLLUX_LESSKEY") ++ mklesskey && less_cmd+=(--lesskey-src="$BOLLUX_LESSKEY") + local helpline="${KEY_OPEN}:open, " + helpline+="${KEY_GOTO}/" + helpline+="${KEY_GOTO_FROM}:goto, " diff --git a/home/ebisu/meta/network/smolnet/default.nix b/home/ebisu/meta/network/smolnet/default.nix new file mode 100644 index 0000000..93003c1 --- /dev/null +++ b/home/ebisu/meta/network/smolnet/default.nix @@ -0,0 +1,12 @@ +{ pkgs, config, ... }: +{ + imports = [ ./bollux ]; + + home.packages = with pkgs; [ + amfora + geopard + gmni + phetch + lagrange + ]; +} diff --git a/home/ebisu/meta/network/tools/default.nix b/home/ebisu/meta/network/tools/default.nix new file mode 100644 index 0000000..3b6d59f --- /dev/null +++ b/home/ebisu/meta/network/tools/default.nix @@ -0,0 +1,11 @@ +{ pkgs, ... }: { + imports = [ + ./http + ./shark + ./tcp + ]; + + home.packages = with pkgs; [ + lftp + ]; +} diff --git a/home/ebisu/meta/network/tools/http/default.nix b/home/ebisu/meta/network/tools/http/default.nix new file mode 100644 index 0000000..59d6efc --- /dev/null +++ b/home/ebisu/meta/network/tools/http/default.nix @@ -0,0 +1,8 @@ +{ pkgs, ... }: +{ + imports = [ + ./httpie + ./yaak + ./wget.nix + ]; +} diff --git a/home/ebisu/meta/network/tools/http/httpie/default.nix b/home/ebisu/meta/network/tools/http/httpie/default.nix new file mode 100644 index 0000000..b917245 --- /dev/null +++ b/home/ebisu/meta/network/tools/http/httpie/default.nix @@ -0,0 +1,6 @@ +{ pkgs, ... }: { + home.packages = with pkgs; [ + httpie + httpie-desktop + ]; +} diff --git a/home/ebisu/meta/network/tools/http/wget.nix b/home/ebisu/meta/network/tools/http/wget.nix new file mode 100644 index 0000000..c5d2936 --- /dev/null +++ b/home/ebisu/meta/network/tools/http/wget.nix @@ -0,0 +1,8 @@ +{ pkgs, ... }: +{ + home.packages = [ pkgs.wget ]; + + xdg.configFile."wget/wgetrc".text = '' + hsts-file=~/.cache/wget-hsts + ''; +} diff --git a/home/ebisu/meta/network/tools/http/yaak/default.nix b/home/ebisu/meta/network/tools/http/yaak/default.nix new file mode 100644 index 0000000..05bf0e7 --- /dev/null +++ b/home/ebisu/meta/network/tools/http/yaak/default.nix @@ -0,0 +1,28 @@ +{ pkgs, lib, ... }: +let + yaak-archive = pkgs.fetchzip { + url = "https://releases.yaak.app/releases/2024.6.6/yaak_2024.6.6_amd64.AppImage.tar.gz"; + hash = "sha256-Qnc4RlQmQWHARreQ69jAshq57bZ56Yt5a35jpTjGwNU="; + }; + + version = "2024.6.6"; + + # https://discourse.nixos.org/t/creating-a-nix-derivation-for-an-appimage/31927 + yaak = pkgs.appimageTools.wrapType2 { + pname = "yaak"; + version = version; + src = "${yaak-archive}/yaak_${version}_amd64.AppImage"; + + meta = with lib; { + description = "Play with APIs, intuitively"; + sourceProvenance = with sourceTypes; [ binaryNativeCode ]; + homepage = "https://yaak.app/"; + license = licenses.unfree; + platforms = platforms.linux; + mainProgram = "yaak"; + }; + }; +in +{ + home.packages = [ yaak ]; +} diff --git a/home/ebisu/meta/network/tools/shark/default.nix b/home/ebisu/meta/network/tools/shark/default.nix new file mode 100644 index 0000000..5305bdf --- /dev/null +++ b/home/ebisu/meta/network/tools/shark/default.nix @@ -0,0 +1,8 @@ +{ pkgs +, ... +}: { + home.packages = with pkgs; [ + termshark + wireshark + ]; +} diff --git a/home/ebisu/meta/network/tools/tcp/default.nix b/home/ebisu/meta/network/tools/tcp/default.nix new file mode 100644 index 0000000..6af1824 --- /dev/null +++ b/home/ebisu/meta/network/tools/tcp/default.nix @@ -0,0 +1,12 @@ +{ pkgs, ... }: { + home.packages = with pkgs; [ + bmon + netcat-openbsd + nethogs + inetutils + whois + speedtest-cli + traceroute + iptraf-ng + ]; +} diff --git a/home/ebisu/meta/rice/bottom.nix b/home/ebisu/meta/rice/bottom.nix new file mode 100644 index 0000000..4acf218 --- /dev/null +++ b/home/ebisu/meta/rice/bottom.nix @@ -0,0 +1,195 @@ +{ pkgs, ... }: { + programs.bottom.enable = true; + + xdg.configFile."bottom/bottom.toml".text = '' + # This is a default config file for bottom. All of the settings are commented + # out by default; if you wish to change them uncomment and modify as you see + # fit. + + # This group of options represents a command-line flag/option. Flags explicitly + # added when running (ie: btm -a) will override this config file if an option + # is also set here. + + [flags] + # Whether to hide the average cpu entry. + #hide_avg_cpu = false + # Whether to use dot markers rather than braille. + #dot_marker = false + # The update rate of the application. + rate = "250ms" + # Whether to put the CPU legend to the left. + #left_legend = false + # Whether to set CPU% on a process to be based on the total CPU or just current usage. + #current_usage = false + # Whether to set CPU% on a process to be based on the total CPU or per-core CPU% (not divided by the number of cpus). + #unnormalized_cpu = false + # Whether to group processes with the same name together by default. + #group_processes = false + # Whether to make process searching case sensitive by default. + #case_sensitive = false + # Whether to make process searching look for matching the entire word by default. + #whole_word = false + # Whether to make process searching use regex by default. + #regex = false + # Defaults to Celsius. Temperature is one of: + #temperature_type = "k" + #temperature_type = "f" + #temperature_type = "c" + #temperature_type = "kelvin" + #temperature_type = "fahrenheit" + #temperature_type = "celsius" + # The default time interval (in milliseconds). + #default_time_value = "60s" + # The time delta on each zoom in/out action (in milliseconds). + #time_delta = 15000 + # Hides the time scale. + #hide_time = false + # Override layout default widget + #default_widget_type = "proc" + #default_widget_count = 1 + # Expand selected widget upon starting the app + #expanded_on_startup = true + # Use basic mode + basic = false + # Use the old network legend style + #use_old_network_legend = false + # Remove space in tables + #hide_table_gap = false + # Show the battery widgets + battery = false + # Disable mouse clicks + #disable_click = false + # Built-in themes. Valid values are "default", "default-light", "gruvbox", "gruvbox-light", "nord", "nord-light" + #color = "default" + # Show memory values in the processes widget as values by default + #mem_as_value = false + # Show tree mode by default in the processes widget. + #tree = false + # Shows an indicator in table widgets tracking where in the list you are. + #show_table_scroll_position = false + # Show processes as their commands by default in the process widget. + #process_command = false + # Displays the network widget with binary prefixes. + #network_use_binary_prefix = false + # Displays the network widget using bytes. + #network_use_bytes = false + # Displays the network widget with a log scale. + #network_use_log = false + # Hides advanced options to stop a process on Unix-like systems. + #disable_advanced_kill = false + # Shows GPU(s) memory + enable_gpu_memory = true + # Shows cache and buffer memory + enable_cache_memory = true + # How much data is stored at once in terms of time. + #retention = "10m" + + # These are flags around the process widget. + + #[processes] + #columns = ["PID", "Name", "CPU%", "Mem%", "R/s", "W/s", "T.Read", "T.Write", "User", "State"] + + # These are all the components that support custom theming. Note that colour support + # will depend on terminal support. + + #[colors] # Uncomment if you want to use custom colors + # Represents the colour of table headers (processes, CPU, disks, temperature). + #table_header_color="LightBlue" + # Represents the colour of the label each widget has. + #widget_title_color="Gray" + # Represents the average CPU color. + #avg_cpu_color="Red" + # Represents the colour the core will use in the CPU legend and graph. + #cpu_core_colors=["LightMagenta", "LightYellow", "LightCyan", "LightGreen", "LightBlue", "LightRed", "Cyan", "Green", "Blue", "Red"] + # Represents the colour RAM will use in the memory legend and graph. + #ram_color="LightMagenta" + # Represents the colour SWAP will use in the memory legend and graph. + #swap_color="LightYellow" + # Represents the colour ARC will use in the memory legend and graph. + #arc_color="LightCyan" + # Represents the colour the GPU will use in the memory legend and graph. + #gpu_core_colors=["LightGreen", "LightBlue", "LightRed", "Cyan", "Green", "Blue", "Red"] + # Represents the colour rx will use in the network legend and graph. + #rx_color="LightCyan" + # Represents the colour tx will use in the network legend and graph. + #tx_color="LightGreen" + # Represents the colour of the border of unselected widgets. + #border_color="Gray" + # Represents the colour of the border of selected widgets. + #highlighted_border_color="LightBlue" + # Represents the colour of most text. + #text_color="Gray" + # Represents the colour of text that is selected. + #selected_text_color="Black" + # Represents the background colour of text that is selected. + #selected_bg_color="LightBlue" + # Represents the colour of the lines and text of the graph. + #graph_color="Gray" + # Represents the colours of the battery based on charge + #high_battery_color="green" + #medium_battery_color="yellow" + #low_battery_color="red" + + # Layout - layouts follow a pattern like this: + # [[row]] represents a row in the application. + # [[row.child]] represents either a widget or a column. + # [[row.child.child]] represents a widget. + # + # All widgets must have the type value set to one of ["cpu", "mem", "proc", "net", "temp", "disk", "empty"]. + # All layout components have a ratio value - if this is not set, then it defaults to 1. + # The default widget layout: + #[[row]] + # ratio=30 + # [[row.child]] + # type="cpu" + #[[row]] + # ratio=40 + # [[row.child]] + # ratio=4 + # type="mem" + # [[row.child]] + # ratio=3 + # [[row.child.child]] + # type="temp" + # [[row.child.child]] + # type="disk" + #[[row]] + # ratio=30 + # [[row.child]] + # type="net" + # [[row.child]] + # type="proc" + # default=true + + + # Filters - you can hide specific temperature sensors, network interfaces, and disks using filters. This is admittedly + # a bit hard to use as of now, and there is a planned in-app interface for managing this in the future: + #[disk_filter] + #is_list_ignored = true + #list = ["/dev/sda\\d+", "/dev/nvme0n1p2"] + #regex = true + #case_sensitive = false + #whole_word = false + + #[mount_filter] + #is_list_ignored = true + #list = ["/mnt/.*", "/boot"] + #regex = true + #case_sensitive = false + #whole_word = false + + #[temp_filter] + #is_list_ignored = true + #list = ["cpu", "wifi"] + #regex = false + #case_sensitive = false + #whole_word = false + + #[net_filter] + #is_list_ignored = true + #list = ["virbr0.*"] + #regex = true + #case_sensitive = false + #whole_word = false + ''; +} diff --git a/home/ebisu/meta/rice/default.nix b/home/ebisu/meta/rice/default.nix new file mode 100644 index 0000000..d2b229e --- /dev/null +++ b/home/ebisu/meta/rice/default.nix @@ -0,0 +1,23 @@ +{ pkgs, ... }: +{ + imports = [ + ./bottom.nix + ./glances.nix + ./fastfetch.nix + ./gtk.nix + ]; + + programs = { + btop.enable = true; + pywal.enable = true; + }; + + home.packages = with pkgs; [ + cpufetch + iotop + nvtopPackages.nvidia + htop-vim + iftop + neofetch + ]; +} diff --git a/home/ebisu/meta/rice/fastfetch.nix b/home/ebisu/meta/rice/fastfetch.nix new file mode 100644 index 0000000..fed2677 --- /dev/null +++ b/home/ebisu/meta/rice/fastfetch.nix @@ -0,0 +1,35 @@ +{ pkgs, ... }: +{ + programs.fastfetch = { + enable = true; + + settings = { + logo = { + source = "~/Downloads/91363-1550240807.jpg"; + width = 30; + + padding = { + top = 0; + }; + }; + + modules = [ + "title" + "break" + "os" + "kernel" + "uptime" + "packages" + "shell" + "de" + "wm" + "terminal" + "cpu" + "gpu" + "memory" + "break" + "colors" + ]; + }; + }; +} diff --git a/home/ebisu/meta/rice/glances.nix b/home/ebisu/meta/rice/glances.nix new file mode 100644 index 0000000..cda5a63 --- /dev/null +++ b/home/ebisu/meta/rice/glances.nix @@ -0,0 +1,828 @@ +{ pkgs, ... }: { + home.packages = with pkgs; [ + glances + ]; + + xdg.configFile."glances/glances.conf".text = '' + ############################################################################## + # Globals Glances parameters + ############################################################################## + + [global] + # Stats refresh rate (default is a minimum of 2 seconds) + # Can be overwrite by the -t <sec> option + # It is also possible to overwrite it in each plugin sections + refresh=0 + # Does Glances should check if a newer version is available on PyPI ? + check_update=true + # History size (maximum number of values) + # Default is 1200 values (~1h with the default refresh rate) + history_size=1200 + # Set the way Glances should display the date (default is %Y-%m-%d %H:%M:%S %Z) + #strftime_format="%Y-%m-%d %H:%M:%S %Z" + # Define external directory for loading additional plugins + # The layout follows the glances standard for plugin definitions + #plugin_dir=/home/user/dev/plugins + + ############################################################################## + # User interface + ############################################################################## + + [outputs] + # Options for all UIs + #-------------------- + # Separator in the Curses and WebUI interface (between top and others plugins) + separator=True + # Set the the Curses and WebUI interface left menu plugin list (comma-separated) + #left_menu=network,wifi,connections,ports,diskio,fs,irq,folders,raid,smart,sensors,now + # Limit the number of processes to display (in the WebUI) + max_processes_display=25 + # Options for WebUI + #------------------ + # Set URL prefix for the WebUI and the API + # Example: url_prefix=/glances/ => http://localhost/glances/ + # Note: The final / is mandatory + # Default is no prefix (/) + #url_prefix=/glances/ + # Set root path for WebUI statics files + # Why ? On Debian system, WebUI statics files are not provided. + # You can download it in a specific folder + # thanks to https://github.com/nicolargo/glances/issues/2021 + # then configure this folder with the webui_root_path key + # Default is folder where glances_restfull_api.py is hosted + #webui_root_path= + # CORS options + # Comma separated list of origins that should be permitted to make cross-origin requests. + # Default is * + #cors_origins=* + # Indicate that cookies should be supported for cross-origin requests. + # Default is True + #cors_credentials=True + # Comma separated list of HTTP methods that should be allowed for cross-origin requests. + # Default is * + #cors_methods=* + # Comma separated list of HTTP request headers that should be supported for cross-origin requests. + # Default is * + #cors_headers=* + + ############################################################################## + # Plugins + ############################################################################## + + [quicklook] + # Set to true to disable a plugin + # Note: you can also disable it from the command line (see --disable-plugin <plugin_name>) + disable=False + # Stats list (default is cpu,mem,load) + # Available stats are: cpu,mem,load,swap + list=cpu,mem,load + # Graphical bar char used in the terminal user interface (default is |) + bar_char=| + # Define CPU, MEM and SWAP thresholds in % + cpu_careful=50 + cpu_warning=70 + cpu_critical=90 + mem_careful=50 + mem_warning=70 + mem_critical=90 + swap_careful=50 + swap_warning=70 + swap_critical=90 + # Source: http://blog.scoutapp.com/articles/2009/07/31/understanding-load-averages + # With 1 CPU core, the load should be lower than 1.00 ~ 100% + load_careful=70 + load_warning=100 + load_critical=500 + + [system] + # This plugin display the first line in the Glances UI with: + # Hostname / Operating system name / Architecture information + # Set to true to disable a plugin + disable=False + # Default refresh rate is 60 seconds + #refresh=60 + # System information to display (a string where {key} will be replaced by the value) + # Available information are: hostname, os_name, os_version, os_arch, linux_distro, platform + #system_info_msg= | My {os_name} system | + + [cpu] + disable=False + # See https://scoutapm.com/blog/slow_server_flow_chart + # + # I/O wait percentage should be lower than 1/# (# = Logical CPU cores) + # Leave commented to just use the default config: + # Careful=1/#*100-20% / Warning=1/#*100-10% / Critical=1/#*100 + #iowait_careful=30 + #iowait_warning=40 + #iowait_critical=50 + # + # Total % is 100 - idle + total_careful=65 + total_warning=75 + total_critical=85 + total_log=True + # + # Default values if not defined: 50/70/90 (except for iowait) + user_careful=50 + user_warning=70 + user_critical=90 + user_log=False + #user_critical_action=echo {{user}} {{value}} {{max}} > /tmp/cpu.alert + # + system_careful=50 + system_warning=70 + system_critical=90 + system_log=False + # + steal_careful=50 + steal_warning=70 + steal_critical=90 + #steal_log=True + # + # Context switch limit (core / second) + # Leave commented to just use the default config critical is 50000*(Logical CPU cores) + #ctx_switches_careful=10000 + #ctx_switches_warning=12000 + #ctx_switches_critical=14000 + + [percpu] + disable=False + # Define the maximum number of CPU displayed at a time + # If the number of CPU is higher than the one configured in max_cpu_display then: + # - display top 'max_cpu_display' (sorted by CPU consumption) + # - a last line will be added with the mean of all other CPUs + max_cpu_display=4 + # Define CPU thresholds in % + # Default values if not defined: 50/70/90 + user_careful=50 + user_warning=70 + user_critical=90 + iowait_careful=50 + iowait_warning=70 + iowait_critical=90 + system_careful=50 + system_warning=70 + system_critical=90 + + [gpu] + disable=False + # Default processor values if not defined: 50/70/90 + proc_careful=50 + proc_warning=70 + proc_critical=90 + # Default memory values if not defined: 50/70/90 + mem_careful=50 + mem_warning=70 + mem_critical=90 + # Temperature + temperature_careful=60 + temperature_warning=70 + temperature_critical=80 + + [mem] + disable=False + # Define RAM thresholds in % + # Default values if not defined: 50/70/90 + careful=50 + #careful_action_repeat=echo {{percent}} >> /tmp/memory.alert + warning=70 + critical=90 + + [memswap] + disable=False + # Define SWAP thresholds in % + # Default values if not defined: 50/70/90 + careful=50 + warning=70 + critical=90 + + [load] + disable=False + # Define LOAD thresholds + # Value * number of cores + # Default values if not defined: 0.7/1.0/5.0 per number of cores + # Source: http://blog.scoutapp.com/articles/2009/07/31/understanding-load-averages + # http://www.linuxjournal.com/article/9001 + careful=0.7 + warning=1.0 + critical=5.0 + #log=False + + [network] + disable=False + # Default bitrate thresholds in % of the network interface speed + # Default values if not defined: 70/80/90 + rx_careful=70 + rx_warning=80 + rx_critical=90 + tx_careful=70 + tx_warning=80 + tx_critical=90 + # Define the list of hidden network interfaces (comma-separated regexp) + hide=docker.*,lo + # Define the list of wireless network interfaces to be show (comma-separated) + #show=docker.* + # Automatically hide interface not up (default is False) + #hide_no_up=True + # Automatically hide interface with no IP address (default is False) + #hide_no_ip=True + # It is possible to overwrite the bitrate thresholds per interface + # WLAN 0 Default limits (in bits per second aka bps) for interface bitrate + #wlan0_rx_careful=4000000 + #wlan0_rx_warning=5000000 + #wlan0_rx_critical=6000000 + #wlan0_rx_log=True + #wlan0_tx_careful=700000 + #wlan0_tx_warning=900000 + #wlan0_tx_critical=1000000 + #wlan0_tx_log=True + # Alias for network interface name + #alias=wlp2s0:WIFI + + [ip] + # Disable display of private IP address + disable=False + # Configure the online service where public IP address information will be downloaded + # - public_disabled: Disable public IP address information (set to True for offline platform) + # - public_refresh_interval: Refresh interval between to calls to the online service + # - public_api: URL of the API (the API should return an JSON object) + # - public_username: Login for the online service (if needed) + # - public_password: Password for the online service (if needed) + # - public_field: Field name of the public IP address in onlibe service JSON message + # - public_template: Template to build the public message + # + # Example for IPLeak service: + # public_api=https://ipv4.ipleak.net/json/ + # public_field=ip + # public_template={ip} {continent_name}/{country_name}/{city_name} + # + public_disabled=True + public_refresh_interval=300 + public_api=https://ipv4.ipleak.net/json/ + #public_username=<myname> + #public_password=<mysecret> + public_field=ip + public_template={continent_name}/{country_name}/{city_name} + + [connections] + # Display additional information about TCP connections + # This plugin is disabled by default because it consumes lots of CPU + disable=False + # nf_conntrack thresholds in % + nf_conntrack_percent_careful=70 + nf_conntrack_percent_warning=80 + nf_conntrack_percent_critical=90 + + [wifi] + disable=False + # Define SIGNAL thresholds in dBm (lower is better...) + # Based on: http://serverfault.com/questions/501025/industry-standard-for-minimum-wifi-signal-strength + careful=-65 + warning=-75 + critical=-85 + + [diskio] + disable=False + # Define the list of hidden disks (comma-separated regexp) + #hide=sda2,sda5,loop.* + hide=loop.*,/dev/loop.* + # Define the list of disks to be show (comma-separated) + #show=sda.* + # Alias for sda1 and sdb1 + #alias=sda1:SystemDisk,sdb1:DataDisk + + [fs] + disable=False + # Define the list of file system to hide (comma-separated regexp) + hide=/boot.*,.*/snap.* + # Define the list of file system to show (comma-separated regexp) + #show=/,/srv + # Define filesystem space thresholds in % + # Default values if not defined: 50/70/90 + # It is also possible to define per mount point value + # Example: /_careful=40 + careful=50 + warning=70 + critical=90 + # Allow additional file system types (comma-separated FS type) + #allow=shm + # Alias for root file system + #alias=/:Root + + [irq] + # Documentation: https://glances.readthedocs.io/en/latest/aoa/irq.html + # This plugin is disabled by default + disable=True + + [folders] + # Documentation: https://glances.readthedocs.io/en/latest/aoa/folders.html + disable=False + # Define a folder list to monitor + # The list is composed of items (list_#nb <= 10) + # An item is defined by: + # * path: absolute path + # * careful: optional careful threshold (in MB) + # * warning: optional warning threshold (in MB) + # * critical: optional critical threshold (in MB) + # * refresh: interval in second between two refreshes + #folder_1_path=/tmp + #folder_1_careful=2500 + #folder_1_warning=3000 + #folder_1_critical=3500 + #folder_1_refresh=60 + #folder_2_path=/home/nicolargo/Videos + #folder_2_warning=17000 + #folder_2_critical=20000 + #folder_3_path=/nonexisting + #folder_4_path=/root + + [cloud] + # Documentation: https://glances.readthedocs.io/en/latest/aoa/cloud.html + # This plugin is disabled by default + disable=True + + [raid] + # Documentation: https://glances.readthedocs.io/en/latest/aoa/raid.html + # This plugin is disabled by default + disable=True + + [smart] + # Documentation: https://glances.readthedocs.io/en/latest/aoa/smart.html + # This plugin is disabled by default + disable=True + + [hddtemp] + disable=False + # Define hddtemp server IP and port (default is 127.0.0.1 and 7634 (TCP)) + host=127.0.0.1 + port=7634 + + [sensors] + # Documentation: https://glances.readthedocs.io/en/latest/aoa/sensors.html + disable=False + # Set the refresh multiplicator for the sensors + # By default refresh every Glances refresh * 3 (increase to reduce CPU consumption) + #refresh=3 + # Hide some sensors (comma separated list of regexp) + hide=unknown.* + # Show only the following sensors (comma separated list of regexp) + #show=CPU.* + # Sensors core thresholds (in Celsius...) + # Default values are grabbed from the system + #temperature_core_careful=45 + #temperature_core_warning=65 + #temperature_core_critical=80 + # Temperatures threshold in °C for hddtemp + # Default values if not defined: 45/52/60 + temperature_hdd_careful=45 + temperature_hdd_warning=52 + temperature_hdd_critical=60 + # Battery threshold in % + battery_careful=80 + battery_warning=90 + battery_critical=95 + # Fan speed threashold in RPM + #fan_speed_careful=100 + # Sensors alias + #alias=core 0:CPU Core 0,core 1:CPU Core 1 + + [processcount] + disable=False + # If you want to change the refresh rate of the processing list, please uncomment: + #refresh=10 + + [processlist] + disable=False + # Sort key: if not defined, the sort is automatically done by Glances (recommended) + # Should be one of the following: + # cpu_percent, memory_percent, io_counters, name, cpu_times, username + #sort_key=memory_percent + # Define CPU/MEM (per process) thresholds in % + # Default values if not defined: 50/70/90 + cpu_careful=50 + cpu_warning=70 + cpu_critical=90 + mem_careful=50 + mem_warning=70 + mem_critical=90 + # + # Nice priorities range from -20 to 19. + # Configure nice levels using a comma-separated list. + # + # Nice: Example 1, non-zero is warning (default behavior) + nice_warning=-20,-19,-18,-17,-16,-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19 + # + # Nice: Example 2, low priority processes escalate from careful to critical + #nice_careful=1,2,3,4,5,6,7,8,9 + #nice_warning=10,11,12,13,14 + #nice_critical=15,16,17,18,19 + # + # Define the list of processes to export using: + # a comma-separated list of Glances filter + #export=.*firefox.*,pid:1234 + + [ports] + disable=False + # Interval in second between two scans + # Ports scanner plugin configuration + refresh=30 + # Set the default timeout (in second) for a scan (can be overwritten in the scan list) + timeout=3 + # If port_default_gateway is True, add the default gateway on top of the scan list + port_default_gateway=True + # + # Define the scan list (1 < x < 255) + # port_x_host (name or IP) is mandatory + # port_x_port (TCP port number) is optional (if not set, use ICMP) + # port_x_description is optional (if not set, define to host:port) + # port_x_timeout is optional and overwrite the default timeout value + # port_x_rtt_warning is optional and defines the warning threshold in ms + # + #port_1_host=192.168.0.1 + #port_1_port=80 + #port_1_description=Home Box + #port_1_timeout=1 + #port_2_host=www.free.fr + #port_2_description=My ISP + #port_3_host=www.google.com + #port_3_description=Internet ICMP + #port_3_rtt_warning=1000 + #port_4_description=Internet Web + #port_4_host=www.google.com + #port_4_port=80 + #port_4_rtt_warning=1000 + # + # Define Web (URL) monitoring list (1 < x < 255) + # web_x_url is the URL to monitor (example: http://my.site.com/folder) + # web_x_description is optional (if not set, define to URL) + # web_x_timeout is optional and overwrite the default timeout value + # web_x_rtt_warning is optional and defines the warning respond time in ms (approximately) + # + #web_1_url=https://blog.nicolargo.com + #web_1_description=My Blog + #web_1_rtt_warning=3000 + #web_2_url=https://github.com + #web_3_url=http://www.google.fr + #web_3_description=Google Fr + #web_4_url=https://blog.nicolargo.com/nonexist + #web_4_description=Intranet + + [containers] + disable=False + # Only show specific containers (comma-separated list of container name or regular expression) + # Comment this line to display all containers (default configuration) + ; show=telegraf + # Hide some containers (comma-separated list of container name or regular expression) + # Comment this line to display all containers (default configuration) + ; hide=telegraf + # Define the maximum docker size name (default is 20 chars) + max_name_size=20 + ; cpu_careful=50 + # Thresholds for CPU and MEM (in %) + ; cpu_warning=70 + ; cpu_critical=90 + ; mem_careful=20 + ; mem_warning=50 + ; mem_critical=70 + # + # Per container thresholds + ; containername_cpu_careful=10 + ; containername_cpu_warning=20 + ; containername_cpu_critical=30 + # + # By default, Glances only display running containers + # Set the following key to True to display all containers + all=False + # Define Podman sock + ; podman_sock=unix:///run/user/1000/podman/podman.sock + + [amps] + # AMPs configuration are defined in the bottom of this file + disable=False + + [alert] + disable=False + # Maximum number of events to display (default is 10 events) + ;max_events=10 + # Minimum duration for an event to be taken into account (default is 6 seconds) + ;min_duration=6 + # Minimum time between two events of the same type (default is 6 seconds) + # This is used to avoid too many alerts for the same event + # Events will be merged + ;min_interval=6 + + ############################################################################## + # Client/server + ############################################################################## + + [serverlist] + # Define the static servers list + #server_1_name=localhost + #server_1_alias=My local PC + #server_1_port=61209 + #server_2_name=localhost + #server_2_port=61235 + #server_3_name=192.168.0.17 + #server_3_alias=Another PC on my network + #server_3_port=61209 + #server_4_name=pasbon + #server_4_port=61237 + + [passwords] + # Define the passwords list related to the [serverlist] section + # Syntax: host=password + # Where: host is the hostname + # password is the clear password + # Additionally (and optionally) a default password could be defined + #localhost=abc + #default=defaultpassword + # + # Define the path of the local '.pwd' file (default is system one) + #local_password_path=~/.config/glances + + ############################################################################## + # Exports + ############################################################################## + + [graph] + # Configuration for the --export graph option + # Set the path where the graph (.svg files) will be created + # Can be overwrite by the --graph-path command line option + path=/tmp + # It is possible to generate the graphs automatically by setting the + # generate_every to a non zero value corresponding to the seconds between + # two generation. Set it to 0 to disable graph auto generation. + generate_every=0 + # See following configuration keys definitions in the Pygal lib documentation + # http://pygal.org/en/stable/documentation/index.html + width=800 + height=600 + style=DarkStyle + + [influxdb] + # !!! + # Will be DEPRECATED in future release. + # Please have a look on the new influxdb2 export module (compatible with InfluxDB 1.8.x and 2.x) + # !!! + # Configuration for the --export influxdb option + # https://influxdb.com/ + host=localhost + port=8086 + protocol=http + user=root + password=root + db=glances + # Prefix will be added for all measurement name + # Ex: prefix=foo + # => foo.cpu + # => foo.mem + # You can also use dynamic values + #prefix=foo + # Following tags will be added for all measurements + # You can also use dynamic values. + # Note: hostname and name (for process) are always added as a tag + #tags=foo:bar,spam:eggs,domain:`domainname` + + [influxdb2] + # Configuration for the --export influxdb2 option + # https://influxdb.com/ + host=localhost + port=8086 + protocol=http + org=nicolargo + bucket=glances + token=EjFUTWe8U-MIseEAkaVIgVnej_TrnbdvEcRkaB1imstW7gapSqy6_6-8XD-yd51V0zUUpDy-kAdVD1purDLuxA== + # Set the interval between two exports (in seconds) + # If the interval is set to 0, the Glances refresh time is used (default behavor) + #interval=0 + # Prefix will be added for all measurement name + # Ex: prefix=foo + # => foo.cpu + # => foo.mem + # You can also use dynamic values + #prefix=foo + # Following tags will be added for all measurements + # You can also use dynamic values. + # Note: hostname and name (for process) are always added as a tag + #tags=foo:bar,spam:eggs,domain:`domainname` + + [cassandra] + # Configuration for the --export cassandra option + # Also works for the ScyllaDB + # https://influxdb.com/ or http://www.scylladb.com/ + host=localhost + port=9042 + protocol_version=3 + keyspace=glances + replication_factor=2 + # If not define, table name is set to host key + table=localhost + # If not define, username and password will not be used + #username=cassandra + #password=password + + [opentsdb] + # Configuration for the --export opentsdb option + # http://opentsdb.net/ + host=localhost + port=4242 + #prefix=glances + #tags=foo:bar,spam:eggs + + [statsd] + # Configuration for the --export statsd option + # https://github.com/etsy/statsd + host=localhost + port=8125 + #prefix=glances + + [elasticsearch] + # Configuration for the --export elasticsearch option + # Data are available via the ES RESTful API. ex: URL/<index>/cpu + # https://www.elastic.co + scheme=http + host=localhost + port=9200 + index=glances + + [riemann] + # Configuration for the --export riemann option + # http://riemann.io + host=localhost + port=5555 + + [rabbitmq] + # Configuration for the --export rabbitmq option + host=localhost + port=5672 + user=guest + password=guest + queue=glances_queue + #protocol=amqps + + [mqtt] + # Configuration for the --export mqtt option + host=localhost + # Overwrite device name in the topic + #devicename=localhost + port=8883 + tls=false + user=guest + password=guest + topic=glances + topic_structure=per-metric + callback_api_version=2 + + [couchdb] + # Configuration for the --export couchdb option + # https://www.couchdb.org + host=localhost + port=5984 + db=glances + user=admin + password=admin + + [mongodb] + # Configuration for the --export mongodb option + # https://www.mongodb.com + host=localhost + port=27017 + db=glances + user=root + password=example + + [kafka] + # Configuration for the --export kafka option + # http://kafka.apache.org/ + host=localhost + port=9092 + topic=glances + #compression=gzip + # Tags will be added for all events + #tags=foo:bar,spam:eggs + # You can also use dynamic values + #tags=hostname:`hostname -f` + + [zeromq] + # Configuration for the --export zeromq option + # http://www.zeromq.org + # Use * to bind on all interfaces + host=* + port=5678 + # Glances envelopes the stats in a publish message with two frames: + # - First frame containing the following prefix (STRING) + # - Second frame with the Glances plugin name (STRING) + # - Third frame with the Glances plugin stats (JSON) + prefix=G + + [prometheus] + # Configuration for the --export prometheus option + # https://prometheus.io + # Create a Prometheus exporter listening on localhost:9091 (default configuration) + # Metric are exporter using the following name: + # <prefix>_<plugin>_<stats>{labelkey:labelvalue} + # Note: You should add this exporter to your Prometheus server configuration: + # scrape_configs: + # - job_name: 'glances_exporter' + # scrape_interval: 5s + # static_configs: + # - targets: ['localhost:9091'] + # + # Labels will be added for all measurements (default is src:glances) + # labels=foo:bar,spam:eggs + # You can also use dynamic values + # labels=system:`uname -s` + # + host=localhost + port=9091 + #prefix=glances + labels=src:glances + + [restful] + # Configuration for the --export restful option + # Example, export to http://localhost:6789/ + host=localhost + port=6789 + protocol=http + path=/ + + [graphite] + # Configuration for the --export graphite option + # https://graphiteapp.org/ + host=localhost + port=2003 + # Prefix will be added for all measurement name + prefix=glances + # System name added between the prefix and the stats + # By default, system_name = FQDN + #system_name=mycomputer + + ############################################################################## + # AMPS + # * enable: Enable (true) or disable (false) the AMP + # * regex: Regular expression to filter the process(es) + # * refresh: The AMP is executed every refresh seconds + # * one_line: (optional) Force (if true) the AMP to be displayed in one line + # * command: (optional) command to execute when the process is detected (thk to the regex) + # * countmin: (optional) minimal number of processes + # A warning will be displayed if number of process < count + # * countmax: (optional) maximum number of processes + # A warning will be displayed if number of process > count + # * <foo>: Others variables can be defined and used in the AMP script + ############################################################################## + + [amp_dropbox] + # Use the default AMP (no dedicated AMP Python script) + # Check if the Dropbox daemon is running + # Every 3 seconds, display the 'dropbox status' command line + enable=false + regex=.*dropbox.* + refresh=3 + one_line=false + command=dropbox status + countmin=1 + + [amp_python] + # Use the default AMP (no dedicated AMP Python script) + # Monitor all the Python scripts + # Alert if more than 20 Python scripts are running + enable=false + regex=.*python.* + refresh=3 + countmax=20 + + [amp_conntrack] + # Use && separator for multiple commands + # If the regex key is not defined, the AMP will be executed every refresh second + # and the process count will not be displayed (countmin and countmax will be ignore) + enable=false + refresh=30 + one_line=false + command=sysctl net.netfilter.nf_conntrack_count && sysctl net.netfilter.nf_conntrack_max + + [amp_nginx] + # Use the NGinx AMP + # Nginx status page should be enable (https://easyengine.io/tutorials/nginx/status-page/) + enable=false + regex=\/usr\/sbin\/nginx + refresh=60 + one_line=false + status_url=http://localhost/nginx_status + + [amp_systemd] + # Use the Systemd AMP + enable=false + regex=\/lib\/systemd\/systemd + refresh=30 + one_line=true + systemctl_cmd=/bin/systemctl --plain + + [amp_systemv] + # Use the Systemv AMP + enable=false + regex=\/sbin\/init + refresh=30 + one_line=true + service_cmd=/usr/bin/service --status-all + ''; +} diff --git a/home/ebisu/meta/rice/gtk.nix b/home/ebisu/meta/rice/gtk.nix new file mode 100644 index 0000000..0e4f13c --- /dev/null +++ b/home/ebisu/meta/rice/gtk.nix @@ -0,0 +1,35 @@ +{ pkgs, ... }: { + gtk = { + enable = true; + + iconTheme = { + name = "WhiteSur-dark"; + package = pkgs.whitesur-icon-theme; + }; + + theme = { + name = "WhiteSur-Dark"; + package = pkgs.whitesur-gtk-theme; + }; + + cursorTheme = { + name = "Bibata-Modern-Ice"; + package = pkgs.bibata-cursors; + size = 18; + }; + + gtk3.extraConfig = { + Settings = '' + gtk-application-prefer-dark-theme=1 + ''; + }; + + gtk4.extraConfig = { + Settings = '' + gtk-application-prefer-dark-theme=1 + ''; + }; + }; + + home.sessionVariables.GTK_THEME = "WhiteSur-Dark"; +}
\ No newline at end of file diff --git a/home/ebisu/meta/scripts/default.nix b/home/ebisu/meta/scripts/default.nix new file mode 100644 index 0000000..58851ea --- /dev/null +++ b/home/ebisu/meta/scripts/default.nix @@ -0,0 +1,13 @@ +{ pkgs, ... }: +let + scriptDir = ./scripts; + generateScripts = builtins.listToAttrs (builtins.map + (name: { + name = name; + value = pkgs.writeShellScriptBin name (builtins.readFile "${scriptDir}/${name}"); + }) + (builtins.attrNames (builtins.readDir scriptDir))); +in +{ + home.packages = builtins.attrValues generateScripts; +} diff --git a/home/ebisu/meta/scripts/scripts/.gitignore b/home/ebisu/meta/scripts/scripts/.gitignore new file mode 100644 index 0000000..2ea4e67 --- /dev/null +++ b/home/ebisu/meta/scripts/scripts/.gitignore @@ -0,0 +1,8 @@ +know +hime +mirrors +pok +bt +counter +rinny +suzuri
\ No newline at end of file diff --git a/home/ebisu/meta/scripts/scripts/altserver b/home/ebisu/meta/scripts/scripts/altserver new file mode 100755 index 0000000..0a0d5f9 --- /dev/null +++ b/home/ebisu/meta/scripts/scripts/altserver @@ -0,0 +1,12 @@ +# Wrapper around AltServer for usage on *nix + +# doas usbmuxd & + +# export USBMUXD_SOCKET_ADDRESS=127.0.0.1:27015 + +# doas netmuxd --disable-unix --host 127.0.0.1 & + +docker run -d -v lib_cache:/opt/lib/ --restart=always -p 6969:6969 --name anisette dadoum/anisette-server:latest + +# Not very Nix .... +ALTSERVER_ANISETTE_SERVER=http://127.0.0.1:6969 python3 ~/.local/src/AltServer-Linux/main.py diff --git a/home/ebisu/meta/scripts/scripts/anidub b/home/ebisu/meta/scripts/scripts/anidub new file mode 100755 index 0000000..aacf84f --- /dev/null +++ b/home/ebisu/meta/scripts/scripts/anidub @@ -0,0 +1,3 @@ +# Wrapper around ani-cli (dubbed) for Rofi + +ANI_CLI_PLAYER=clapper ani-cli --dub --rofi "${1}" diff --git a/home/ebisu/meta/scripts/scripts/anime b/home/ebisu/meta/scripts/scripts/anime new file mode 100755 index 0000000..60b143b --- /dev/null +++ b/home/ebisu/meta/scripts/scripts/anime @@ -0,0 +1,3 @@ +# Wrapper around ani-cli for Rofi + +ANI_CLI_PLAYER=mpv ani-cli --rofi "${1}" diff --git a/home/ebisu/meta/scripts/scripts/apod b/home/ebisu/meta/scripts/scripts/apod new file mode 100755 index 0000000..a8814a9 --- /dev/null +++ b/home/ebisu/meta/scripts/scripts/apod @@ -0,0 +1,6 @@ +# Get today's Astronomy Picture of the Day (APOD) from NASA + +printf \ + "https://apod.nasa.gov/apod/%s\\n" \ + "$(curl --silent "https://apod.nasa.gov/apod/" | + grep -Po 'SRC="\K[^"]+')" diff --git a/home/ebisu/meta/scripts/scripts/catboy b/home/ebisu/meta/scripts/scripts/catboy new file mode 100755 index 0000000..cc75e52 --- /dev/null +++ b/home/ebisu/meta/scripts/scripts/catboy @@ -0,0 +1,8 @@ +# VPN wrapper around catgirl + +vpn_ip="$(piactl get vpnip)" + +BIND_INTERFACE=wgpia0 \ + LD_PRELOAD=/usr/lib/bindtointerface.so \ + BIND_SOURCE_IP=${vpn_ip} \ + catgirl "${1}" diff --git a/home/ebisu/meta/scripts/scripts/chan2 b/home/ebisu/meta/scripts/scripts/chan2 new file mode 100755 index 0000000..525d5f1 --- /dev/null +++ b/home/ebisu/meta/scripts/scripts/chan2 @@ -0,0 +1,3 @@ +# Tiny wrapper around chan-downloader + +chan-downloader -c 10 --thread "${1}" -o "${2}" diff --git a/home/ebisu/meta/scripts/scripts/fim b/home/ebisu/meta/scripts/scripts/fim new file mode 100755 index 0000000..d1be1c5 --- /dev/null +++ b/home/ebisu/meta/scripts/scripts/fim @@ -0,0 +1,20 @@ +# Finger "blog" updater + +HOST="sina" + +while getopts "f" opt; do + case ${opt} in + f) FORMAT=true ;; + *) FORMAT=false ;; + esac +done + +shift $((OPTIND - 1)) + +PROFILE="/var/lib/docker/volumes/gigi-data/_data/${1:-fuwn}" + +if [ -n "${FORMAT}" ]; then + ssh -t "${HOST}" "vim -c 'autocmd BufWritePost * !fmt -w 80 % > %.tmp && mv %.tmp %' '${PROFILE}'" +else + ssh -t "${HOST}" "vim '${PROFILE}'" +fi diff --git a/home/ebisu/meta/scripts/scripts/gmiwatch b/home/ebisu/meta/scripts/scripts/gmiwatch new file mode 100755 index 0000000..cf3e52a --- /dev/null +++ b/home/ebisu/meta/scripts/scripts/gmiwatch @@ -0,0 +1,24 @@ +# Gemini capsule watcher, used for development + +usage() { + echo "usage: ${0} [-n interval] <url>" + + exit 1 +} + +while getopts "n:" opt; do + case ${opt} in + n) + interval=${OPTARG} + + shift 2 + ;; + *) usage ;; + esac +done + +if [ -z "${1}" ]; then + usage +fi + +watch -n "${interval:-5}" -t gmni -j always "gemini://${1}" diff --git a/home/ebisu/meta/scripts/scripts/hon b/home/ebisu/meta/scripts/scripts/hon new file mode 100755 index 0000000..b4436ec --- /dev/null +++ b/home/ebisu/meta/scripts/scripts/hon @@ -0,0 +1,11 @@ +# Personal manga feed wrapper around Suzuri + +SUZURI_MINIMAL=1 \ + SUZURI_REVERSE=1 \ + suzuri \ + AXHJex1ZiWcQFSzUKhQ5uW \ + Anime | + grep -iF manga | + sed -E 's|http[s]?://[^ ]+||g' | + sed 's/^/* /' | + tac # | glow -w 2048 diff --git a/home/ebisu/meta/scripts/scripts/locs b/home/ebisu/meta/scripts/scripts/locs new file mode 100755 index 0000000..7b0ea19 --- /dev/null +++ b/home/ebisu/meta/scripts/scripts/locs @@ -0,0 +1,102 @@ +# Silly lines-of-code counter + +DEFAULT_COMMENT_STYLES='(//|#|/\*|\*|<!--|-->)' +FILE_MAX_LENGTH=5 + +count_non_empty_lines() { + local file="${1}" + grep -cve '^\s*$' "${file}" +} + +process_files() { + for file in "$@"; do + if [ -f "${file}" ]; then + if [ ${#file} -gt "${longest_filename}" ]; then + longest_filename=${#file} + fi + fi + done + + for file in "$@"; do + if [ -f "${file}" ]; then + lines=$(count_non_empty_lines "${file}") + total_lines=$((total_lines + lines)) + + case "${file}" in + *.gleam) COMMENT_STYLE='(//)' ;; + *.cc | *.hh | *.cpp | *.hpp | *.c | *.h) COMMENT_STYLE='(//|/\*)' ;; + *) COMMENT_STYLE=${DEFAULT_COMMENT_STYLES} ;; + esac + + comments=$(grep -E "^\s*${COMMENT_STYLE}\s*.*\s*$" "${file}" | grep -v '^\s*$' | wc -l) + total_comments=$((total_comments + comments)) + + printf "%-${longest_filename}s %-${FILE_MAX_LENGTH}s %s\n" "${file}" "$((lines - comments))" "${comments}" + + if [ "${LOCS_PRINT_COMMENTS:-0}" = 1 ]; then + grep -n -E "^\s*${COMMENT_STYLE}\s*.*\s*$" "${file}" | grep -v '^\s*$' | sed 's/^/ /' | sed 's/\s*\/\///' | sed 's/\([0-9]\+\): /\1 | /' + + if [ "${comments}" -gt 0 ]; then + echo + fi + fi + fi + done +} + +main() { + local total_lines=0 + local total_comments=0 + local longest_filename=0 + + if [ -z "$1" ]; then + cat <<EOF +usage: ${0} <glob_pattern> + +⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢲⢄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ +⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ +⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠄⠂⢉⠤⠐⠋⠈⠡⡈⠉⠐⠠⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ +⠀⠀⠀⠀⢀⡀⢠⣤⠔⠁⢀⠀⠀⠀⠀⠀⠀⠀⠈⢢⠀⠀⠈⠱⡤⣤⠄⣀⠀⠀⠀⠀⠀ +⠀⠀⠰⠁⠀⣰⣿⠃⠀⢠⠃⢸⠀⠀⠀⠀⠀⠀⠀⠀⠁⠀⠀⠀⠈⢞⣦⡀⠈⡇⠀⠀⠀ +⠀⠀⠀⢇⣠⡿⠁⠀⢀⡃⠀⣈⠀⠀⠀⠀⢰⡀⠀⠀⠀⠀⢢⠰⠀⠀⢺⣧⢰⠀⠀⠀⠀ +⠀⠀⠀⠈⣿⠁⡘⠀⡌⡇⠀⡿⠸⠀⠀⠀⠈⡕⡄⠀⠐⡀⠈⠀⢃⠀⠀⠾⠇⠀⠀⠀⠀ +⠀⠀⠀⠀⠇⡇⠃⢠⠀⠶⡀⡇⢃⠡⡀⠀⠀⠡⠈⢂⡀⢁⠀⡁⠸⠀⡆⠘⡀⠀⠀⠀⠀ +⠀⠀⠀⠸⠀⢸⠀⠘⡜⠀⣑⢴⣀⠑⠯⡂⠄⣀⣣⢀⣈⢺⡜⢣⠀⡆⡇⠀⢣⠀⠀⠀⠀ +⠀⠀⠀⠇⠀⢸⠀⡗⣰⡿⡻⠿⡳⡅⠀⠀⠀⠀⠈⡵⠿⠿⡻⣷⡡⡇⡇⠀⢸⣇⠀⠀⠀ +⠀⠀⢰⠀⠀⡆⡄⣧⡏⠸⢠⢲⢸⠁⠀⠀⠀⠀⠐⢙⢰⠂⢡⠘⣇⡇⠃⠀⠀⢹⡄⠀⠀ +⠀⠀⠟⠀⠀⢰⢁⡇⠇⠰⣀⢁⡜⠀⠀⠀⠀⠀⠀⠘⣀⣁⠌⠀⠃⠰⠀⠀⠀⠈⠰⠀⠀ +⠀⡘⠀⠀⠀⠀⢊⣤⠀⠀⠤⠄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠤⠄⠀⢸⠃⠀⠀⠀⠀⠀⠃⠀ +⢠⠁⢀⠀⠀⠀⠈⢿⡀⠀⠀⠀⠀⠀⠀⢀⡀⠀⠀⠀⠀⠀⠀⢀⠏⠀⠀⠀⠀⠀⠀⠸⠀ +⠘⠸⠘⡀⠀⠀⠀⠀⢣⠀⠀⠀⠀⠀⠀⠁⠀⠃⠀⠀⠀⠀⢀⠎⠀⠀⠀⠀⠀⢠⠀⠀⡇ +⠀⠇⢆⢃⠀⠀⠀⠀⠀⡏⢲⢤⢀⡀⠀⠀⠀⠀⠀⢀⣠⠄⡚⠀⠀⠀⠀⠀⠀⣾⠀⠀⠀ +⢰⠈⢌⢎⢆⠀⠀⠀⠀⠁⣌⠆⡰⡁⠉⠉⠀⠉⠁⡱⡘⡼⠇⠀⠀⠀⠀⢀⢬⠃⢠⠀⡆ +⠀⢢⠀⠑⢵⣧⡀⠀⠀⡿⠳⠂⠉⠀⠀⠀⠀⠀⠀⠀⠁⢺⡀⠀⠀⢀⢠⣮⠃⢀⠆⡰⠀ +⠀⠀⠑⠄⣀⠙⡭⠢⢀⡀⠀⠁⠄⣀⣀⠀⢀⣀⣀⣀⡠⠂⢃⡀⠔⠱⡞⢁⠄⣁⠔⠁⠀ +⠀⠀⠀⠀⠀⢠⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⠉⠁⠀⠀⠀⠀ +⠀⠀⠀⠀⠀⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀ + +EOF + + exit 1 + fi + + local files + + files=$(find "${@}" -type f) + + process_files ${files} >/tmp/lines + + if [ "${LOCS_HEADER:-1}" = 1 ]; then + printf "%-${longest_filename}s %-${FILE_MAX_LENGTH}s %s\n" "filename" "lines" "comments" + fi + + if [ "${LOCS_PRINT_COMMENTS:-0}" = 1 ] || [ "${LOCS_SORT:-1}" = 0 ]; then + cat /tmp/lines + else + sort -k2nr </tmp/lines + fi + + printf "%-${longest_filename}s %-${FILE_MAX_LENGTH}s %s\n" "total" "$((total_lines - total_comments))" "${total_comments}" +} + +main "$@" diff --git a/home/ebisu/meta/scripts/scripts/neovide-lunarvim b/home/ebisu/meta/scripts/scripts/neovide-lunarvim new file mode 100644 index 0000000..502a3f1 --- /dev/null +++ b/home/ebisu/meta/scripts/scripts/neovide-lunarvim @@ -0,0 +1,7 @@ +# ref: https://aur.archlinux.org/cgit/aur.git/tree/script.sh?h=neovide-lunarvim + +export LUNARVIM_CONFIG_DIR="${LUNARVIM_CONFIG_DIR:-$HOME/.config/lvim}" +export LUNARVIM_RUNTIME_DIR="${LUNARVIM_RUNTIME_DIR:-$HOME/.local/share/lunarvim}" +export LUNARVIM_CACHE_DIR="${LUNARVIM_CACHE_DIR:-$HOME/.cache/lvim}" + +exec neovide -- -u "$LUNARVIM_RUNTIME_DIR/lvim/init.lua" "$@" diff --git a/home/ebisu/meta/scripts/scripts/reco b/home/ebisu/meta/scripts/scripts/reco new file mode 100755 index 0000000..9402a1a --- /dev/null +++ b/home/ebisu/meta/scripts/scripts/reco @@ -0,0 +1,58 @@ +# COBOL line number incrementer + +if [ "$#" -lt 1 ]; then + echo "usage: $0 [-i x] filename" + + exit 1 +fi + +increment=10 +start_value=10 +filename="" + +while getopts "i:s:" opt; do + case ${opt} in + i) + increment=1 + start_value=${OPTARG} + ;; + s) + start_value=${OPTARG} + ;; + \?) + echo "invalid option: -${OPTARG}" + echo "usage: $0 [-i x] filename" + exit 1 + ;; + :) + echo "option -${OPTARG} requires an argument." + echo "usage: $0 [-i x] filename" + exit 1 + ;; + *) ;; + esac +done + +shift $((OPTIND - 1)) + +if [ -z "$1" ]; then + echo "usage: $0 [-i x] filename" + + exit 1 +fi + +filename="$1" +tmpfile1=$(mktemp) +# tmpfile2=$(mktemp) + +awk -v inc="${increment}" -v start="${start_value}" '{ + new_line_number = sprintf("%06d", start + (NR - 1) * inc); + print new_line_number substr($0, 7); +}' "${filename}" >"${tmpfile1}" + +# awk '{ +# print substr($0, 1, 74) sprintf("%06d", NR) substr($0, 81); +# }' "${tmpfile1}" >"${tmpfile2}" + +# mv "${tmpfile2}" "${filename}" +mv "${tmpfile1}" "${filename}" diff --git a/home/ebisu/meta/scripts/scripts/setbg b/home/ebisu/meta/scripts/scripts/setbg new file mode 100755 index 0000000..a399344 --- /dev/null +++ b/home/ebisu/meta/scripts/scripts/setbg @@ -0,0 +1,75 @@ +background_location="${XDG_DATA_HOME:-${HOME}/.local/share}/bg" +dunst_configuration_file="${XDG_CONFIG_HOME:-${HOME}/.config}/dunst/dunstrc" +zathura_configuration_file="${XDG_CONFIG_HOME:-${HOME}/.config}/zathura/zathurarc" + +while getopts "s" o; do case "${o}" in + s) silent='1' ;; + *) ;; + esac done + +shift $((OPTIND - 1)) + +true_background_location="$(readlink -f "$1")" && + case "$(file --mime-type -b "${true_background_location}")" in + image/*) + ln -sf "${true_background_location}" "${background_location}" && + [ -z "${silent}" ] && + notify-send -i "${background_location}" "Changing wallpaper ..." + ;; + inode/directory) + link=$(find "${true_background_location}" -iregex '.*.\(jpg\|jpeg\|png\|gif\)' -type f | shuf -n 1) + + ln -sf "${link}" "${background_location}" && [ -z "${silent}" ] && notify-send -i "${background_location}" "Random wallpaper chosen." + ;; + *) + [ -z "${silent}" ] && + notify-send "Error" "Invalid image or directory found." + + exit 1 + ;; + esac + +if command -v wal >/dev/null 2>&1; then + link=$(readlink -f "${background_location}") + + wal -n -i "${link}" -o "${XDG_CONFIG_HOME:-${HOME}/.config}/wal/postrun" >/dev/null 2>&1 +else + [ -f "${dunst_configuration_file}.bak" ] && + unlink "${dunst_configuration_file}" && + mv "${dunst_configuration_file}.bak" "${dunst_configuration_file}" + + [ -f "${zathura_configuration_file}.bak" ] && + unlink "${zathura_configuration_file}" && + mv "${zathura_configuration_file}.bak" "${zathura_configuration_file}" +fi + +case "$(loginctl show-session 1 -p Type)" in +*"wayland") + hyprpaper_configuration_file="${HOME}/.config/hypr/hyprpaper.conf" + + cp "${HOME}/.cache/wal/colors-waybar.css" "${HOME}/.config/waybar/colors-waybar.css" + cp "${hyprpaper_configuration_file}" "${hyprpaper_configuration_file}.bak" + + if pidof hyprpaper >/dev/null; then + awk -v newpath="${true_background_location}" ' +BEGIN { FS = OFS = "=" } +/^preload/ { + $2 = " " newpath +} +/^wallpaper/ { + split($2, a, ","); + $2 = a[1] "," newpath +} +{ print } +' "${hyprpaper_configuration_file}.bak" >"${hyprpaper_configuration_file}" + killall -9 hyprpaper >/dev/null + hyprpaper >/dev/null & + elif pidof swww-daemon >/dev/null; then + swww img "${true_background_location}" & + fi + ;; +*) + xwallpaper --zoom "${background_location}" + pidof sei >/dev/null && xdotool key super+F5 + ;; +esac diff --git a/home/ebisu/meta/scripts/scripts/shiori b/home/ebisu/meta/scripts/scripts/shiori new file mode 100755 index 0000000..5f825e7 --- /dev/null +++ b/home/ebisu/meta/scripts/scripts/shiori @@ -0,0 +1,49 @@ +# Random ASCII art + +# https://zh.moegirl.org.cn/Shift_JIS%E8%89%BA%E6%9C%AF +art=() + +# http://aa.en.utf8art.com/node/52/txtcaa +read -r -d '' art['0'] <<EOF + / ̄ヽ + / ヽ / r'il +. / ハ/ ハlヽ、 + _/ /´ /\`ーイヽ ヽ ヽ + { _/// 斗‐ト l‐十-、', i +  ̄ l l |´f iヽ |ィTヽ、 .l l + lハ. |.hj ` ヒ_リ iヽ! .l あけおめ + ヽト、" ' _, ""ノ l l + l >r,、┐.l l l + l l 〈〉V l ハ l + _ ヽ.l 〈o'7 l/ l l + ll ヽ. l ll l、 \l + ll 〉、_i⌒iiヽ_ll_∠´ \/"゙ミ; + ll _l_l_ll l/ヽ_| r/'ゞ, ン +  ̄ }_{ l / `´ + l_jl_ノ´ +EOF + +read -r -d '' art['1'] <<EOF + ,. -‐- 、 + / _...._ i + ,.-- 、 , ´/.::::::..゙i ,' + / .: ヽ ._p_ / ,.'..:::::::::::,.'/ + ! ヾ 、 丶 (::::::) ,' /..:::::::::::/ + l l::..ヽ γ''' ̄ ̄'''ヽ/ ,':::::::::./ + | l:::::::..ヽ |_____| l.';.::, '/ + ! lヽ::::::;.:.〉: : : :.:.:.:|: : : :'‐'"<_ + ! / ゙7 /: :.,イ: :./|:.!: \: .: : : : :<⌒ヽ + ! /: :/: :./___/ !: / .|:.|l: .:__ヽ: :.\:.:ヽ\ \ + `‐'"イ: :/: :./´:./` |/ |:.||ヽ: :`ヽ: : :.ヽ: :} \{ + /: :.': :.:i: :./ | Ⅵ \: :|: : : :.∨ / +. ': : { : : |:./ ,_ _, ヽ!:.:: :.|:.:|ィ´ + |: :/|: : :|イ ィ=ミ ィ=ミ } : : ト、!:| + |;イ: ! :./\`| ム : : |:/: | あけまして + |:|.:V:l\`ri^ixx 、__, xxrvィヘ : |: : :| + |:|: : :l: :〉、\`ー-、 .___ ,.-‐' /:.:.:V: : : | + |:|: : :l:/ `ァ 〉r‐┤ r‐':./}:!: : : :| + |:|: : :l{. / /:.:l ./| |: :/ |:l:.:. :.:.| + |:|: : :l| / ∧:.:|/:.l |:/ .!:l: : :.:.| +EOF + +echo "\`\`\`${art[$((RANDOM % ${#art[@]}))]}\`\`\`" | glow diff --git a/home/ebisu/meta/scripts/scripts/skyla b/home/ebisu/meta/scripts/scripts/skyla new file mode 100755 index 0000000..a0d9030 --- /dev/null +++ b/home/ebisu/meta/scripts/scripts/skyla @@ -0,0 +1,53 @@ +# yt-dlp wrapper for Crunchyroll + +if [[ "$2" = "dl" ]]; then + START=$(date +%s) + + yt-dlp \ + --all-subs \ + --cookies-from-browser firefox \ + --embed-subs \ + --external-downloader=aria2c \ + --external-downloader-args \ + '--min-split-size=1M --max-connection-per-server=16 --max-concurrent-downloads=16 --split=16' \ + -f 'best[height=1080]' \ + --remux mkv \ + --merge mkv \ + --verbose \ + --user-agent "Mozilla/5.0 (X11; Linux x86_64; rv:10.0) Gecko/20100101 Firefox/10.0" \ + "${1}" + + printf "\ntook %s seconds\n" $(($(date +%s || true) - START)) +else + # mpv "$(yt-dlp \ + # --cookies-from-browser firefox \ + # --extractor-args crunchyrollbeta:hardsub=en-US \ + # -f 'best[height=1080]' \ + # -g \ + # --verbose \ + # "${1}")" + + yt-dlp \ + --cookies-from-browser firefox \ + --no-download \ + -o /tmp/skyla_subtitles \ + --sub-lang en-US \ + --write-subs \ + --user-agent "Mozilla/5.0 (X11; Linux x86_64; rv:10.0) Gecko/20100101 Firefox/10.0" \ + "${1}" + + if [[ "$2" = "fix" ]]; then + sed -i 's/{an\d*}//g' /tmp/skyla_subtitles.*.ass + fi + + mplayer \ + -sub /tmp/skyla_subtitles.*.ass \ + "$(yt-dlp \ + --cookies-from-browser firefox \ + -f 'best[height=1080]' \ + -g \ + --user-agent "Mozilla/5.0 (X11; Linux x86_64; rv:10.0) Gecko/20100101 Firefox/10.0" \ + "${1}")" + + rm /tmp/skyla_subtitles.*.ass +fi diff --git a/home/ebisu/meta/scripts/scripts/start-vm b/home/ebisu/meta/scripts/scripts/start-vm new file mode 100755 index 0000000..df372c1 --- /dev/null +++ b/home/ebisu/meta/scripts/scripts/start-vm @@ -0,0 +1,21 @@ +# Virtual machine start script + +# ref: https://askubuntu.com/questions/425754/how-do-i-run-a-sudo-command-inside-a-script +USER_ID=$(id -u) + +# ref: https://askubuntu.com/a/30157/8698 +if ! [[ ${USER_ID} = 0 ]]; then + echo "The script need to be run as root. >:)" >&2 + + exit 1 +fi + +# if [ "${SUDO_USER}" ]; then +# real_user=$SUDO_USER +# else +# real_user=$(whoami) +# fi + +systemctl start libvirtd >/dev/null && echo "libvirtd started" + +virsh net-start default >/dev/null && echo "default network started" diff --git a/home/ebisu/meta/scripts/scripts/tup-init b/home/ebisu/meta/scripts/scripts/tup-init new file mode 100644 index 0000000..387fa53 --- /dev/null +++ b/home/ebisu/meta/scripts/scripts/tup-init @@ -0,0 +1,25 @@ +tup init >/dev/null + +cat <<EOF >Tupfile +# Input & Output Directories +SOURCE_DIRECTORY = . +INCLUDE_DIRECTORY = . +BUILD_DIRECTORY = build + +# Compiler Configuration +CC = clang++ +CC_EXTENSION = cc +CC_FLAGS = -std=c++23 -I \$(INCLUDE_DIRECTORY) -Weverything -Wno-padded -Wno-c++98-compat -MMD -Wno-c++98-compat-pedantic + +# Clang-tidy Configuration +CLANG_TIDY_CHECKS = '-*,bugprone-*,clang-analyzer-*,concurrency-*,cppcoreguildelines-*,llvm-*,misc-*,modernize-*,performance-*,portability-*,readability-*,-readability-magic-numbers,-llvm-header-guard,-bugprone-suspicious-include,-readability-function-cognitive-complexity,-bugprone-exception-escape' +CLANG_TIDY_FLAGS = -checks=\$(CLANG_TIDY_CHECKS) -warnings-as-errors=* -quiet + +NAME = $(basename "$(pwd)") + +: foreach \$(SOURCE_DIRECTORY)/*.\$(CC_EXTENSION) \$(INCLUDE_DIRECTORY)/*.hh |> clang-format -i %f |> +: foreach \$(SOURCE_DIRECTORY)/*.\$(CC_EXTENSION) |> clang-tidy \$(CLANG_TIDY_FLAGS) %f -- \$(CC_FLAGS) |> +: foreach \$(SOURCE_DIRECTORY)/*.\$(CC_EXTENSION) |> ^j^ \$(CC) \$(CC_FLAGS) -MF \$(BUILD_DIRECTORY)/%B.d -c %f -o %o |> \$(BUILD_DIRECTORY)/%B.o | \$(BUILD_DIRECTORY)/%B.d +: \$(BUILD_DIRECTORY)/*.o ^test.o |> \$(CC) %f -o %o |> \$(BUILD_DIRECTORY)/\$(NAME) +: \$(BUILD_DIRECTORY)/*.o ^main.o |> \$(CC) %f -o %o |> \$(BUILD_DIRECTORY)/\$(NAME)_test +EOF diff --git a/home/ebisu/meta/scripts/scripts/vivwal b/home/ebisu/meta/scripts/scripts/vivwal new file mode 100755 index 0000000..995359e --- /dev/null +++ b/home/ebisu/meta/scripts/scripts/vivwal @@ -0,0 +1,59 @@ +# Sets Vivaldi's theme colors to those generated by Wal. +# Source: https://forum.vivaldi.net/topic/34521/linux-changing-theme-via-command-line/22?_=1597433612704 +# Author: Vivaldi Forum user Wismut + +logfile=~/.log/vivwal.log + +text_color="#eeeeee" +if [[ "$1" && "$1" == "-l" ]]; then + text_color="#111111" +fi + +# Source Wal colors (replace this path with the path where the colors generated by wal are stored) +source ~/.cache/wal/colors.sh + +# testing if vivaldi is running +PROCESS1=vivaldi +PROCESS2=crconsole +PIDS_Vivaldi=$(ps cax | grep $PROCESS1 | grep -o '^[ ]*[0-9]*') +PIDS_crconsole=$(ps cax | grep $PROCESS2 | grep -o '^[ ]*[0-9]*') +if [ -z "$PIDS_Vivaldi" ]; then + # Vivaldi is not running + if [ -z "$PIDS_crconsole" ]; then + echo "All is fine. Neither Vivaldi nor crconsole are running." 1>&2 + else + # kill crconsole + pkill -f "node /usr/bin/crconsole" + fi +else + # Vivaldi is running + # let's start using crconsole + # find all open tabs + tablist=$( + echo .tabs | crconsole & + sleep 1 + pkill -f "node /usr/bin/crconsole" + ) + # read each tab + while read -r line; do + echo "... $line ..." + # find /browser.html tab + if [[ $line == *"/browser.html"* ]]; then + tabnumber=$(echo "$line" | grep -o '[0-9]\+') + # change Vivaldi accent background colors + var=$( + ( + echo ".switch $tabnumber" + sleep 1 + echo "chrome.storage.local.set({'BROWSER_COLOR_BG':'$background', 'BROWSER_COLOR_FG':'$text_color', 'BROWSER_COLOR_ACCENT_BG':'$color5', 'BROWSER_COLOR_HIGHLIGHT_BG':'$color1'})" + ) | crconsole & + sleep 1 + pkill -f "node /usr/bin/crconsole" + ) + echo "$var" >$logfile + fi + done <<<"$tablist" + sleep 1 + pkill -f "node /usr/bin/crconsole" +fi +exit diff --git a/home/ebisu/meta/scripts/scripts/wal_mako b/home/ebisu/meta/scripts/scripts/wal_mako new file mode 100755 index 0000000..5cf4b1f --- /dev/null +++ b/home/ebisu/meta/scripts/scripts/wal_mako @@ -0,0 +1,45 @@ +# Mako colourscheme setter for use with pywal + +MAKO_CTL="/usr/bin/makoctl" +MAKO_CONFIG="${HOME}/.config/mako/config" +MAKO_CONFIG_TEMPLATE="${MAKO_CONFIG}.template" +WAL_COLOURS="${HOME}/.cache/wal/colors" + +cp "${MAKO_CONFIG_TEMPLATE}" "${MAKO_CONFIG}" + +colour_iteration=0 + +while IFS= read -r line; do + eval "COLOR${colour_iteration}=\"${line}\"" + + colour_iteration=$((colour_iteration + 1)) +done <"${WAL_COLOURS}" + +unset colour_iteration + +cat <<EOF >>"${MAKO_CONFIG}" +background-color=${COLOR0} +text-color=${COLOR15} + +# [urgency=low] +# border-color=${COLOR2} +# background-color=${COLOR4} +# text-color=${COLOR6} + +# [urgency=normal] +# border-color=${COLOR1} +# background-color=${COLOR3} +# text-color=${COLOR5} +# default-timeout=10000 +# ignore-timeout=1 + +# [urgency=high] +# font=Sauce Code Pro 16 +# border-color=${COLOR1} +# background-color=${COLOR2} +# text-color=${COLOR6} +# default-timeout=0 +# ignore-timeout=1 +EOF + +${MAKO_CTL} reload diff --git a/home/ebisu/meta/scripts/scripts/worlds b/home/ebisu/meta/scripts/scripts/worlds new file mode 100755 index 0000000..834079a --- /dev/null +++ b/home/ebisu/meta/scripts/scripts/worlds @@ -0,0 +1,15 @@ +# WorldsPlayer runner for use in Bottles + +NAMESPACE=worlds + +# kitty -e doas termshark -i worlds_vo & +wireshark -k -i "${NAMESPACE}_vo" & + +doas runnet \ + --publish-all-ports \ + --user=fuwn \ + --netns=${NAMESPACE} \ + --internet \ + bottles-cli run \ + -p WorldsPlayer \ + -b 'WorldsPlayer' diff --git a/home/ebisu/meta/steam/default.nix b/home/ebisu/meta/steam/default.nix new file mode 100644 index 0000000..c358a60 --- /dev/null +++ b/home/ebisu/meta/steam/default.nix @@ -0,0 +1,7 @@ +{ pkgs, ... }: { + home.packages = with pkgs; [ + steam-tui + ]; + + # programs.steam.enable = true; +} diff --git a/home/ebisu/meta/system/bitwarden/default.nix b/home/ebisu/meta/system/bitwarden/default.nix new file mode 100644 index 0000000..2ac188f --- /dev/null +++ b/home/ebisu/meta/system/bitwarden/default.nix @@ -0,0 +1,7 @@ +{ pkgs, ... }: { + home.packages = with pkgs; [ + bitwarden-desktop + # bitwarden-cli + # bitwarden-menu + ]; +} diff --git a/home/ebisu/meta/system/default.nix b/home/ebisu/meta/system/default.nix new file mode 100644 index 0000000..25b26b3 --- /dev/null +++ b/home/ebisu/meta/system/default.nix @@ -0,0 +1,23 @@ +{ pkgs, ... }: +{ + imports = [ + ./bitwarden + ./fonts + ./opengl + ./peripheral + ./shell + ./terminal + ./virtualisation + ]; + + home.packages = with pkgs; [ + # bpftrace + xdg-utils + ]; + + # services.ananicy = { + # enable = true; + # package = pkgs.ananicy-cpp; + # rulesProvider = pkgs.ananicy-rules-cachyos; + # }; +} diff --git a/home/ebisu/meta/system/fonts/default.nix b/home/ebisu/meta/system/fonts/default.nix new file mode 100644 index 0000000..ffc6f89 --- /dev/null +++ b/home/ebisu/meta/system/fonts/default.nix @@ -0,0 +1,54 @@ +{ pkgs, ... }: +{ + imports = [ ./meowsans ]; + + fonts = { + fontconfig = { + enable = true; + + defaultFonts = { + serif = [ + "New York Medium" + "Hiragino Sans" + "JoyPixels" + "Noto Color Emoji" + "FontAwesome" + ]; + + sansSerif = [ + "SF Pro Text" + "Hiragino Sans" + "JoyPixels" + "Noto Color Emoji" + "FontAwesome" + ]; + + monospace = [ + "SF Mono" + "Hiragino Sans" + "JoyPixels" + "FontAwesome" + "Braille" + ]; + }; + }; + }; + + home.packages = with pkgs; [ + source-code-pro + source-han-sans + noto-fonts + noto-fonts-cjk-sans + noto-fonts-cjk-serif + noto-fonts-color-emoji + lmodern + hanazono + jigmo + iosevka + libertine + sarasa-gothic + nerdfonts + cantarell-fonts + inter + ]; +} diff --git a/home/ebisu/meta/system/fonts/meowsans/MeowSans_Font/MeowSans-Regular.ttf b/home/ebisu/meta/system/fonts/meowsans/MeowSans_Font/MeowSans-Regular.ttf Binary files differnew file mode 100644 index 0000000..0d12d34 --- /dev/null +++ b/home/ebisu/meta/system/fonts/meowsans/MeowSans_Font/MeowSans-Regular.ttf diff --git a/home/ebisu/meta/system/fonts/meowsans/MeowSans_Font/MeowSans.ttf b/home/ebisu/meta/system/fonts/meowsans/MeowSans_Font/MeowSans.ttf Binary files differnew file mode 100644 index 0000000..8bb6c1a --- /dev/null +++ b/home/ebisu/meta/system/fonts/meowsans/MeowSans_Font/MeowSans.ttf diff --git a/home/ebisu/meta/system/fonts/meowsans/default.nix b/home/ebisu/meta/system/fonts/meowsans/default.nix new file mode 100644 index 0000000..9b5a4f1 --- /dev/null +++ b/home/ebisu/meta/system/fonts/meowsans/default.nix @@ -0,0 +1,4 @@ +{ pkgs, ... }: +{ + home.file.".local/share/fonts/MeowSans_Font ".source = ./MeowSans_Font; +} diff --git a/home/ebisu/meta/system/opengl/default.nix b/home/ebisu/meta/system/opengl/default.nix new file mode 100644 index 0000000..cabb8f9 --- /dev/null +++ b/home/ebisu/meta/system/opengl/default.nix @@ -0,0 +1,23 @@ +{ pkgs +, config +, inputs +, ... +}: +let + nixGLIntel = inputs.nixGL.packages.${pkgs.system}.nixGLIntel; +in +{ + imports = [ + (builtins.fetchurl { + url = "https://raw.githubusercontent.com/nix-community/home-manager/5e59fe27d938a8c2d5e215f64f5d937c2f863fed/modules/misc/nixgl.nix"; + sha256 = "74f9fb98f22581eaca2e3c518a0a3d6198249fb1490ab4a08f33ec47827e85db"; + }) + ]; + + # Ref. https://github.com/nix-community/home-manager/issues/3968 + nixGL.prefix = "${nixGLIntel}/bin/nixGLIntel"; + + home.packages = [ + nixGLIntel + ]; +} diff --git a/home/ebisu/meta/system/peripheral/default.nix b/home/ebisu/meta/system/peripheral/default.nix new file mode 100644 index 0000000..f05379c --- /dev/null +++ b/home/ebisu/meta/system/peripheral/default.nix @@ -0,0 +1,6 @@ +{ pkgs, ... }: { + home.packages = with pkgs; [ + # openrgb + solaar + ]; +} diff --git a/home/ebisu/meta/system/shell/default.nix b/home/ebisu/meta/system/shell/default.nix new file mode 100644 index 0000000..2ee83d1 --- /dev/null +++ b/home/ebisu/meta/system/shell/default.nix @@ -0,0 +1,21 @@ +{ pkgs, ... }: +{ + imports = [ + ./fish + ./starship + ./scripting + ]; + + home.packages = with pkgs; [ + asciinema + navi + shellclear + watchexec + zoxide + shellcheck + termius + dash + mosh + killall + ]; +} diff --git a/home/ebisu/meta/system/shell/fish/default.nix b/home/ebisu/meta/system/shell/fish/default.nix new file mode 100644 index 0000000..55f441d --- /dev/null +++ b/home/ebisu/meta/system/shell/fish/default.nix @@ -0,0 +1,149 @@ +{ pkgs, ... }: { + programs.fish = { + enable = true; + + shellInit = '' + if status is-interactive + set fish_greeting + + fish_vi_key_bindings + + function fish_postexec --on-event fish_postexec + if test "$argv" != "clear" + echo + end + end + + function vpn + env BIND_INTERFACE=wgpia0 LD_PRELOAD=/usr/lib/bindToInterface.so $argv + end + end + + set -l config_home (set -q XDG_CONFIG_HOME; and echo $XDG_CONFIG_HOME; or echo $HOME/.config) + + set HISTSIZE -1 + set HISTFILESIZE -1 + set SAVEHIST -1 + + source "$config_home/shell/profile" + bass source "~/.nix-profile/etc/profile.d/hm-session-vars.sh" + + bind \ce edit_command_buffer + + zoxide init fish | source + + cat ~/.cache/wal/sequences + + starship init fish | source + ''; + + plugins = [ + { + name = "fzf.fish"; + + src = pkgs.fetchFromGitHub { + owner = "patrickf1"; + repo = "fzf.fish"; + rev = "8920367cf85eee5218cc25a11e209d46e2591e7a"; + sha256 = "sha256-T8KYLA/r/gOKvAivKRoeqIwE2pINlxFQtZJHpOy9GMM="; + }; + } + { + name = "bass"; + + src = pkgs.fetchFromGitHub { + owner = "edc"; + repo = "bass"; + rev = "79b62958ecf4e87334f24d6743e5766475bcf4d0"; + sha256 = "sha256-3d/qL+hovNA4VMWZ0n1L+dSM1lcz7P5CQJyy+/8exTc="; + }; + } + { + name = "nvm.fish"; + + src = pkgs.fetchFromGitHub { + owner = "jorgebucaran"; + repo = "nvm.fish"; + rev = "b8edb1ee24cbbf7259196b0cb3c6c4ab65b07929"; + sha256 = "sha256-7JxIQSseBv81SSpWH1pufx8fh9EQhbo3r2nVVREwc58="; + }; + } + { + name = "sponge"; + + src = pkgs.fetchFromGitHub { + owner = "meaningful-ooo"; + repo = "sponge"; + rev = "384299545104d5256648cee9d8b117aaa9a6d7be"; + sha256 = "sha256-MdcZUDRtNJdiyo2l9o5ma7nAX84xEJbGFhAVhK+Zm1w="; + }; + } + { + name = "autopair.fish"; + + src = pkgs.fetchFromGitHub { + owner = "jorgebucaran"; + repo = "autopair.fish"; + rev = "4d1752ff5b39819ab58d7337c69220342e9de0e2"; + sha256 = "sha256-qt3t1iKRRNuiLWiVoiAYOu+9E7jsyECyIqZJ/oRIT1A="; + }; + } + ]; + + shellAliases = { + # Verbosity + cp = "cp -iv"; + mv = "mv -iv"; + # rm = "rm -vI"; + bc = "bc -ql"; + rsync = "rsync -vrPlu"; + mkd = "mkdir -pv"; + yt = "yt-dlp --embed-metadata -i"; + yta = "yt -x -f bestaudio/best"; + ytt = "yt --skip-download --write-thumbnail"; + ffmpeg = "ffmpeg -hide_banner"; + wdic = "wdic --homophones --kanji --color --pager"; + hakuneko = "hakuneko-desktop --no-sandbox"; + fastfetch = "clear && /usr/bin/env fastfetch"; + + # Modern Alternatives & Alias Rewrites + sxiv = "nsxiv"; + unzip = "ripunzip unzip-file"; + nvim = "lvim"; + vim = "lvim"; + vimdiff = "lvim -d"; + rm = "rip"; + + # Colourise + ls = "exa -h --no-quotes --color=auto --group-directories-first"; + grep = "grep --color=auto"; + diff = "diff --color=auto"; + ccat = "highlight --out-format=ansi"; + ip = "ip -color=auto"; + + # Abbreviations + ka = "killall"; + g = "git"; + sdn = "shutdown -h now"; + e = "$EDITOR"; + v = "$EDITOR"; + ff = "fastfetch"; + + # Other + pacbins = "comm -23 <(yay -Qqett | sort) <(yay -Qqg base -g base-devel | sort | uniq)"; + chan = "chan-downloader -c 10"; + taiga = "bottles-cli run -b Taiga -p Taiga"; + rotd = "systemctl --user restart opentabledriver.service"; + ks = "kaguya stream --user-agent 'Mozilla/5.0 (X11; Linux x86_64; rv:120.0) Gecko/20100101 Firefox/120.0'"; + def = "myougiden"; + suzuri = "SUZURI_MINIMAL=1 SUZURI_REVERSE=1 ~/Documents/Code/Git/Fuwn/suzuri/suzuri"; + "5ch" = "html2md -i 'https://ff5ch.syoboi.jp/' -s section | glow"; + shinobu = "curl --silent https://shinobu.fuwn.workers.dev/shinobu -o /tmp/shinobu && nsxiv /tmp/shinobu"; + auto_subtitle = "source $HOME/Documents/Code/Git/Random/auto-subtitle/venv/bin/activate && auto_subtitle --model medium --task translate --srt_only True"; + steamy = "mangohud gamemoderun steam-runtime"; + koix = "koi -f"; + seamonkey = "$HOME/.local/src/seamonkey/seamonkey-bin"; + doom = "$HOME/.config/emacs/bin/doom"; + }; + }; +} diff --git a/home/ebisu/meta/system/shell/scripting/charmbracelet/default.nix b/home/ebisu/meta/system/shell/scripting/charmbracelet/default.nix new file mode 100644 index 0000000..e3b78df --- /dev/null +++ b/home/ebisu/meta/system/shell/scripting/charmbracelet/default.nix @@ -0,0 +1,6 @@ +{ pkgs, ... }: { + home.packages = with pkgs; [ + gum + mods + ]; +} diff --git a/home/ebisu/meta/system/shell/scripting/default.nix b/home/ebisu/meta/system/shell/scripting/default.nix new file mode 100644 index 0000000..2fe33df --- /dev/null +++ b/home/ebisu/meta/system/shell/scripting/default.nix @@ -0,0 +1,18 @@ +{ pkgs, ... }: { + imports = [ + ./charmbracelet + ./ripgrep + ]; + + programs.fzf.enable = true; + + home.packages = with pkgs; [ + mdcat + moreutils + pup + inxi + pv + yad + jq + ]; +} diff --git a/home/ebisu/meta/system/shell/scripting/ripgrep/default.nix b/home/ebisu/meta/system/shell/scripting/ripgrep/default.nix new file mode 100644 index 0000000..00de07f --- /dev/null +++ b/home/ebisu/meta/system/shell/scripting/ripgrep/default.nix @@ -0,0 +1,7 @@ +{ pkgs, ... }: { + programs.ripgrep.enable = true; + + home.packages = with pkgs; [ + ripgrep-all + ]; +} diff --git a/home/ebisu/meta/system/shell/starship/default.nix b/home/ebisu/meta/system/shell/starship/default.nix new file mode 100644 index 0000000..0088038 --- /dev/null +++ b/home/ebisu/meta/system/shell/starship/default.nix @@ -0,0 +1,305 @@ +{ pkgs, ... }: { + home.packages = with pkgs; [ + starship + ]; + + programs.starship = { + enable = true; + enableFishIntegration = true; + + # I CBA to update the formatting to match the rest of the expressions, since + # this is a one-off that I tend to import over directly from starship. + settings = { + format = "[term%](bold green) "; + right_format = "$character$all"; + add_newline = false; + + line_break = { + disabled = true; + }; + + character = { + success_symbol = "[i](bold green)"; + error_symbol = "[x](bold red)"; + vimcmd_symbol = "[n](bold green)"; + vimcmd_visual_symbol = "[v](bold green)"; + vimcmd_replace_symbol = "[R](bold green)"; + vimcmd_replace_one_symbol = "[r](bold green)"; + }; + + git_commit = { + tag_symbol = " tag "; + }; + + git_status = { + ahead = ">"; + behind = "<"; + diverged = "<>"; + renamed = "r"; + deleted = "x"; + }; + + aws = { + symbol = "aws "; + }; + + azure = { + symbol = "az "; + }; + + bun = { + symbol = "bun "; + }; + + c = { + symbol = "C "; + }; + + cobol = { + symbol = "cobol "; + }; + + conda = { + symbol = "conda "; + }; + + crystal = { + symbol = "cr "; + }; + + cmake = { + symbol = "cmake "; + }; + + daml = { + symbol = "daml "; + }; + + dart = { + symbol = "dart "; + }; + + deno = { + symbol = "deno "; + }; + + dotnet = { + symbol = ".NET "; + }; + + directory = { + read_only = " ro"; + }; + + docker_context = { + symbol = "docker "; + }; + + elixir = { + symbol = "exs "; + }; + + elm = { + symbol = "elm "; + }; + + fennel = { + symbol = "fnl "; + }; + + fossil_branch = { + symbol = "fossil "; + }; + + gcloud = { + symbol = "gcp "; + }; + + git_branch = { + symbol = "git "; + }; + + golang = { + symbol = "go "; + }; + + gradle = { + symbol = "gradle "; + }; + + guix_shell = { + symbol = "guix "; + }; + + hg_branch = { + symbol = "hg "; + }; + + java = { + symbol = "java "; + }; + + julia = { + symbol = "jl "; + }; + + kotlin = { + symbol = "kt "; + }; + + lua = { + symbol = "lua "; + }; + + nodejs = { + symbol = "nodejs "; + }; + + memory_usage = { + symbol = "memory "; + }; + + meson = { + symbol = "meson "; + }; + + nim = { + symbol = "nim "; + }; + + nix_shell = { + symbol = "nix "; + }; + + ocaml = { + symbol = "ml "; + }; + + opa = { + symbol = "opa "; + }; + + os = { + symbols = { + Alpaquita = "alq "; + Alpine = "alp "; + Amazon = "amz "; + Android = "andr "; + Arch = "rch "; + Artix = "atx "; + CentOS = "cent "; + Debian = "deb "; + DragonFly = "dfbsd "; + Emscripten = "emsc "; + EndeavourOS = "ndev "; + Fedora = "fed "; + FreeBSD = "fbsd "; + Garuda = "garu "; + Gentoo = "gent "; + HardenedBSD = "hbsd "; + Illumos = "lum "; + Linux = "lnx "; + Mabox = "mbox "; + Macos = "mac "; + Manjaro = "mjo "; + Mariner = "mrn "; + MidnightBSD = "mid "; + Mint = "mint "; + NetBSD = "nbsd "; + NixOS = "nix "; + OpenBSD = "obsd "; + OpenCloudOS = "ocos "; + openEuler = "oeul "; + openSUSE = "osuse "; + OracleLinux = "orac "; + Pop = "pop "; + Raspbian = "rasp "; + Redhat = "rhl "; + RedHatEnterprise = "rhel "; + Redox = "redox "; + Solus = "sol "; + SUSE = "suse "; + Ubuntu = "ubnt "; + Unknown = "unk "; + Windows = "win "; + }; + }; + + package = { + symbol = "pkg "; + }; + + perl = { + symbol = "pl "; + }; + + php = { + symbol = "php "; + }; + + pijul_channel = { + symbol = "pijul "; + }; + + pulumi = { + symbol = "pulumi "; + }; + + purescript = { + symbol = "purs "; + }; + + python = { + symbol = "py "; + }; + + raku = { + symbol = "raku "; + }; + + ruby = { + symbol = "rb "; + }; + + rust = { + symbol = "rs "; + }; + + scala = { + symbol = "scala "; + }; + + spack = { + symbol = "spack "; + }; + + solidity = { + symbol = "solidity "; + }; + + status = { + symbol = "[x](bold red) "; + }; + + sudo = { + symbol = "sudo "; + }; + + swift = { + symbol = "swift "; + }; + + typst = { + symbol = "typst "; + }; + + terraform = { + symbol = "terraform "; + }; + + zig = { + symbol = "zig "; + }; + }; + }; +} diff --git a/home/ebisu/meta/system/terminal/default.nix b/home/ebisu/meta/system/terminal/default.nix new file mode 100644 index 0000000..6375e0a --- /dev/null +++ b/home/ebisu/meta/system/terminal/default.nix @@ -0,0 +1,11 @@ +{ pkgs, ... }: { + imports = [ + ./kitty + ./foot + ]; + + home.packages = with pkgs; [ + cool-retro-term + # warp-terminal + ]; +} diff --git a/home/ebisu/meta/system/terminal/foot/default.nix b/home/ebisu/meta/system/terminal/foot/default.nix new file mode 100644 index 0000000..ed0820b --- /dev/null +++ b/home/ebisu/meta/system/terminal/foot/default.nix @@ -0,0 +1,49 @@ +{ pkgs, ... }: { + programs.foot = { + enable = true; + + settings = { + main = { + font = "SF Mono:size=12"; + font-bold = "SF Mono:size=12:weight=medium"; + font-italic = "SF Mono:size=12:slant=italic"; + font-bold-italic = "SF Mono:size=12:slant=italic:weight=medium"; + + # Font Fine-tuning + # vertical-letter-offset = -1; + # line-height = 13; + # underline-thickness = 0.6; + # underline-offset = 2; + + # Styling + bold-text-in-bright = "palette-based"; + pad = "15x15"; # "24x24" + + # Misc. + resize-delay-ms = "0"; + term = "xterm"; + # locked-title = "yes"; + selection-target = "both"; + # workers = "0"; + # utmp-helper = "none"; + }; + + url.osc8-underline = "always"; + bell.urgent = "yes"; + # scrollback.lines = "1000"; + mouse.hide-when-typing = "yes"; + key-bindings.clipboard-paste = "Control+v Control+Shift+v"; + + tweak = { + scaling-filter = "none"; + # font-monospace-warn = "no"; + # grapheme-width-method = "wcswidth"; + # grapheme-shaping = "no"; + }; + + colors = { + alpha = "0.8"; + }; + }; + }; +} diff --git a/home/ebisu/meta/system/terminal/kitty/default.nix b/home/ebisu/meta/system/terminal/kitty/default.nix new file mode 100644 index 0000000..4346e8d --- /dev/null +++ b/home/ebisu/meta/system/terminal/kitty/default.nix @@ -0,0 +1,113 @@ +{ pkgs, config, ... }: +{ + programs.kitty = { + enable = true; + + settings = { + # Font + # MesloLGS NF + font_family = "SF Mono Light"; + bold_font = "SF Mono Medium"; + italic_font = "SF Mono Light Italic"; + bold_italic_font = "SF Mono Medium Italic"; + font_size = 12; # 13.5 + + # Optimisation + resize_debounce_time = 0; + sync_to_monitor = true; + repaint_delay = 0; + input_delay = 0; + + # Style + background_opacity = "0.8"; + window_border_width = 0; + window_margin_width = 15; + hide_window_decorations = "titlebar-only"; + include = "~/.cache/wal/colors-kitty.conf"; + + # Cursor + cursor_blink_interval = 0; # 0.5 + cursor_stop_blinking_after = 0; # 15 + + # Other + scrollback_pager = "less +G -R"; + wheel_scroll_multiplier = 5; + click_interval = "0.5"; + select_by_word_characters = ":@-./_~?&=%+#"; + mouse_hide_wait = 0; + enabled_layouts = "*"; + remember_window_size = false; + macos_option_as_alt = false; + allow_remote_control = true; + confirm_os_window_close = 0; + term = "xterm-kitty"; + + # Bell + visual_bell_duration = 0; + enable_audio_bell = false; + + # URL Handling + open_url_modifiers = "ctrl+shift"; + open_url_with = "default"; + }; + + extraConfig = '' + # Clipboard + map super+v paste_from_clipboard + map ctrl+shift+s paste_from_selection + map super+c copy_to_clipboard + map shift+insert paste_from_selection + + # Scrolling + map ctrl+shift+up scroll_line_up + map ctrl+shift+down scroll_line_down + map ctrl+shift+k scroll_line_up + map ctrl+shift+j scroll_line_down + map ctrl+shift+page_up scroll_page_up + map ctrl+shift+page_down scroll_page_down + map ctrl+shift+home scroll_home + map ctrl+shift+end scroll_end + map ctrl+shift+h show_scrollback + + # Window management + map super+n new_os_window + map super+w close_window + map ctrl+shift+enter new_window + map ctrl+shift+] next_window + map ctrl+shift+[ previous_window + map ctrl+shift+f move_window_forward + map ctrl+shift+b move_window_backward + map ctrl+shift+` move_window_to_top + map ctrl+shift+1 first_window + map ctrl+shift+2 second_window + map ctrl+shift+3 third_window + map ctrl+shift+4 fourth_window + map ctrl+shift+5 fifth_window + map ctrl+shift+6 sixth_window + map ctrl+shift+7 seventh_window + map ctrl+shift+8 eighth_window + map ctrl+shift+9 ninth_window + map ctrl+shift+0 tenth_window + + # Tab management + map ctrl+shift+right next_tab + map ctrl+shift+left previous_tab + map ctrl+shift+t new_tab + map ctrl+shift+q close_tab + map ctrl+shift+l next_layout + map ctrl+shift+. move_tab_forward + map ctrl+shift+, move_tab_backward + + # Miscellaneous + map ctrl+shift+up increase_font_size + map ctrl+shift+down decrease_font_size + map ctrl+shift+backspace restore_font_size + + map ctrl+/ launch --allow-remote-control kitty +kitten kitty_search/search.py @active-kitty-window-id + ''; + }; + + # read the file, but remove the line with shell_integration + # xdg.configFile."kitty/kitty.conf".text = + # builtins.map (line: if builtins.match "shell_integration" line then "" else line) (builtins.split "\n" (builtins.readFile ~/.config/kitty/kitty.conf)); +} diff --git a/home/ebisu/meta/system/virtualisation/default.nix b/home/ebisu/meta/system/virtualisation/default.nix new file mode 100644 index 0000000..d99c7eb --- /dev/null +++ b/home/ebisu/meta/system/virtualisation/default.nix @@ -0,0 +1,11 @@ +{ pkgs, ... }: { + imports = [ + ./docker + ]; + + home.packages = with pkgs; [ + bottles + valgrind + virt-manager + ]; +} diff --git a/home/ebisu/meta/system/virtualisation/docker/default.nix b/home/ebisu/meta/system/virtualisation/docker/default.nix new file mode 100644 index 0000000..26854be --- /dev/null +++ b/home/ebisu/meta/system/virtualisation/docker/default.nix @@ -0,0 +1,10 @@ +{ pkgs, ... }: { + home.packages = with pkgs; [ + act + earthly + dive + # docker + docker-buildx + docker-slim + ]; +} diff --git a/home/ebisu/meta/utility/ai/default.nix b/home/ebisu/meta/utility/ai/default.nix new file mode 100644 index 0000000..7513348 --- /dev/null +++ b/home/ebisu/meta/utility/ai/default.nix @@ -0,0 +1,11 @@ +{ pkgs, ... }: { + home.packages = with pkgs; [ + ollama-cuda + shell-gpt + ]; + + # services.ollama = { + # enable = true; + # acceleration = "cuda"; + # }; +} diff --git a/home/ebisu/meta/utility/default.nix b/home/ebisu/meta/utility/default.nix new file mode 100644 index 0000000..4c5da73 --- /dev/null +++ b/home/ebisu/meta/utility/default.nix @@ -0,0 +1,12 @@ +{ pkgs, ... }: { + imports = [ + ./ai + ]; + + home.packages = with pkgs; [ + fontpreview + tealdeer + todo + ripunzip + ]; +} |