Compare commits

..

10 commits

Author SHA1 Message Date
Lilith
8ec67f8fad
ags 2024-06-11 23:37:41 +02:00
Lilith
3addca47b2
ags 2024-06-11 23:37:17 +02:00
Lilith
e0ef3cba34
ags 2024-06-11 22:04:10 +02:00
Lilith
16ecb2818a
ags 2024-06-11 22:01:32 +02:00
Lilith
157ddf12fc
revert 2024-06-11 21:54:26 +02:00
Lilith
779ae30c60
Merge remote-tracking branch 'refs/remotes/origin/main' 2024-06-11 20:54:38 +02:00
Lilith
18e95cdb6f
update 2024-06-11 20:54:17 +02:00
Spectre
7a0db0a1e0 rm-jpg 2024-06-11 13:02:11 +02:00
Lilith
b66f726ce2
ags 2024-06-11 02:23:25 +02:00
Lilith
b2bcd52da0
tb 2024-06-11 01:45:11 +02:00
15 changed files with 473 additions and 32 deletions

162
flake.lock generated
View file

@ -1,5 +1,23 @@
{ {
"nodes": { "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": { "arkenfox": {
"inputs": { "inputs": {
"flake-compat": "flake-compat", "flake-compat": "flake-compat",
@ -321,7 +339,7 @@
"inputs": { "inputs": {
"crane": "crane", "crane": "crane",
"flake-utils": "flake-utils_3", "flake-utils": "flake-utils_3",
"nixpkgs": "nixpkgs_2", "nixpkgs": "nixpkgs_3",
"rust-overlay": "rust-overlay" "rust-overlay": "rust-overlay"
}, },
"locked": { "locked": {
@ -380,6 +398,28 @@
"type": "github" "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": { "impermanence": {
"locked": { "locked": {
"lastModified": 1717932370, "lastModified": 1717932370,
@ -397,16 +437,16 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1704842529, "lastModified": 1708475490,
"narHash": "sha256-OTeQA+F8d/Evad33JMfuXC89VMetQbsU4qcaePchGr4=", "narHash": "sha256-g1v0TsWBQPX97ziznfJdWhgMyMGtoBFs102xSYO4syU=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "eabe8d3eface69f5bb16c18f8662a702f50c20d5", "rev": "0e74ca98a74bc7270d28838369593635a5db3260",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "NixOS", "owner": "NixOS",
"ref": "nixpkgs-unstable", "ref": "nixos-unstable",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }
@ -444,6 +484,22 @@
} }
}, },
"nixpkgs_2": { "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": { "locked": {
"lastModified": 1709479366, "lastModified": 1709479366,
"narHash": "sha256-n6F0n8UV6lnTZbYPl1A9q1BS0p4hduAv1mGAP17CVd0=", "narHash": "sha256-n6F0n8UV6lnTZbYPl1A9q1BS0p4hduAv1mGAP17CVd0=",
@ -459,7 +515,7 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_3": { "nixpkgs_4": {
"locked": { "locked": {
"lastModified": 1717868076, "lastModified": 1717868076,
"narHash": "sha256-c83Y9t815Wa34khrux81j8K8ET94ESmCuwORSKm2bQY=", "narHash": "sha256-c83Y9t815Wa34khrux81j8K8ET94ESmCuwORSKm2bQY=",
@ -475,7 +531,23 @@
"type": "github" "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": { "locked": {
"lastModified": 1714912032, "lastModified": 1714912032,
"narHash": "sha256-clkcOIkg8G4xuJh+1onLG4HPMpbtzdLv4rHxFzgsH9c=", "narHash": "sha256-clkcOIkg8G4xuJh+1onLG4HPMpbtzdLv4rHxFzgsH9c=",
@ -496,7 +568,7 @@
"flake-compat": "flake-compat_2", "flake-compat": "flake-compat_2",
"flake-utils": "flake-utils", "flake-utils": "flake-utils",
"gitignore": "gitignore", "gitignore": "gitignore",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs_2",
"nixpkgs-stable": "nixpkgs-stable" "nixpkgs-stable": "nixpkgs-stable"
}, },
"locked": { "locked": {
@ -515,17 +587,39 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"ags": "ags",
"arkenfox": "arkenfox", "arkenfox": "arkenfox",
"flake-utils": "flake-utils_2", "flake-utils": "flake-utils_2",
"helix": "helix", "helix": "helix",
"home-manager": "home-manager", "home-manager": "home-manager",
"impermanence": "impermanence", "impermanence": "impermanence",
"nixpkgs": "nixpkgs_3", "nixpkgs": "nixpkgs_4",
"nixpkgs-stable": "nixpkgs-stable_2", "nixpkgs-stable": "nixpkgs-stable_2",
"rose-pine-hyprcursor": "rose-pine-hyprcursor",
"sops-nix": "sops-nix", "sops-nix": "sops-nix",
"stylix": "stylix" "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": { "rust-overlay": {
"inputs": { "inputs": {
"flake-utils": [ "flake-utils": [
@ -586,7 +680,7 @@
"flake-compat": "flake-compat_3", "flake-compat": "flake-compat_3",
"gnome-shell": "gnome-shell", "gnome-shell": "gnome-shell",
"home-manager": "home-manager_2", "home-manager": "home-manager_2",
"nixpkgs": "nixpkgs_4" "nixpkgs": "nixpkgs_6"
}, },
"locked": { "locked": {
"lastModified": 1717866166, "lastModified": 1717866166,
@ -646,6 +740,54 @@
"repo": "default", "repo": "default",
"type": "github" "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", "root": "root",

View file

@ -29,6 +29,9 @@
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils"; inputs.flake-utils.follows = "flake-utils";
}; };
ags.url = "github:Aylur/ags";
rose-pine-hyprcursor.url = "github:ndom91/rose-pine-hyprcursor";
}; };
outputs = { outputs = {

7
home/ags/config.js Normal file
View file

@ -0,0 +1,7 @@
import Bar from widget/bar/bar
App.config({
windows: () => [
...forMonitors(Bar)
]
})

8
home/ags/default.nix Normal file
View file

@ -0,0 +1,8 @@
{ ags, pkgs, ...}: {
imports = [ ags.homeManagerModules.default ];
programs.ags = {
enable = true;
# configDir = /home/lilith/code/widgets; #TODO only for prototyping
};
}

219
home/ags/widgets/bar/bar.js Normal file
View file

@ -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 { }

View file

@ -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;
}

View file

@ -1,5 +1,6 @@
{ {
user = [ user = [
./ags
./alacritty.nix ./alacritty.nix
./clipman.nix ./clipman.nix
./common.nix ./common.nix
@ -16,6 +17,7 @@
./rofi.nix ./rofi.nix
./sops.nix ./sops.nix
./stylix.nix ./stylix.nix
./thunderbird.nix
./zsh ./zsh
]; ];
} }

View file

@ -11,6 +11,7 @@
nativeMessagingHosts = with pkgs; [ nativeMessagingHosts = with pkgs; [
tridactyl-native tridactyl-native
keepassxc
]; ];
policies = { policies = {
@ -120,6 +121,10 @@
profiles.ChatGPT = { profiles.ChatGPT = {
name = "ChatGPT"; name = "ChatGPT";
id = 1; id = 1;
userChrome = ''
#TabsToolbar { visibility: collapse !important; }
#nav-bar { visibility: collapse !important; }
'';
}; };
}; };
} }

View file

@ -19,6 +19,10 @@
"$terminal" = "alacritty"; "$terminal" = "alacritty";
"$fileManager" = "alacritty -e ranger"; "$fileManager" = "alacritty -e ranger";
env = [
"HYPRCURSOR_THEME,rose-pine-hyprcursor"
];
monitor = [ monitor = [
",preferred,1" ",preferred,1"
]; ];
@ -111,24 +115,24 @@
"$mainMod, C, killactive," "$mainMod, C, killactive,"
"$mainMod, backspace, exec, hyprlock" "$mainMod, backspace, exec, hyprlock"
"$mainMod, E, exec, $fileManager" "$mainMod, E, exec, $fileManager"
"$mainMod, O, togglefloating," "$mainMod, A, togglefloating,"
"$mainMod, R, exec, rofi -show drun" "$mainMod, R, exec, rofi -show drun"
"$mainMod, P, pseudo," "$mainMod, D, pseudo,"
"$mainMod, J, togglesplit," "$mainMod, S, togglesplit,"
"$mainMod, K, togglespecialworkspace, keepass" "$mainMod, P, togglespecialworkspace, keepass"
"$mainMod, K, exec, if (( $(pgrep keepassxc -c) < 2 )); then keepassxc; fi" "$mainMod, P, exec, if (( $(pgrep keepassxc -c) < 2 )); then keepassxc; fi"
"$mainMod, M, togglespecialworkspace, chatgpt" "$mainMod, O, 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, 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" ", print, exec, hyprshot -m region -o /home/lilith/sync/screenshots -z"
"CTRL, print, exec, hyprshot -m output -o /home/lilith/sync/screenshots -z" "CTRL, print, exec, hyprshot -m output -o /home/lilith/sync/screenshots -z"
"$mainMod, left, movefocus, l" "$mainMod, H, movefocus, l"
"$mainMod, right, movefocus, r" "$mainMod, L, movefocus, r"
"$mainMod, up, movefocus, u" "$mainMod, K, movefocus, u"
"$mainMod, down, movefocus, d" "$mainMod, J, movefocus, d"
"$mainMod, 1, workspace, 1" "$mainMod, 1, workspace, 1"
"$mainMod, 2, workspace, 2" "$mainMod, 2, workspace, 2"
@ -152,8 +156,8 @@
"$mainMod SHIFT, 9, movetoworkspace, 9" "$mainMod SHIFT, 9, movetoworkspace, 9"
"$mainMod SHIFT, 0, movetoworkspace, 10" "$mainMod SHIFT, 0, movetoworkspace, 10"
"$mainMod, S, togglespecialworkspace, magic" "$mainMod, I, togglespecialworkspace, magic"
"$mainMod SHIFT, S, movetoworkspace, special:magic" "$mainMod SHIFT, I, movetoworkspace, special:magic"
]; ];
bindm = [ bindm = [

View file

@ -20,6 +20,7 @@
obsidian obsidian
vlc vlc
obs-studio
keepassxc keepassxc
ncspot ncspot

11
home/thunderbird.nix Normal file
View file

@ -0,0 +1,11 @@
{conf,...}:{
programs.thunderbird = {
enable = true;
settings = {
};
profiles.${conf.user} = {
isDefault = true;
};
};
}

View file

@ -17,7 +17,5 @@
./syncthing.nix ./syncthing.nix
./wayland.nix ./wayland.nix
./zsh.nix ./zsh.nix
] ++ lib.optionals config.gaming.enable [
./vr.nix
]; ];
} }

View file

@ -11,10 +11,10 @@
}; };
fonts = { fonts = {
# monospace = { monospace = {
# package = pkgs.jetbrains-mono; package = (pkgs.nerdfonts.override {fonts = ["JetBrainsMono"];});
# name = "JetBrainsMono"; name = "JetBrainsMono Nerd Font";
# }; };
emoji = { emoji = {
package = pkgs.twemoji-color-font; package = pkgs.twemoji-color-font;
@ -25,8 +25,8 @@
}; };
cursor = { cursor = {
package = pkgs.bibata-cursors; package = pkgs.rose-pine-cursor;
name = "Bibata theme"; name = "Rosé Pine";
}; };
}; };
} }

View file

@ -17,6 +17,7 @@
hyprlock hyprlock
hypridle hypridle
hyprpaper hyprpaper
hyprcursor
]; ];
xdg.portal = { xdg.portal = {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 MiB