diff --git a/home/gtk/default.nix b/home/gtk/default.nix index e02b35b..b697a58 100644 --- a/home/gtk/default.nix +++ b/home/gtk/default.nix @@ -5,12 +5,14 @@ in { ".local/share/icons/GruvboxPlus".source = "${gruvboxPlus}"; }; - gtk.enable = true; - gtk.iconTheme.package = gruvboxPlus; - gtk.iconTheme.name = "GruvboxPlus"; + # home-manager.users.joy.gtk = { + # enable = true; + # iconTheme.package = gruvboxPlus; + # iconTheme.name = "GruvboxPlus"; + # }; - qt.enable = true; - qt.style.name = "adwaita-dark"; - qt.style.package = pkgs.adwaita-qt; - qt.platformTheme.name = "adwaita"; + # qt.enable = true; + # qt.style.name = "adwaita-dark"; + # qt.style.package = pkgs.adwaita-qt; + # qt.platformTheme.name = "adwaita"; } diff --git a/home/default.nix b/home/homedef.nix similarity index 92% rename from home/default.nix rename to home/homedef.nix index 85a7178..4a164d7 100644 --- a/home/default.nix +++ b/home/homedef.nix @@ -12,6 +12,6 @@ ./hyprland ./hypridle ./newsboat - ./swaync + # ./swaync ]; } diff --git a/home/misc/default.nix b/home/homemisc/default.nix similarity index 100% rename from home/misc/default.nix rename to home/homemisc/default.nix diff --git a/home/hypridle/default.nix b/home/hypridle/default.nix index 92d7ae7..9108214 100644 --- a/home/hypridle/default.nix +++ b/home/hypridle/default.nix @@ -1,6 +1,6 @@ {...}: { services.hypridle = { - enable = true; + # enable = true; settings = { listener = [ { diff --git a/home/swaync/default.nix b/home/swaync/default.nix index 1817167..b2d1ddd 100644 --- a/home/swaync/default.nix +++ b/home/swaync/default.nix @@ -1,296 +1,7 @@ {pkgs, ...}: { - services.swaync = { + services.dunst = { enable = true; - settings = { - positionX = "right"; - positionY = "top"; - layer = "overlay"; - control-center-layer = "top"; - layer-shell = true; - cssPriority = "application"; - control-center-margin-top = 20; - control-center-margin-bottom = 20; - control-center-margin-right = 20; - control-center-margin-left = 20; - notification-2fa-action = true; - notification-inline-replies = false; - notification-icon-size = 64; - notification-body-image-height = 100; - notification-body-image-width = 200; - timeout = 3; - timeout-low = 2; - timeout-critical = 0; - fit-to-screen = false; - control-center-width = 500; - control-center-height = 1365; - notification-window-width = 440; - keyboard-shortcuts = true; - image-visibility = "when-available"; - transition-time = 200; - hide-on-clear = true; - hide-on-action = true; - script-fail-notify = true; - - widgets = [ - "title" - "dnd" - "notifications" - "mpris" - "volume" - "buttons-grid" - ]; - - widget-config = { - title = { - text = "Notification Center"; - clear-all-button = true; - button-text = "󰆴 Clear All"; - }; - dnd = { - text = "Do Not Disturb"; - }; - label = { - max-lines = 1; - text = "Notification Center"; - }; - mpris = { - image-size = 96; - image-radius = 7; - }; - volume = { - label = "󰕾"; - show-per-app = true; - }; - buttons-grid = { - actions = [ - { - label = "󰐥"; - command = "systemctl poweroff"; - } - { - label = "󰜉"; - command = "systemctl reboot"; - } - { - label = "󰍃"; - command = "hyprctl dispatch exit"; - } - { - label = "󰤄"; - command = "systemctl suspend"; - } - { - label = "󰕾"; - command = "swayosd-client --output-volume mute-toggle"; - } - { - label = "󰍬"; - command = "swayosd-client --input-volume mute-toggle"; - } - { - label = "󰂯"; - command = "blueman-manager"; - } - ]; - }; - }; }; - style = - '' - -@define-color cc-bg #282828; -@define-color noti-border-color #32302f; -@define-color noti-bg #3c3836; -@define-color noti-bg-darker #3c3836; -@define-color noti-bg-hover rgb(27, 27, 43); -@define-color noti-bg-focus rgba(27, 27, 27, 0.6); -@define-color text-color #f9f5d7; -@define-color text-color-disabled #bdae93; -@define-color bg-selected #fabd2f; - * { - font-family: JetBrainsMono NFP; - font-weight: bold; - font-size: 14px -} - .control-center .notification-row:focus, -.control-center .notification-row:hover { - opacity: 1; - background: @noti-bg-darker -} - .notification-row { - outline: none; - margin: 20px; - padding: 0; -} - .notification { - background: transparent; - margin: 0px; -} - .notification-content { - background: @cc-bg; - padding: 7px; - border-radius: 0px; - border: 2px solid #85796f; - margin: 0; -} - .close-button { - background: #d79921; - color: @cc-bg; - text-shadow: none; - padding: 0; - border-radius: 0px; - margin-top: 5px; - margin-right: 5px; -} - .close-button:hover { - box-shadow: none; - background: #fabd2f; - transition: all .15s ease-in-out; - border: none -} - .notification-action { - color: #ebdbb2; - border: 2px solid #85796f; - border-top: none; - border-radius: 0px; - background: #32302F; -} - .notification-default-action:hover, -.notification-action:hover { - color: #ebdbb2; - background: #32302F; -} - .summary { - padding-top: 7px; - font-size: 13px; - color: #ebdbb2; -} - .time { - font-size: 11px; - color: #d79921; - margin-right: 24px -} - .body { - font-size: 12px; - color: #ebdbb2; -} - .control-center { - background: @cc-bg; - border: 2px solid #4E8A8D; - border-radiu -} - .control-center-list { - background: transparent -} - .control-center-list-placeholder { - opacity: .5 -} - .floating-notifications { - background: transparent -} - .blank-window { - background: alpha(black, 0.1) -} - .widget-title { - color: #f9f5d7; - background: @noti-bg-darker; - padding: 5px 10px; - margin: 10px 10px 5px 10px; - font-size: 1.5rem; - border-radius: 5px; -} - .widget-title>button { - font-size: 1rem; - color: @text-color; - text-shadow: none; - background: @noti-bg; - box-shadow: none; - border-radius: 5px; -} - .widget-title>button:hover { - background: #d79921; - color: @cc-bg; -} - .widget-dnd { - background: @noti-bg-darker; - padding: 5px 10px; - margin: 5px 10px 10px 10px; - border-radius: 5px; - font-size: large; - color: #f2e5bc; -} - .widget-dnd>switch { - border-radius: 4px; - background: #665c54; -} - .widget-dnd>switch:checked { - background: #d79921; - border: 1px solid #d79921; -} - .widget-dnd>switch slider { - background: @cc-bg; - border-radius: 5px -} - .widget-dnd>switch:checked slider { - background: @cc-bg; - border-radius: 5px -} - .widget-label { - margin: 10px 10px 5px 10px; -} - .widget-label>label { - font-size: 1rem; - color: @text-color; -} - .widget-mpris { - color: @text-color; - background: @noti-bg-darker; - padding: 5px 10px 0px 0px; - margin: 5px 10px 5px 10px; - border-radius: 0px; -} - .widget-mpris > box > button { - border-radius: 5px; -} - .widget-mpris-player { - padding: 5px 10px; - margin: 10px -} - .widget-mpris-title { - font-weight: 700; - font-size: 1.25rem -} - .widget-mpris-subtitle { - font-size: 1.1rem -} - .widget-buttons-grid { - font-size: x-large; - padding: 5px; - margin: 5px 10px 10px 10px; - border-radius: 5px; - background: @noti-bg-darker; -} - .widget-buttons-grid>flowbox>flowboxchild>button { - margin: 3px; - background: @cc-bg; - border-radius: 5px; - color: @text-color -} - .widget-buttons-grid>flowbox>flowboxchild>button:hover { - background: #d79921; - color: @cc-bg; -} - .widget-menubar>box>.menu-button-bar>button { - border: none; - background: transparent - } - .topbar-buttons>button { - border: none; - background: transparent -} - '' - ; - }; home.packages = with pkgs; [ libnotify diff --git a/modules/ags/bar/config.js b/modules/ags/bar/config.js new file mode 100644 index 0000000..2a12735 --- /dev/null +++ b/modules/ags/bar/config.js @@ -0,0 +1,201 @@ +const hyprland = await Service.import("hyprland") +const mpris = await Service.import("mpris") +const audio = await Service.import("audio") +const battery = await Service.import("battery") +const systemtray = await Service.import("systemtray") + +const date = Variable("", { + poll: [1000, 'date "+%H:%M:%S %b %e."'], +}) + +function Workspaces() { + const activeId = hyprland.active.workspace.bind("id"); + const workspaces = hyprland.bind("workspaces").as((ws) => + ws + .filter(({ id }) => id > 0) + .sort((a, b) => a.id - b.id) + .map(({ id }) => + Widget.Button({ + on_clicked: () => hyprland.messageAsync(`dispatch workspace ${id}`), + child: Widget.Label(`${id}`), + class_name: activeId.as(i => `${i === id ? "focused" : ""}`), + }))) + + return Widget.Box({ + class_name: "workspaces", + children: workspaces, + }) +} + + +function ClientTitle() { + return Widget.Label({ + class_name: "client-title", + label: hyprland.active.client.bind("title"), + }) +} + + +function Clock() { + return Widget.Label({ + class_name: "clock", + label: date.bind(), + }) +} + + + + +function Media() { + const label = Utils.watch("", mpris, "player-changed", () => { + if (mpris.players[0]) { + const { track_artists, track_title } = mpris.players[0] + return `${track_artists.join(", ")} - ${track_title}` + } else { + return "Nothing is playing" + } + }) + + return Widget.Button({ + class_name: "media", + on_primary_click: () => mpris.getPlayer("")?.playPause(), + on_scroll_up: () => mpris.getPlayer("")?.next(), + on_scroll_down: () => mpris.getPlayer("")?.previous(), + child: Widget.Label({ label }), + }) +} + + +function Volume() { + const icons = { + 101: "overamplified", + 67: "high", + 34: "medium", + 1: "low", + 0: "muted", + } + + function getIcon() { + const icon = audio.speaker.is_muted ? 0 : [101, 67, 34, 1, 0].find( + threshold => threshold <= audio.speaker.volume * 100) + + return `audio-volume-${icons[icon]}-symbolic` + } + + const icon = Widget.Icon({ + icon: Utils.watch(getIcon(), audio.speaker, getIcon), + }) + + const slider = Widget.Slider({ + hexpand: true, + draw_value: false, + on_change: ({ value }) => audio.speaker.volume = value, + setup: self => self.hook(audio.speaker, () => { + self.value = audio.speaker.volume || 0 + }), + }) + + return Widget.Box({ + class_name: "volume", + css: "min-width: 180px", + children: [icon, slider], + }) +} + + +function BatteryLabel() { + const value = battery.bind("percent").as(p => p > 0 ? p / 100 : 0) + const icon = battery.bind("percent").as(p => + `battery-level-${Math.floor(p / 10) * 10}-symbolic`) + + return Widget.Box({ + class_name: "battery", + visible: battery.bind("available"), + children: [ + Widget.Icon({ icon }), + Widget.LevelBar({ + widthRequest: 140, + vpack: "center", + value, + }), + ], + }) +} + + +function SysTray() { + const items = systemtray.bind("items") + .as(items => items.map(item => Widget.Button({ + child: Widget.Icon({ icon: item.bind("icon") }), + on_primary_click: (_, event) => item.activate(event), + on_secondary_click: (_, event) => item.openMenu(event), + tooltip_markup: item.bind("tooltip_markup"), + }))) + + return Widget.Box({ + children: items, + }) +} + + +// layout of the bar +function Left() { + return Widget.Box({ + spacing: 8, + children: [ + Workspaces(), + ClientTitle(), + ], + }) +} + +function Center() { + return Widget.Box({ + spacing: 8, + children: [ + Media(), + ], + }) +} + +function Right() { + return Widget.Box({ + hpack: "end", + spacing: 8, + children: [ + Volume(), + BatteryLabel(), + Clock(), + SysTray(), + ], + }) +} + +function Bar(monitor = 0) { + return Widget.Window({ + name: `bar-${monitor}`, // name has to be unique + class_name: "bar", + monitor, + anchor: ["top", "left", "right"], + exclusivity: "exclusive", + child: Widget.CenterBox({ + start_widget: Left(), + center_widget: Center(), + end_widget: Right(), + }), + }) +} + +App.config({ + style: "./style.css", + windows: [ + Bar(), + + // you can call it, for each monitor + // Bar(0), + // Bar(1) + ], +}) + +export { } + diff --git a/modules/ags/bar/style.css b/modules/ags/bar/style.css new file mode 100644 index 0000000..29f8fdd --- /dev/null +++ b/modules/ags/bar/style.css @@ -0,0 +1,40 @@ +window.bar { + background-color: @theme_bg_color; + color: @theme_fg_color; +} + +button { + min-width: 0; + padding-top: 0; + padding-bottom: 0; + background-color: transparent; +} + +button:active { + background-color: @theme_selected_bg_color; +} + +button:hover { + border-bottom: 3px solid @theme_fg_color; +} + +label { + font-weight: bold; +} + +.workspaces button.focused { + border-bottom: 3px solid @theme_selected_bg_color; +} + +.client-title { + color: @theme_selected_bg_color; +} + +.notification { + color: yellow; +} + +levelbar block, +highlight { + min-height: 10px; +} diff --git a/modules/ags/default.nix b/modules/ags/default.nix new file mode 100644 index 0000000..65ba0d1 --- /dev/null +++ b/modules/ags/default.nix @@ -0,0 +1,7 @@ +{inputs, ...}: { + imports = [inputs.ags.homeManagerModules.default]; + home-manager.users.joy.programs.ags = { + enable = true; + configDir = ./bar; + }; +} diff --git a/modules/ags/tsconfig.json b/modules/ags/tsconfig.json new file mode 100644 index 0000000..bdd7690 --- /dev/null +++ b/modules/ags/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "target": "ES2022", + "module": "ES2022", + "lib": [ + "ES2022" + ], + "allowJs": true, + "checkJs": true, + "strict": true, + "noImplicitAny": false, + "baseUrl": ".", + "typeRoots": [ + "./types" + ], + "skipLibCheck": true + } + // "include": [ + // "*/*.ts" + // ] +} diff --git a/modules/alacritty/default.nix b/modules/alacritty/default.nix new file mode 100644 index 0000000..e457613 --- /dev/null +++ b/modules/alacritty/default.nix @@ -0,0 +1,13 @@ +{...}: { + home-manager.users.joy.programs.alacritty = { + enable = true; + settings = { + window = { + padding = { + x = 5; + y = 5; + }; + }; + }; + }; +} diff --git a/modules/default.nix b/modules/default.nix index bdc7839..e95fd36 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -15,5 +15,18 @@ ./update ./polkit ./ssh + ./dunst + ./zsh + ./gtk + ./git + ./ags + ./misc + ./rofi + ./helix + ./firefox + ./alacritty + ./hyprland + ./hypridle + ./newsboat ]; } diff --git a/modules/dunst/default.nix b/modules/dunst/default.nix new file mode 100644 index 0000000..2c2e575 --- /dev/null +++ b/modules/dunst/default.nix @@ -0,0 +1,28 @@ +{ ... }: +{ + home-manager.users.joy.services.dunst = { + enable = true; + # settings = { + # global = { + # frame_color = "#89b4fa"; + # separator_color = "frame"; + # }; + + # urgency_low = { + # background = "#1e1e2e"; + # foreground = "#cdd6f4"; + # }; + + # urgency_normal = { + # background = "#1e1e2e"; + # foreground = "#cdd6f4"; + # }; + + # urgency_critical = { + # background = "#1e1e2e"; + # foreground = "#cdd6f4"; + # frame_color = "#fab387"; + # }; + # }; + }; +} diff --git a/modules/firefox/default.nix b/modules/firefox/default.nix new file mode 100644 index 0000000..29f1a26 --- /dev/null +++ b/modules/firefox/default.nix @@ -0,0 +1,170 @@ +{inputs, ...}: { + imports = [ + ./user.nix + ]; + + home-manager.users.joy.programs.firefox = { + enable = true; + profiles.joy = { + search.engines = { + "4get" = { + urls = [ + { + template = "https://4get.joygnu.org/web"; + params = [ + { + name = "s"; + value = "{searchTerms}"; + } + ]; + } + ]; + definedAliases = ["@4get"]; + }; + }; + search.force = true; + search.default = "4get"; + + bookmarks = [ + { + name = "Nix sites"; + toolbar = true; + bookmarks = [ + { + name = "Packages"; + url = "https://search.nixos.org/packages?channel=unstable"; + } + { + name = "Homemanager"; + url = "https://nix-community.github.io/home-manager/options.xhtml"; + } + { + name = "Stylix"; + url = "https://stylix.danth.me/options/nixos.html"; + } + { + name = "Git"; + url = "https://git.joygnu.org/"; + } + { + name = "Mail"; + url = "https://mail.joygnu.org/"; + } + { + name = "Photos"; + url = "https://immich.joygnu.org/"; + } + { + name = "Server"; + url = "https://avoro.eu/cp/clientarea.php?action=productdetails&id=27920"; + } + { + name = "Domain"; + url = "https://ap.www.namecheap.com/domains/list/"; + } + { + name = "Translate"; + url = "https://simplytranslate.org/"; + } + { + name = "Syncthing"; + url = "http://localhost:8384/"; + } + { + name = "GitHub"; + url = "https://github.com/"; + } + { + name = "Codeberg"; + url = "https://codeberg.org/"; + } + { + name = "Zophar's Domain"; + url = "https://www.zophar.net/music"; + } + { + name = "Hyprland"; + url = "https://wiki.hyprland.org/"; + } + { + name = "Monkeytype"; + url = "https://monkeytype.com/"; + } + { + name = "invidious"; + url = "https://invidious.reallyaweso.me"; + } + ]; + } + ]; + + extensions = with inputs.firefox-addons.packages."x86_64-linux"; [ + ublock-origin + darkreader + libredirect + search-by-image + terms-of-service-didnt-read + decentraleyes + stylus + istilldontcareaboutcookies + ]; + + settings = { + "dom.security.https_only_mode" = true; + "browser.download.panel.shown" = true; + "identity.fxaccounts.enabled" = false; + "signon.rememberSignons" = false; + "browser.urlbar.pocket.featureGate" = false; + "browser.newtabpage.activity-stream.showSponsoredTopSites" = false; + "browser.shell.checkDefaultBrowser" = false; + "browser.shell.defaultBrowserCheckCount" = 1; + "privacy.trackingprotection.enabled" = true; + "toolkit.legacyUserProfileCustomizations.stylesheets" = true; + "browser.uiCustomization.state" = '' + { + "placements": { + "widget-overflow-fixed-list": [], + "nav-bar": [ + "back-button", + "forward-button", + "stop-reload-button", + "urlbar-container", + "downloads-button", + "ublock0_raymondhill_net-browser-action", + "addon_darkreader_org-browser-action", + "_testpilot-containers-browser-action" + ], + "toolbar-menubar": [ + "menubar-items" + ], + "TabsToolbar": [ + "tabbrowser-tabs", + "new-tab-button", + "alltabs-button" + ], + "PersonalToolbar": [ + "personal-bookmarks" + ] + }, + "seen": [ + "save-to-pocket-button", + "developer-button", + "ublock0_raymondhill_net-browser-action", + "addon_darkreader_org-browser-action", + "_testpilot-containers-browser-action" + ], + "dirtyAreaCache": [ + "nav-bar", + "PersonalToolbar", + "toolbar-menubar", + "TabsToolbar", + "widget-overflow-fixed-list" + ], + "currentVersion": 18, + "newElementCount": 4 + } + ''; + }; + }; + }; +} diff --git a/modules/firefox/user.nix b/modules/firefox/user.nix new file mode 100644 index 0000000..8820e87 --- /dev/null +++ b/modules/firefox/user.nix @@ -0,0 +1,380 @@ +{...}: { + home-manager.users.joy.programs.firefox = { + enable = true; + profiles.joy = { + userChrome = '' + + /*================== Gruvbox Theme for Firefox ================== + Author: kmason + Based on the color scheme of calvinchd's Gruvbox Dark Firefox Theme - https://gitlab.com/calvinchd/gruvbox-dark-firefox-theme + */ + @namespace xul "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; + + :root { + --background: #1d2021; + --secondary: #282828; + --foreground: #EBDBB2; + + --orange-highlight: #fe8019; + --sound-border: #68217A; + + --separator: #665e54; + + --toolbar-bgcolor: var(--secondary) !important; + + --tab: var(--background); + --tab-btn: var(--tab-inactive); + --tab-inactive: var(--secondary); + --tab-btn-inactive: var(--tab-inactive); + --tab-hover: #32302f; + --tab-btn-hover: #3C3836; + --toolbar-btn-hover: #49463f; + + --url-bar: #3C3836; + --url-focus: #504945; + --url-bar-item-hover: #6a6257; + + --sidebar: #3C3836; + --sidebar-button-hover: #5A544B; + --sidebar-highlight: #458588; + } + + /* + SEARCH AND POPUPS/MENUS + */ + + .panel-arrowcontainer { + background-color: var(--secondary) !important; + } + + #PopupAutoComplete, + #PopupSearchAutoComplete + { + background-color: var(--url-focus) !important; + color: var(--foreground) !important; + } + + panelview { + background-color: var(--sidebar) !important; + color: var(--foreground) !important; + } + + panelview toolbarbutton.subviewbutton:hover { + background-color: var(--sidebar-button-hover) !important; + } + + panel[type="autocomplete-richlistbox"] { + --panel-background: none !important; + border-radius: 4px !important; + color: var(--foreground) !important; + } + + /* + _____ ___ ___ _ ___ _ ___ + |_ _/ _ \ / _ \| | | _ ) / \ | _ \ + | || (_) | (_) | |__| _ \/ = \| / + |_| \___/ \___/|____|___/_/ \_\_|\_\ + + */ + + toolbarseparator, + menuseparator + { + border-color: var(--separator) !important; + border-image: none !important; + } + + toolbar { + background-color: var(--secondary); + } + + toolbar#TabsToolbar { + background-color: var(--background); + } + toolbar#TabsToolbar:-moz-window-inactive { + background-color: var(--toolbar-bgcolor) !important; + } + + #titlebar, + #titlebar-spacer, + #titlebar-buttonbox-container + { + background-color: var(--background) !important; + border: none !important; + } + + #navigator-toolbox { + --tabs-border-color: var(--orange-highlight) !important; + } + + /* Remove border under navbar */ + #navigator-toolbox::after { + border-bottom: 0px !important; + } + + /* remove some borders */ + #navigator-toolbox { + border: none !important; + } + + /* + _ _ ___ _ ___ _ ___ + | | | | _ \| | | _ ) / \ | _ \ + | |_| | /| |__| _ \/ = \| / + \___/|_|\_\____|___/_/ \_\_|\_\ + + */ + + #urlbar, + #searchbar + { + box-shadow: none !important; + border: none !important; + border-radius: 4px; + color : var(--foreground) !important; + background-color: var(--url-bar) !important; + --autocomplete-popup-separator-color: var(--separator) !important; + } + + #urlbar-input, + #urlbar-input-container + { + color: var(--foreground) !important; + background-color: var(--url-bar) !important; + } + + #urlbar:not([open]) #urlbar-input-container:focus-within, + #searchbar:focus-within + { + border: 2px solid var(--orange-highlight) !important; + } + + #urlbar:focus-within, + #urlbar[open], + #urlbar[open] #urlbar-input-container, + #urlbar[open] #urlbar-input, + #urlbar-input-container:focus-within, + #urlbar-input:focus, + #urlbar-background, + .urlbarView, + #searchbar:focus-within, + menupop + { + background-color: var(--url-focus) !important; + } + #searchbar:focus-within { + outline: none !important; + } + + :is(panel, menupopup)::part(content) { + background: none !important; + } + + .urlbarView button:hover, + #searchbar button:hover, + .urlbarView-row:hover .urlbarView-row-inner, + .search-autocomplete-richlistbox-popup .autocomplete-richlistitem:hover + { + background-color: var(--url-bar-item-hover) !important; + } + + .urlbarView-row[type="switchtab"] > span{ + color: var(--orange-highlight) !important; + } + + #PopupSearchAutoComplete .autocomplete-richlistitem[selected], + .searchbar-engine-one-off-item[selected], + .urlbarView-row[selected], + .urlbarView-row[aria-selected="true"], + .urlbarView-row:not([type="tip"], [type="dynamic"])[selected] > .urlbarView-row-inner, + .urlbarView-row-inner[selected] + { + color: var(--foreground) !important; + background-color: var(--sidebar-highlight) !important; + border-radius: 4px !important; + } + + /* + BOOKMARKS BAR + */ + + #PersonalToolbar { + background-color: var(--secondary) !important; + } + + /* + _____ _ ___ ___ + |_ _/ \ | _ ) __| + | |/ = \| _ \__ \ + |_/_/ \_\___/___/ + + */ + .tab-background[selected="true"] { + background-color: transparent !important; + background-image: none !important; + } + .tabbrowser-tab:hover > .tab-stack > .tab-background:not([selected="true"]):not([multiselected]){ + background-color: transparent !important; + } + + .tabbrowser-tab[soundplaying="true"] { + --lwt-tab-line-color: var(--sound-border) !important; + } + .tab-content[selected="true"] { + border-color: var(--orange-highlight) !important; + --sound-border: var(--orange-highlight) !important; + } + .tab-text { + color: var(--foreground); + } + + tab, + #tabbrowser-tabs + { + background-color: var(--background) !important; + color : var(--foreground) !important; + } + tab:-moz-window-inactive, + #tabbrowser-tabs:-moz-window-inactive, + #nav-bar-customization-target + { + background-color: var(--secondary) !important; + } + + .tabbrowser-tab[selected]{ + opacity: 1; + } + + .tab-loading-burst { + background-color: inherit; + } + + .tab-content + { + border-radius: 4px; + margin: 5px 0px 5px 0px !important; + border: 1px solid transparent !important; + } + .tab-content[selected="true"] + { + background-color: var(--secondary) !important; + color : var(--foreground) !important; + border: 1px solid var(--orange-highlight) !important; + } + .tab-content:not([selected="true"]):hover { + background-color: var(--tab-hover) !important; + } + + /* + ___ _____ ___ _ ___ + | _ )_ _| \| |/ __| + | _ \ | | | |\ | |\__ \ + |___/ |_| |_| \__|/___/ + + */ + + /* + Toolbar buttons + */ + + toolbarbutton { + fill: var(--foreground) !important; + background-color: transparent !important; + } + + /* + TAB BAR BUTTONS + */ + + #TabsToolbar toolbarbutton { + border-radius: 4px; + border: 1px solid transparent !important; + } + #TabsToolbar toolbarbutton:-moz-window-inactive { + opacity: 0.7 !important; + } + + #alltabs-button > .toolbarbutton-badge-stack, + #tabs-newtab-button > .toolbarbutton-icon { + background-image: none; + border-radius: 6px; + } + #alltabs-button:hover > .toolbarbutton-badge-stack, + #tabs-newtab-button:hover > .toolbarbutton-icon { + background-color: var(--tab-btn-hover) !important; + } + + /* Firefox View button */ + #TabsToolbar #firefox-view-button > .toolbarbutton-icon + { + background-image: none !important; + border-radius: 4px; + } + #TabsToolbar #firefox-view-button[open] > .toolbarbutton-icon + { + background-color: var(--secondary) !important; + color : var(--foreground) !important; + padding: 9px !important; + border: 1px solid var(--orange-highlight) !important; + } + #TabsToolbar #firefox-view-button:not([open]):hover > .toolbarbutton-icon { + background-color: var(--tab-hover) !important; + } + + /* + MIDDLE BAR (url bar) BUTTONS + */ + + #nav-bar toolbarbutton > .toolbarbutton-icon, + #nav-bar toolbarbutton > .toolbarbutton-badge-stack { + border-radius: 6px; + } + #nav-bar toolbarbutton:hover > .toolbarbutton-icon, + #nav-bar toolbarbutton:hover > .toolbarbutton-badge-stack { + background-color: var(--toolbar-btn-hover) !important; + } + + #back-button { + padding-right: 2px !important; + padding-left: 2px !important; + margin-left: 6px !important; + } + + /* Hamburger Menu */ + #PanelUI-menu-button { + background-color: var(--secondary) !important; + padding-right: 2px !important; + margin-right: 6px !important; + } + + /* + BOOKMARK BUTTONS + */ + #PersonalToolbar toolbarbutton { + margin: 3px 0px 3px 3px !important; + border-radius: 4px; + } + #PersonalToolbar toolbarbutton:hover { + background-color: var(--toolbar-btn-hover) !important; + } + ''; + + userContent = '' + + :root { + --background: #1d2021; + --secondary: #282828; + --newtab-body: #32302f; + --foreground: #EBDBB2; + } + + @-moz-document url-prefix("about:"), url-prefix("about:newtab"), url-prefix("about:home") { + html, body { + color: var(--foreground) !important; + background-color: var(--newtab-body) !important; + } + } + ''; + }; + }; +} diff --git a/modules/git/default.nix b/modules/git/default.nix new file mode 100644 index 0000000..154f162 --- /dev/null +++ b/modules/git/default.nix @@ -0,0 +1,7 @@ +{...}: { + home-manager.users.joy.programs.git = { + enable = true; + userEmail = "mail@joygnu.org"; + userName = "joygnu"; + }; +} diff --git a/modules/gtk/default.nix b/modules/gtk/default.nix new file mode 100644 index 0000000..69a45ac --- /dev/null +++ b/modules/gtk/default.nix @@ -0,0 +1,18 @@ +{pkgs, ...}: let + gruvboxPlus = import ./gruvbox-plus.nix {inherit pkgs;}; +in { + home.file = { + ".local/share/icons/GruvboxPlus".source = "${gruvboxPlus}"; + }; + + gtk = { + enable = true; + iconTheme.package = gruvboxPlus; + iconTheme.name = "GruvboxPlus"; + }; + + # qt.enable = true; + # qt.style.name = "adwaita-dark"; + # qt.style.package = pkgs.adwaita-qt; + # qt.platformTheme.name = "adwaita"; +} diff --git a/modules/gtk/gruvbox-plus.nix b/modules/gtk/gruvbox-plus.nix new file mode 100644 index 0000000..92992cc --- /dev/null +++ b/modules/gtk/gruvbox-plus.nix @@ -0,0 +1,19 @@ +{pkgs}: let + link = "https://github.com/SylEleuth/gruvbox-plus-icon-pack/releases/download/v3.1/gruvbox-plus-icon-pack-3.1.zip"; +in + pkgs.stdenv.mkDerivation + { + name = "gruvbox-plus"; + + src = pkgs.fetchurl { + url = link; + sha256 = "sha256-i/AzhYz/ACeXsG5j0kDVfvfA4TwxA3KZJTPwCO4BKmc="; + }; + + dontUnpack = true; + + installPhase = '' + mkdir -p $out + ${pkgs.unzip}/bin/unzip $src -d $out/ + ''; + } diff --git a/modules/helix/default.nix b/modules/helix/default.nix new file mode 100644 index 0000000..13ca24b --- /dev/null +++ b/modules/helix/default.nix @@ -0,0 +1,31 @@ +{pkgs, ...}: { + programs.helix = { + enable = true; + defaultEditor = true; + settings = { + keys.normal = { + space.space = "file_picker"; + Z.Z = ":wq"; + Z.Q = ":q!"; + }; + }; + }; + + home.packages = with pkgs; [ + nil + clang-tools + javascript-typescript-langserver + # vscode-langservers-extracted + rust-analyzer + lldb_18 + lua-language-server + jdt-language-server + gopls + dockerfile-language-server-nodejs + python312Packages.python-lsp-server + omnisharp-roslyn + netcoredbg + dotnetCorePackages.sdk_9_0 + texlab + ]; +} diff --git a/modules/homemisc/default.nix b/modules/homemisc/default.nix new file mode 100644 index 0000000..e8f5bdd --- /dev/null +++ b/modules/homemisc/default.nix @@ -0,0 +1,19 @@ +{lib, ...}: { + home = { + username = "joy"; + homeDirectory = "/home/joy"; + stateVersion = "23.11"; + sessionVariables = { + }; + }; + + programs.home-manager.enable = true; + + xdg.mimeApps.defaultApplications = { + "text/plain" = ["helix.desktop"]; + "image/*" = ["imv.desktop"]; + "video/png" = ["mpv.desktop"]; + "video/jpg" = ["mpv.desktop"]; + "video/*" = ["mpv.desktop"]; + }; +} diff --git a/modules/hypridle/default.nix b/modules/hypridle/default.nix new file mode 100644 index 0000000..9108214 --- /dev/null +++ b/modules/hypridle/default.nix @@ -0,0 +1,19 @@ +{...}: { + services.hypridle = { + # enable = true; + settings = { + listener = [ + { + timeout = 300; + on-timeout = "hyprctl dispatch dpms off"; + on-resume = "hyprctl dispatch dpms on"; + } + { + timeout = 600; + on-timeout = "systemctl suspend"; + on-resume = "hyprctl dispatch dpms on"; + } + ]; + }; + }; +} diff --git a/modules/hyprland/default.nix b/modules/hyprland/default.nix new file mode 100644 index 0000000..cb0fac2 --- /dev/null +++ b/modules/hyprland/default.nix @@ -0,0 +1,195 @@ +{pkgs, ...}: { + home.packages = with pkgs; [ + rofi-wayland + pwvucontrol + swww + wl-clipboard + cliphist + grim + slurp + hyprpicker + swappy + hypridle + playerctl + ]; + + services.cliphist.enable = true; + + wayland.windowManager.hyprland = { + enable = true; + + settings = { + "$mod" = "SUPER"; + "$scrPath" = "~/nix/home/hyprland/scirpts"; + + dwindle = { + pseudotile = true; + preserve_split = true; + }; + + cursor = { + inactive_timeout = "3"; + }; + + env = [ + "HYPRCURSOR_THEME = Bibata-Modern-Ice" + "HYPRCURSOR_SIZE = 24" + "NIXOS_OZONE_WL = 1" + ]; + + xwayland = { + force_zero_scaling = true; + }; + + monitor = [ + "DP-1,2560x1440@165.00Hz,auto,1,bitdepth,10" + "eDP-1,prefrered,auto,1" + "HDMI-A-1,prefrered,auto,1,mirror,eDP-1" + ]; + + exec-once = [ + "ags" + "sh ~/nix/home/hyprland/scripts/hypridle.sh" + ]; + + windowrule = [ + "float,title:^(Pipewire)(.*)$" + "float,title:^(Disks)(.*)$" + "float,title:^(Calculator)(.*)$" + "float,title:^(Bluetooth)(.*)$" + "float,title:^(Clocks)(.*)$" + "float,title:^(Network Connections)(.*)$" + "opacity 0.9,^(Alacritty)(.*)$" + ]; + + gestures = { + workspace_swipe = true; + workspace_swipe_forever = true; + workspace_swipe_distance = 200; + }; + + bind = [ + # launch Apps + "$mod,TAB, exec, alacritty" + "$mod, E, exec, nemo" + "$mod, S, exec, firefox" + "$mod, X, exec, keepassxc" + "$mod, M, exec, mw -Y && alacritty -e neomutt" + "$mod, N, exec, alacritty -e newsboat" + "$mod, A, exec, rofi -show drun" + "$mod, F, exec, freetube" + "$mod, C, exec, hyprpicker -a" + "$mod+Shift, W, exec, sh ~/nix/home/hyprland/scripts/vm.sh" + "$mod+Shift, Z, exec, grim - | swappy -f -" + "$mod, Z, exec, sh ~/nix/home/hyprland/scripts/screen.sh" + "$mod, V, exec, cliphist list | rofi -dmenu | cliphist decode | wl-copy" + "$mod, O, exec, sh ~/nix/home/hyprland/scripts/mpv.sh" + + # controles + "$mod, Q, killactive" + "$mod, W, togglefloating" + "$mod, R, togglesplit" + "$mod+shift, S, exec, systemctl suspend" + "$mod+shift, M, exit, hyprland" + "$mod, G, exec, sh ~/nix/home/hyprland/scripts/gamemode.sh" + "$mod+shift, B, exec, sh ~/nix/home/hyprland/scripts/ags.sh" + "$mod, up, exec, sh ~/nix/home/hyprland/scripts/volume.sh -i" + "$mod, down, exec, sh ~/nix/home/hyprland/scripts/volume.sh -d" + "$mod, P, exec, hyprctl dispatch togglefloating && hyprctl dispatch pin" + + # cmus + "$mod, D, exec, sh ~/nix/home/hyprland/scripts/cmus.sh" + "$mod, space, exec, playerctl play-pause" + "$mod, comma, exec, playerctl previous" + "$mod, period, exec, playerctl next" + "$mod, equal, exec, cmus-remote -v +10%" + "$mod, minus, exec, cmus-remote -v -10%" + + # Move focus + "$mod, Return, fullscreen" + "$mod, H, movefocus, l" + "$mod, L, movefocus, r" + "$mod, K, movefocus, u" + "$mod, J, movefocus, d" + + # Window resizing X Y + "CTRL+SHIFT, H, resizeactive, -60 0" + "CTRL+SHIFT, L, resizeactive, 60 0" + "CTRL+SHIFT, K, resizeactive, 0 -60" + "CTRL+SHIFT, J, resizeactive, 0 60" + + # Moving windows + "$mod SHIFT, H, swapwindow, l" + "$mod SHIFT, L, swapwindow, r" + "$mod SHIFT, K, swapwindow, u" + "$mod SHIFT, J, swapwindow, d" + + # Switch workspaces + "$mod, 1, workspace, 1" + "$mod, 2, workspace, 2" + "$mod, 3, workspace, 3" + "$mod, 4, workspace, 4" + "$mod, 5, workspace, 5" + "$mod, 6, workspace, 6" + "$mod, 7, workspace, 7" + "$mod, 8, workspace, 8" + "$mod, 9, workspace, 9" + "$mod, 0, workspace, 10" + + # Move active window to a workspace + "$mod+Shift, 1, movetoworkspace, 1" + "$mod+Shift, 2, movetoworkspace, 2" + "$mod+Shift, 3, movetoworkspace, 3" + "$mod+Shift, 4, movetoworkspace, 4" + "$mod+Shift, 5, movetoworkspace, 5" + "$mod+Shift, 6, movetoworkspace, 6" + "$mod+Shift, 7, movetoworkspace, 7" + "$mod+Shift, 8, movetoworkspace, 8" + "$mod+Shift, 9, movetoworkspace, 9" + "$mod+Shift, 0, movetoworkspace, 10" + ]; + + bindm = [ + "$mod, mouse:272, movewindow" + "$mod, mouse:273, resizewindow" + ]; + + bindl = [ + ", XF86MonBrightnessUp, exec, brightnessctl set +10%" + ", XF86MonBrightnessDown, exec, brightnessctl set 10%-" + ", XF86AudioRaiseVolume, exec, sh ~/nix/home/hyprland/scripts/volume.sh -i" + ", XF86AudioLowerVolume, exec, sh ~/nix/home/hyprland/scripts/volume.sh -d" + ", XF86AudioMute, exec, sh ~/nix/home/hyprland/scripts/volume.sh -m" + ", XF86AudioMicMute, exec, sh ~/nix/home/hyprland/scripts/volume.sh -t" + ]; + + general = { + gaps_in = 5; + gaps_out = 10; + border_size = 4; + allow_tearing = false; + layout = "master"; + }; + + misc = { + disable_hyprland_logo = true; + disable_splash_rendering = true; + }; + + decoration = { + rounding = 5; + }; + + input = { + kb_layout = "us,de"; + kb_variant = ",qwerty"; + kb_options = "grp:alt_shift_toggle,caps:swapescape"; + }; + + device = { + name = "at-translated-set-2-keyboard"; + repeat_rate = "50"; + }; + }; + }; +} diff --git a/modules/hyprland/scripts/ags.sh b/modules/hyprland/scripts/ags.sh new file mode 100755 index 0000000..60709fa --- /dev/null +++ b/modules/hyprland/scripts/ags.sh @@ -0,0 +1,4 @@ +#/bin/sh + +pkill ags +ags diff --git a/modules/hyprland/scripts/cmus.sh b/modules/hyprland/scripts/cmus.sh new file mode 100755 index 0000000..375e67f --- /dev/null +++ b/modules/hyprland/scripts/cmus.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +if screen -list | grep -q '\.cmus'; then + alacritty -e screen -r cmus +else + screen -dmS cmus cmus & + alacritty -e screen -r cmus +fi + diff --git a/modules/hyprland/scripts/gamemode.sh b/modules/hyprland/scripts/gamemode.sh new file mode 100755 index 0000000..b89b5c4 --- /dev/null +++ b/modules/hyprland/scripts/gamemode.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env sh +HYPRGAMEMODE=$(hyprctl getoption animations:enabled | awk 'NR==1{print $2}') +if [ "$HYPRGAMEMODE" = 1 ] ; then + hyprctl --batch "\ + keyword animations:enabled 0;\ + keyword decoration:drop_shadow 0;\ + keyword decoration:blur:enabled 0;\ + keyword general:gaps_in 0;\ + keyword general:gaps_out 0;\ + keyword general:border_size 1;\ + keyword decoration:rounding 0" + exit +fi +hyprctl reload diff --git a/modules/hyprland/scripts/hypridle.sh b/modules/hyprland/scripts/hypridle.sh new file mode 100755 index 0000000..cf4ef17 --- /dev/null +++ b/modules/hyprland/scripts/hypridle.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +hostname=$(hostname) + +if [ "$hostname" = "laptop" ]; then + hyprilde +fi diff --git a/modules/hyprland/scripts/mpv.sh b/modules/hyprland/scripts/mpv.sh new file mode 100755 index 0000000..2eccf05 --- /dev/null +++ b/modules/hyprland/scripts/mpv.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +# Get the link from the clipboard using wl-paste +link=$(wl-paste) + +# Check if a link was provided +if [ -n "$link" ]; then + # Open the link in mpv + mpv "$link" +else + echo "No URL provided." +fi diff --git a/modules/hyprland/scripts/screen.sh b/modules/hyprland/scripts/screen.sh new file mode 100755 index 0000000..d705daf --- /dev/null +++ b/modules/hyprland/scripts/screen.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +grim -g "$(slurp)" - | swappy -f - + diff --git a/modules/hyprland/scripts/vm.sh b/modules/hyprland/scripts/vm.sh new file mode 100755 index 0000000..e1a6e71 --- /dev/null +++ b/modules/hyprland/scripts/vm.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +VM_NAME="Windows" + +vm_state=$(virsh --connect qemu:///system domstate "$VM_NAME") + +if [ "$vm_state" != "running" ]; then + virsh --connect qemu:///system start "$VM_NAME" + sleep 20 +fi + +# Get the IP address of the VM +VM_IP=$(virsh --connect qemu:///system domifaddr "$VM_NAME" | grep -oP '(\d+\.){3}\d+' | head -1) + +if [ -z "$VM_IP" ]; then + echo "Failed to retrieve IP address for VM: $VM_NAME" + exit 1 +fi + +xfreerdp -grab-keyboard /v:"$VM_IP" /u:joy /p:1 /size:100% /dynamic-resolution /gfx-h264:avc444 +gfx-progressive /sec:nla /bpp:32 /rfx /rfx-mode:video -bitmap-cache -offscreen-cache -glyph-cache diff --git a/modules/hyprland/scripts/volume.sh b/modules/hyprland/scripts/volume.sh new file mode 100755 index 0000000..550e28a --- /dev/null +++ b/modules/hyprland/scripts/volume.sh @@ -0,0 +1,78 @@ +#!/bin/sh + +usage() { + echo "Usage: $0 [-d|-i|-m|-t]" + echo " -d Decrease volume by 10%" + echo " -i Increase volume by 10%" + echo " -m Toggle mute/unmute for the sink" + echo " -t Toggle mute/unmute for the microphone" + exit 1 +} + +get_default_sink() { + pactl info | grep "Default Sink" | awk '{print $3}' +} + +get_default_source() { + pactl info | grep "Default Source" | awk '{print $3}' +} + +while getopts "dimt" opt; do + case $opt in + d) + sink=$(get_default_sink) + if [ -n "$sink" ]; then + pactl set-sink-volume "$sink" -10% + else + echo "No default sink found." + fi + ;; + i) + sink=$(get_default_sink) + if [ -n "$sink" ]; then + pactl set-sink-volume "$sink" +10% + else + echo "No default sink found." + fi + ;; + m) + sink=$(get_default_sink) + if [ -n "$sink" ]; then + current_mute=$(pactl get-sink-mute "$sink" | awk '{print $2}') + if [ "$current_mute" = "yes" ]; then + pactl set-sink-mute "$sink" 0 + echo "Unmuted sink" + else + pactl set-sink-mute "$sink" 1 + echo "Muted sink" + fi + else + echo "No default sink found." + fi + ;; + t) + source=$(get_default_source) + if [ -n "$source" ]; then + current_mute=$(pactl get-source-mute "$source" | awk '{print $2}') + if [ "$current_mute" = "yes" ]; then + pactl set-source-mute "$source" 0 + echo "Unmuted microphone" + else + pactl set-source-mute "$source" 1 + echo "Muted microphone" + fi + else + echo "No default source found." + fi + ;; + *) + usage + ;; + esac +done + +sink=$(get_default_sink) +if [ -n "$sink" ]; then + echo "Current volume for sink:" + pactl list sinks | grep -A 15 "$sink" | grep "Volume:" +fi diff --git a/modules/newsboat/default.nix b/modules/newsboat/default.nix new file mode 100644 index 0000000..a269f7f --- /dev/null +++ b/modules/newsboat/default.nix @@ -0,0 +1,132 @@ +{...}: { + programs.newsboat = { + enable = true; + browser = "firefox"; + urls = [ + { + url = "https://invidious.reallyaweso.me/feed/channel/UCg6gPGh8HU2U01vaFCAsvmQ"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCYAg4bYdyqENxEyHUX7t1FA"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCVls1GmFKf6WlTraIb_IaJg"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UC5KDiSAFxrDWhmysBcNqtMA"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCcBhwZNKqmPaw3Zk7mh6eBg"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCwnqDLYzLGPbghL9uIOwMnQ"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCRSxdcWjoye7ohD_ibxzYhg"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UChIs72whgZI9w6d6FhwGGHA"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCE_K_gW6ReBi4H3Gp0gi-hg"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCWRHrWUsjdF86dt7NKK2Ixw"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCFzUEe9XUlkDLp6AmtNzmOA"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCxBfQGaMuiMyw1dgW-tpZbg"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCpes6DXY4XCSA8s9Q1G9ocg"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCR42P1Uub9py2H5RkdcTnWA"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCtwjD3551TskyUxnfaUw7Rg"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCZpKTYOk5WAdCyMal3J1KHg"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCl2mFZoRqjw_ELax4Yisf6w"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UC2eYFnH61tmytImy1mTYvhA"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UC7YOGHUfC1Tb6E4pudI9STA"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UC0sUzmZ0CHvVCVrpRfGKZfw"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCFFfGA991VRR4U8FNNs72Qg"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCIS-e4W5wK2xG6NbI5Tdm_g"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCKmEAsezQ0kUQ6EC-BtBNbg"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCgj6MvuVmp0JVanAZkFQM5A"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCXQZRyhGN-1F8zwD0a8QuWA"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCohllq0Pk5lQuuNANabHKcg"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCUKU3fl8z2rcK7GBdocd7Ww"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCO57urWt8_T63SPFCA_QmNw"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCtMVHI3AJD4Qk4hcbZnI9ZQ"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UC8ENHE5xdFSwx71u3fDH5Xw"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCMXLdjrQi4JzY0NNvCdUEUQ"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCEKtvLc3EIS0T7shmgPbVrw"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UC_zBdZ0_H_jn41FDRG7q4Tw"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UChuDUAo3Hfr_0dn54GpwdUQ"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UClonyx8pReBvkjropmrS6jQ"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCOSqzSTg4QZXdi7jvV-9rUg"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCXQZRyhGN-1F8zwD0a8QuWA"; + } + { + url = "https://invidious.reallyaweso.me/feed/channel/UCxdZ7XCQVMRMipj3gGemQfw"; + } + ]; + extraConfig = '' + bind-key j down + bind-key k up + bind-key j next articlelist + bind-key k prev articlelist + bind-key ge end + bind-key gg home + bind-key l open + bind-key h quit + macro c set browser "setsid -f mpv --no-terminal %u &" ; open-in-browser ; set browser "elinks %u" ''; + }; +} diff --git a/modules/rofi/default.nix b/modules/rofi/default.nix new file mode 100644 index 0000000..c98b3af --- /dev/null +++ b/modules/rofi/default.nix @@ -0,0 +1,20 @@ +{ + pkgs, + lib, + ... +}: { + programs.rofi = { + enable = true; + package = pkgs.rofi-wayland; + theme = lib.mkForce "~/nix/home/rofi/gruvbox-material.rasi"; + extraConfig = { + display-ssh = ""; + display-run = ""; + display-drun = ""; + display-window = ""; + display-combi = ""; + show-icons = true; + terminal = "alacritty"; + }; + }; +} diff --git a/modules/rofi/gruvbox-material.rasi b/modules/rofi/gruvbox-material.rasi new file mode 100644 index 0000000..f75bc2c --- /dev/null +++ b/modules/rofi/gruvbox-material.rasi @@ -0,0 +1,149 @@ +/** + * Gruvbox rofi theme + * + * Color palette imported from https://github.com/sainnhe/gruvbox-material + * + */ + +* { + gruv0: #282828; + gruv1: #32302f; + gruv2: #45403d; + gruv3: #5a524c; + + gruv4: #fbf1c7; + gruv5: #f4e8be; + gruv6: #eee0b7; + + gruv7: #a89984; + gruv8: #928374; + gruv9: #7c6f64; + gruv10: #504945; + red: #ea6962; + + orange: #e78a4e; + yellow: #d8a657; + aqua: #89b482; + purple: #d3869b; + + reddark: #c14a4a; + yellowdark: #b47109; + + foreground: @gruv9; + background-color: transparent; + + highlight: underline bold #eee0b7; + + transparent: rgba(46,52,64,0); + +} + +window { + location: center; + anchor: center; + border-radius: 10px; + height: 560px; + width: 600px; + + background-color: @transparent; + spacing: 0; + children: [mainbox]; + orientation: horizontal; +} + +mainbox { + spacing: 0; + children: [ inputbar, message, listview ]; +} + +message { + padding: 10px; + border: 0px 2px 2px 2px; + border-color: @gruv0; + background-color: @gruv7; +} + +inputbar { + color: @gruv6; + padding: 14px; + background-color: @gruv0; + border-color: @gruv0; + + border: 1px; + border-radius: 10px 10px 0px 0px; +} + +entry, prompt, case-indicator { + text-font: inherit; + text-color: inherit; +} + +prompt { + margin: 0px 1em 0em 0em ; +} + +listview { + padding: 8px; + border-radius: 0px 0px 10px 10px; + border: 2px 2px 2px 2px; + border-color: @gruv0; + background-color: @gruv0; + dynamic: false; +} + +element { + padding: 5px; + vertical-align: 0.5; + border-radius: 10px; + color: @foreground; + text-color: @gruv6; + background-color: @gruv1; +} + +element.normal.active { + background-color: @yellow; +} + +element.normal.urgent { + background-color: @reddark; +} + +element.selected.normal { + background-color: @gruv7; + text-color: @gruv0; +} + +element.selected.active { + background-color: @yellowdark; +} + +element.selected.urgent { + background-color: @red; +} + +element.alternate.normal { + background-color: @transparent; +} + +element-text, element-icon { + size: 3ch; + margin: 0 10 0 0; + vertical-align: 0.5; + background-color: inherit; + text-color: @gruv6; +} + +button { + padding: 6px; + color: @foreground; + horizontal-align: 0.5; + + border: 2px 0px 2px 2px; + border-radius: 10px; + border-color: @foreground; +} + +button.selected.normal { + border: 2px 0px 2px 2px; + border-color: @foreground; +} diff --git a/modules/zsh/default.nix b/modules/zsh/default.nix new file mode 100644 index 0000000..82afd5c --- /dev/null +++ b/modules/zsh/default.nix @@ -0,0 +1,28 @@ +{pkgs, ...}: { + programs.zsh = { + enable = true; + syntaxHighlighting.enable = true; + enableCompletion = true; + autosuggestion.enable = true; + historySubstringSearch.enable = true; + dotDir = ".config/zsh"; + initExtra = "PROMPT='%F{green}%~%f '"; + + shellAliases = { + v = "hx"; + cat = "bat"; + cn = "cd ~/nix"; + ls = "${pkgs.eza}/bin/eza --icons -a --group-directories-first"; + pu = "sh ~/nix/home/zsh/push.sh"; + ip = "sh ~/nix/home/zsh/ip.sh"; + fr = "sudo systemctl reboot --firmware"; + ser = "ssh root@joygnu.org"; + rb = "sh ~/nix/home/zsh/rebuild.sh"; + up = "sudo nix flake update ~/nix"; + del = "sudo nix-collect-garbage -d"; + }; + + history.size = 1000000; + history.path = ".config/zsh/history"; + }; +} diff --git a/modules/zsh/ip.sh b/modules/zsh/ip.sh new file mode 100755 index 0000000..42c0432 --- /dev/null +++ b/modules/zsh/ip.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +local_ip=$(ip -4 addr show scope global | grep inet | awk '{print $2}' | cut -d/ -f1 | head -n 1) + +public_ip=$(curl -s ifconfig.me) + +echo "Local IP Address: $local_ip" +echo "Public IP Address: $public_ip" diff --git a/modules/zsh/push.sh b/modules/zsh/push.sh new file mode 100755 index 0000000..769c35d --- /dev/null +++ b/modules/zsh/push.sh @@ -0,0 +1,25 @@ +#!/bin/sh + +# Function to push to all remotes +push_to_all_remotes() { + # Get a list of all remotes + remotes=$(git remote) + + # Check if there are no remotes + if [ -z "$remotes" ]; then + echo "No remotes found." + exit 1 + fi + + # Loop through each remote and push + for remote in $remotes; do + echo "Pushing to remote '$remote'..." + git push "$remote" --all + git push "$remote" --tags + echo "Push to remote '$remote' completed." + done +} + +# Execute the function +push_to_all_remotes + diff --git a/modules/zsh/rebuild.sh b/modules/zsh/rebuild.sh new file mode 100755 index 0000000..d1e741c --- /dev/null +++ b/modules/zsh/rebuild.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +hostname=$(hostname) + +if [[ $hostname == *"desktop"* ]]; then + sudo nixos-rebuild switch --flake ~/nix/#desktop +elif [[ $hostname == *"laptop"* ]]; then + sudo nixos-rebuild switch --flake ~/nix/#laptop +fi