diff --git a/flake.lock b/flake.lock index 7fa6e0e4..2dc988c3 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,23 @@ { "nodes": { + "ags": { + "inputs": { + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1715703984, + "narHash": "sha256-0BZkMui6aCqswMCouvp0G90tAxDOxVnxTvG6TDZsDaI=", + "owner": "Aylur", + "repo": "ags", + "rev": "11150225e62462bcd431d1e55185e810190a730a", + "type": "github" + }, + "original": { + "owner": "Aylur", + "repo": "ags", + "type": "github" + } + }, "arkenfox": { "inputs": { "flake-compat": "flake-compat", @@ -321,7 +339,7 @@ "inputs": { "crane": "crane", "flake-utils": "flake-utils_3", - "nixpkgs": "nixpkgs_2", + "nixpkgs": "nixpkgs_3", "rust-overlay": "rust-overlay" }, "locked": { @@ -380,6 +398,28 @@ "type": "github" } }, + "hyprlang": { + "inputs": { + "nixpkgs": [ + "rose-pine-hyprcursor", + "nixpkgs" + ], + "systems": "systems_4" + }, + "locked": { + "lastModified": 1709914708, + "narHash": "sha256-bR4o3mynoTa1Wi4ZTjbnsZ6iqVcPGriXp56bZh5UFTk=", + "owner": "hyprwm", + "repo": "hyprlang", + "rev": "a685493fdbeec01ca8ccdf1f3655c044a8ce2fe2", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprlang", + "type": "github" + } + }, "impermanence": { "locked": { "lastModified": 1717932370, @@ -397,16 +437,16 @@ }, "nixpkgs": { "locked": { - "lastModified": 1704842529, - "narHash": "sha256-OTeQA+F8d/Evad33JMfuXC89VMetQbsU4qcaePchGr4=", + "lastModified": 1708475490, + "narHash": "sha256-g1v0TsWBQPX97ziznfJdWhgMyMGtoBFs102xSYO4syU=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "eabe8d3eface69f5bb16c18f8662a702f50c20d5", + "rev": "0e74ca98a74bc7270d28838369593635a5db3260", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixpkgs-unstable", + "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" } @@ -444,6 +484,22 @@ } }, "nixpkgs_2": { + "locked": { + "lastModified": 1704842529, + "narHash": "sha256-OTeQA+F8d/Evad33JMfuXC89VMetQbsU4qcaePchGr4=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "eabe8d3eface69f5bb16c18f8662a702f50c20d5", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { "locked": { "lastModified": 1709479366, "narHash": "sha256-n6F0n8UV6lnTZbYPl1A9q1BS0p4hduAv1mGAP17CVd0=", @@ -459,7 +515,7 @@ "type": "github" } }, - "nixpkgs_3": { + "nixpkgs_4": { "locked": { "lastModified": 1717868076, "narHash": "sha256-c83Y9t815Wa34khrux81j8K8ET94ESmCuwORSKm2bQY=", @@ -475,7 +531,23 @@ "type": "github" } }, - "nixpkgs_4": { + "nixpkgs_5": { + "locked": { + "lastModified": 1710272261, + "narHash": "sha256-g0bDwXFmTE7uGDOs9HcJsfLFhH7fOsASbAuOzDC+fhQ=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "0ad13a6833440b8e238947e47bea7f11071dc2b2", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_6": { "locked": { "lastModified": 1714912032, "narHash": "sha256-clkcOIkg8G4xuJh+1onLG4HPMpbtzdLv4rHxFzgsH9c=", @@ -496,7 +568,7 @@ "flake-compat": "flake-compat_2", "flake-utils": "flake-utils", "gitignore": "gitignore", - "nixpkgs": "nixpkgs", + "nixpkgs": "nixpkgs_2", "nixpkgs-stable": "nixpkgs-stable" }, "locked": { @@ -515,17 +587,39 @@ }, "root": { "inputs": { + "ags": "ags", "arkenfox": "arkenfox", "flake-utils": "flake-utils_2", "helix": "helix", "home-manager": "home-manager", "impermanence": "impermanence", - "nixpkgs": "nixpkgs_3", + "nixpkgs": "nixpkgs_4", "nixpkgs-stable": "nixpkgs-stable_2", + "rose-pine-hyprcursor": "rose-pine-hyprcursor", "sops-nix": "sops-nix", "stylix": "stylix" } }, + "rose-pine-hyprcursor": { + "inputs": { + "hyprlang": "hyprlang", + "nixpkgs": "nixpkgs_5", + "utils": "utils" + }, + "locked": { + "lastModified": 1711302328, + "narHash": "sha256-wLuFLI6S5DOretqJN05+kvrs8cbnZKfVLXrJ4hvI/Tg=", + "owner": "ndom91", + "repo": "rose-pine-hyprcursor", + "rev": "7e0473876f0e6d2308813a78fe84a6c6430b112b", + "type": "github" + }, + "original": { + "owner": "ndom91", + "repo": "rose-pine-hyprcursor", + "type": "github" + } + }, "rust-overlay": { "inputs": { "flake-utils": [ @@ -586,7 +680,7 @@ "flake-compat": "flake-compat_3", "gnome-shell": "gnome-shell", "home-manager": "home-manager_2", - "nixpkgs": "nixpkgs_4" + "nixpkgs": "nixpkgs_6" }, "locked": { "lastModified": 1717866166, @@ -646,6 +740,54 @@ "repo": "default", "type": "github" } + }, + "systems_4": { + "locked": { + "lastModified": 1689347949, + "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", + "owner": "nix-systems", + "repo": "default-linux", + "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default-linux", + "type": "github" + } + }, + "systems_5": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "utils": { + "inputs": { + "systems": "systems_5" + }, + "locked": { + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index dfb50dc5..d231969d 100644 --- a/flake.nix +++ b/flake.nix @@ -29,6 +29,9 @@ inputs.nixpkgs.follows = "nixpkgs"; inputs.flake-utils.follows = "flake-utils"; }; + + ags.url = "github:Aylur/ags"; + rose-pine-hyprcursor.url = "github:ndom91/rose-pine-hyprcursor"; }; outputs = { diff --git a/home/ags/config.js b/home/ags/config.js new file mode 100644 index 00000000..9619d219 --- /dev/null +++ b/home/ags/config.js @@ -0,0 +1,7 @@ +import Bar from widget/bar/bar + +App.config({ + windows: () => [ + ...forMonitors(Bar) + ] +}) diff --git a/home/ags/default.nix b/home/ags/default.nix new file mode 100644 index 00000000..de4cec7e --- /dev/null +++ b/home/ags/default.nix @@ -0,0 +1,8 @@ +{ ags, pkgs, ...}: { + imports = [ ags.homeManagerModules.default ]; + + programs.ags = { + enable = true; + # configDir = /home/lilith/code/widgets; #TODO only for prototyping + }; +} diff --git a/home/ags/widgets/bar/bar.js b/home/ags/widgets/bar/bar.js new file mode 100644 index 00000000..4c0a30bb --- /dev/null +++ b/home/ags/widgets/bar/bar.js @@ -0,0 +1,219 @@ +const hyprland = await Service.import("hyprland") +const notifications = await Service.import("notifications") +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."'], +}) + +// widgets can be only assigned as a child in one container +// so to make a reuseable widget, make it a function +// then you can simply instantiate one by calling it + +function Workspaces() { + const activeId = hyprland.active.workspace.bind("id") + const workspaces = hyprland.bind("workspaces") + .as(ws => ws.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(), + }) +} + + +// we don't need dunst or any other notification daemon +// because the Notifications module is a notification daemon itself +function Notification() { + const popups = notifications.bind("popups") + return Widget.Box({ + class_name: "notification", + visible: popups.as(p => p.length > 0), + children: [ + Widget.Icon({ + icon: "preferences-system-notifications-symbolic", + }), + Widget.Label({ + label: popups.as(p => p[0]?.summary || ""), + }), + ], + }) +} + + +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(), + Notification(), + ], + }) +} + +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/home/ags/widgets/bar/style.css b/home/ags/widgets/bar/style.css new file mode 100644 index 00000000..9ac7355b --- /dev/null +++ b/home/ags/widgets/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/home/default.nix b/home/default.nix index 88997e53..ab7444c0 100644 --- a/home/default.nix +++ b/home/default.nix @@ -1,5 +1,6 @@ { user = [ + ./ags ./alacritty.nix ./clipman.nix ./common.nix @@ -16,6 +17,7 @@ ./rofi.nix ./sops.nix ./stylix.nix + ./thunderbird.nix ./zsh ]; } diff --git a/home/firefox.nix b/home/firefox.nix index 41a453f7..32ffa547 100644 --- a/home/firefox.nix +++ b/home/firefox.nix @@ -11,6 +11,7 @@ nativeMessagingHosts = with pkgs; [ tridactyl-native + keepassxc ]; policies = { @@ -120,6 +121,10 @@ profiles.ChatGPT = { name = "ChatGPT"; id = 1; + userChrome = '' + #TabsToolbar { visibility: collapse !important; } + #nav-bar { visibility: collapse !important; } + ''; }; }; } diff --git a/home/hyprland/default.nix b/home/hyprland/default.nix index a7be6d1a..929f716e 100644 --- a/home/hyprland/default.nix +++ b/home/hyprland/default.nix @@ -19,6 +19,10 @@ "$terminal" = "alacritty"; "$fileManager" = "alacritty -e ranger"; + env = [ + "HYPRCURSOR_THEME,rose-pine-hyprcursor" + ]; + monitor = [ ",preferred,1" ]; @@ -111,24 +115,24 @@ "$mainMod, C, killactive," "$mainMod, backspace, exec, hyprlock" "$mainMod, E, exec, $fileManager" - "$mainMod, O, togglefloating," + "$mainMod, A, togglefloating," "$mainMod, R, exec, rofi -show drun" - "$mainMod, P, pseudo," - "$mainMod, J, togglesplit," + "$mainMod, D, pseudo," + "$mainMod, S, togglesplit," - "$mainMod, K, togglespecialworkspace, keepass" - "$mainMod, K, exec, if (( $(pgrep keepassxc -c) < 2 )); then keepassxc; fi" + "$mainMod, P, togglespecialworkspace, keepass" + "$mainMod, P, exec, if (( $(pgrep keepassxc -c) < 2 )); then keepassxc; fi" - "$mainMod, M, togglespecialworkspace, chatgpt" - "$mainMod, M, exec, [workspace special:chatgpt] pgrep firefox | xargs ps -fp | grep -- '-P ChatGPT --url chat.openai.com' || firefox -P ChatGPT --url chat.openai.com" + "$mainMod, O, togglespecialworkspace, chatgpt" + "$mainMod, O, exec, [workspace special:chatgpt] pgrep firefox | xargs ps -fp | grep -- '-P ChatGPT --url chat.openai.com' || firefox -P ChatGPT --url chat.openai.com" ", print, exec, hyprshot -m region -o /home/lilith/sync/screenshots -z" "CTRL, print, exec, hyprshot -m output -o /home/lilith/sync/screenshots -z" - - "$mainMod, left, movefocus, l" - "$mainMod, right, movefocus, r" - "$mainMod, up, movefocus, u" - "$mainMod, down, movefocus, d" + + "$mainMod, H, movefocus, l" + "$mainMod, L, movefocus, r" + "$mainMod, K, movefocus, u" + "$mainMod, J, movefocus, d" "$mainMod, 1, workspace, 1" "$mainMod, 2, workspace, 2" @@ -152,8 +156,8 @@ "$mainMod SHIFT, 9, movetoworkspace, 9" "$mainMod SHIFT, 0, movetoworkspace, 10" - "$mainMod, S, togglespecialworkspace, magic" - "$mainMod SHIFT, S, movetoworkspace, special:magic" + "$mainMod, I, togglespecialworkspace, magic" + "$mainMod SHIFT, I, movetoworkspace, special:magic" ]; bindm = [ diff --git a/home/packages.nix b/home/packages.nix index d54fb372..06dc1c52 100644 --- a/home/packages.nix +++ b/home/packages.nix @@ -20,6 +20,7 @@ obsidian vlc + obs-studio keepassxc ncspot diff --git a/home/thunderbird.nix b/home/thunderbird.nix new file mode 100644 index 00000000..779ba017 --- /dev/null +++ b/home/thunderbird.nix @@ -0,0 +1,11 @@ +{conf,...}:{ + programs.thunderbird = { + enable = true; + settings = { + + }; + profiles.${conf.user} = { + isDefault = true; + }; + }; +} diff --git a/system/full.nix b/system/full.nix index 8d2fb779..e94577a6 100644 --- a/system/full.nix +++ b/system/full.nix @@ -17,7 +17,5 @@ ./syncthing.nix ./wayland.nix ./zsh.nix - ] ++ lib.optionals config.gaming.enable [ - ./vr.nix ]; } diff --git a/system/stylix.nix b/system/stylix.nix index 494365fc..a0648988 100644 --- a/system/stylix.nix +++ b/system/stylix.nix @@ -11,10 +11,10 @@ }; fonts = { - # monospace = { - # package = pkgs.jetbrains-mono; - # name = "JetBrainsMono"; - # }; + monospace = { + package = (pkgs.nerdfonts.override {fonts = ["JetBrainsMono"];}); + name = "JetBrainsMono Nerd Font"; + }; emoji = { package = pkgs.twemoji-color-font; @@ -25,8 +25,8 @@ }; cursor = { - package = pkgs.bibata-cursors; - name = "Bibata theme"; + package = pkgs.rose-pine-cursor; + name = "Rosé Pine"; }; }; } diff --git a/system/wayland.nix b/system/wayland.nix index 96f2c47d..a66324b3 100644 --- a/system/wayland.nix +++ b/system/wayland.nix @@ -17,6 +17,7 @@ hyprlock hypridle hyprpaper + hyprcursor ]; xdg.portal = { diff --git a/wallpapers/default.jpg b/wallpapers/default.jpg deleted file mode 100644 index 513d51f5..00000000 Binary files a/wallpapers/default.jpg and /dev/null differ