Merge branch 'master' of git.thomasave.be:thomasave/dotfiles
This commit is contained in:
commit
d773883c02
83
flake.lock
83
flake.lock
|
@ -3,14 +3,15 @@
|
||||||
"ags": {
|
"ags": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"astal": "astal",
|
"astal": "astal",
|
||||||
|
"gnim": "gnim",
|
||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": "nixpkgs"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1744557573,
|
"lastModified": 1751930350,
|
||||||
"narHash": "sha256-XAyj0iDuI51BytJ1PwN53uLpzTDdznPDQFG4RwihlTQ=",
|
"narHash": "sha256-hBIrzyrwG3XjeNyzVNWKDX+yYVlpwAqf9ovgF7qecug=",
|
||||||
"owner": "aylur",
|
"owner": "aylur",
|
||||||
"repo": "ags",
|
"repo": "ags",
|
||||||
"rev": "3ed9737bdbc8fc7a7c7ceef2165c9109f336bff6",
|
"rev": "22f37ccb0db58d9d8a11ad0054ab20ecfad005ad",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -27,11 +28,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1742571008,
|
"lastModified": 1751126708,
|
||||||
"narHash": "sha256-5WgfJAeBpxiKbTR/gJvxrGYfqQRge5aUDcGKmU1YZ1Q=",
|
"narHash": "sha256-AodIKw7TmI7rHVcOfEsO82stupMYIMVQeLAUQfVxnkU=",
|
||||||
"owner": "aylur",
|
"owner": "aylur",
|
||||||
"repo": "astal",
|
"repo": "astal",
|
||||||
"rev": "dc0e5d37abe9424c53dcbd2506a4886ffee6296e",
|
"rev": "ac90f09385a2295da9fdc108aaba4a317aaeacc7",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -122,6 +123,22 @@
|
||||||
"url": "https://git.thomasave.be/thomasave/fzgo.git"
|
"url": "https://git.thomasave.be/thomasave/fzgo.git"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"gnim": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1751928958,
|
||||||
|
"narHash": "sha256-vQY2L+Hnp6F1MHFa3UbMft1goGw3iODI5M+96Z7P+9Q=",
|
||||||
|
"owner": "aylur",
|
||||||
|
"repo": "gnim",
|
||||||
|
"rev": "9bffa83f52f711b13e3c139454623a9aea4f5552",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "aylur",
|
||||||
|
"repo": "gnim",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"home-manager": {
|
"home-manager": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
|
@ -129,11 +146,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1748925027,
|
"lastModified": 1751990210,
|
||||||
"narHash": "sha256-BJ0qRIdvt5aeqm3zg/5if7b5rruG05zrSX3UpLqjDRk=",
|
"narHash": "sha256-krWErNDl9ggMLSfK00Q2BcoSk3+IRTSON/DiDgUzzMw=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "cb809ec1ff15cf3237c6592af9bbc7e4d983e98c",
|
"rev": "218da00bfa73f2a61682417efe74549416c16ba6",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -165,11 +182,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1743583204,
|
"lastModified": 1751792365,
|
||||||
"narHash": "sha256-F7n4+KOIfWrwoQjXrL2wD9RhFYLs2/GGe/MQY1sSdlE=",
|
"narHash": "sha256-J1kI6oAj25IG4EdVlg2hQz8NZTBNYvIS0l4wpr9KcUo=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "2c8d3f48d33929642c1c12cd243df4cc7d2ce434",
|
"rev": "1fd8bada0b6117e6c7eb54aad5813023eed37ccb",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -197,11 +214,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs_3": {
|
"nixpkgs_3": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1748693115,
|
"lastModified": 1751792365,
|
||||||
"narHash": "sha256-StSrWhklmDuXT93yc3GrTlb0cKSS0agTAxMGjLKAsY8=",
|
"narHash": "sha256-J1kI6oAj25IG4EdVlg2hQz8NZTBNYvIS0l4wpr9KcUo=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "910796cabe436259a29a72e8d3f5e180fc6dfacc",
|
"rev": "1fd8bada0b6117e6c7eb54aad5813023eed37ccb",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -213,11 +230,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs_4": {
|
"nixpkgs_4": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1748693115,
|
"lastModified": 1751792365,
|
||||||
"narHash": "sha256-StSrWhklmDuXT93yc3GrTlb0cKSS0agTAxMGjLKAsY8=",
|
"narHash": "sha256-J1kI6oAj25IG4EdVlg2hQz8NZTBNYvIS0l4wpr9KcUo=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "910796cabe436259a29a72e8d3f5e180fc6dfacc",
|
"rev": "1fd8bada0b6117e6c7eb54aad5813023eed37ccb",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -246,15 +263,14 @@
|
||||||
"nur": {
|
"nur": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-parts": "flake-parts_2",
|
"flake-parts": "flake-parts_2",
|
||||||
"nixpkgs": "nixpkgs_4",
|
"nixpkgs": "nixpkgs_4"
|
||||||
"treefmt-nix": "treefmt-nix"
|
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1748943257,
|
"lastModified": 1752056583,
|
||||||
"narHash": "sha256-44lxtii7wjgu/rEsE5PD3uVbjn52ASUT4vAB0RiL1Jg=",
|
"narHash": "sha256-dtBwaZET1p20izsqoIDnx7BzU25t7AwaoVmnCgv9kqw=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "NUR",
|
"repo": "NUR",
|
||||||
"rev": "33a35d4d8e1f6c01c4bd10aae0f3ac3e085e1737",
|
"rev": "9db2aa1b8673461fef354c788abe40e0973b0427",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -274,27 +290,6 @@
|
||||||
"worktimer": "worktimer"
|
"worktimer": "worktimer"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"treefmt-nix": {
|
|
||||||
"inputs": {
|
|
||||||
"nixpkgs": [
|
|
||||||
"nur",
|
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1733222881,
|
|
||||||
"narHash": "sha256-JIPcz1PrpXUCbaccEnrcUS8jjEb/1vJbZz5KkobyFdM=",
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "treefmt-nix",
|
|
||||||
"rev": "49717b5af6f80172275d47a418c9719a31a78b53",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "treefmt-nix",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"worktimer": {
|
"worktimer": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-parts": "flake-parts_3",
|
"flake-parts": "flake-parts_3",
|
||||||
|
|
|
@ -45,9 +45,9 @@ in
|
||||||
|
|
||||||
wayland.windowManager.hyprland.settings = {
|
wayland.windowManager.hyprland.settings = {
|
||||||
monitor = [
|
monitor = [
|
||||||
"eDP-1,2880x1800@120.00Hz,0x0,1.2"
|
"eDP-1,2880x1800@120.00Hz,0x284,1.2,vrr,1"
|
||||||
"DP-1,3840x2160@60.00Hz,0x-2160,1"
|
"DP-1,1920x1080,6240x500,1"
|
||||||
"HDMI-A-1,3840x2160@60.00Hz,0x-2160,1"
|
"HDMI-A-1,3840x2160@60.00Hz,2400x0,1"
|
||||||
];
|
];
|
||||||
bind = [
|
bind = [
|
||||||
", XF86PowerOff, exec, ${pkgs.rofi}/bin/rofi -show power-menu -modi power-menu:${
|
", XF86PowerOff, exec, ${pkgs.rofi}/bin/rofi -show power-menu -modi power-menu:${
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
{
|
{
|
||||||
# add the home manager module
|
# add the home manager module
|
||||||
imports = [ inputs.ags.homeManagerModules.default ];
|
imports = [ inputs.ags.homeManagerModules.default ];
|
||||||
|
|
||||||
programs.ags = {
|
programs.ags = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
|
@ -10,8 +9,8 @@
|
||||||
|
|
||||||
extraPackages = with inputs.ags.packages.${pkgs.system}; [
|
extraPackages = with inputs.ags.packages.${pkgs.system}; [
|
||||||
pkgs.gtksourceview
|
pkgs.gtksourceview
|
||||||
pkgs.webkitgtk
|
|
||||||
pkgs.accountsservice
|
pkgs.accountsservice
|
||||||
|
pkgs.libadwaita
|
||||||
|
|
||||||
battery
|
battery
|
||||||
hyprland
|
hyprland
|
||||||
|
|
|
@ -1,11 +1,15 @@
|
||||||
import { App, Astal, Gdk, Gtk, Widget } from "astal/gtk3";
|
import { Astal, Gdk } from "ags/gtk4";
|
||||||
import { GLib, Variable, bind } from "astal";
|
import app from "ags/gtk4/app"
|
||||||
|
import Gtk from "gi://Gtk?version=4.0"
|
||||||
|
import { createBinding, createState, For, With, Accessor } from "ags"
|
||||||
|
import { createPoll } from "ags/time"
|
||||||
import Tray from "gi://AstalTray";
|
import Tray from "gi://AstalTray";
|
||||||
import { execAsync } from "astal/process"
|
import { execAsync } from "ags/process"
|
||||||
import Hyprland from "gi://AstalHyprland";
|
import Hyprland from "gi://AstalHyprland";
|
||||||
import { getIconName } from "./utils";
|
import { getIconName } from "./utils";
|
||||||
import Wp from "gi://AstalWp"
|
import Wp from "gi://AstalWp"
|
||||||
import Battery from "gi://AstalBattery"
|
import Battery from "gi://AstalBattery"
|
||||||
|
import GLib from "gi://GLib";
|
||||||
|
|
||||||
const battery = Battery.get_default()
|
const battery = Battery.get_default()
|
||||||
const sensorsAvailable = await execAsync(['sensors']).then(() => true).catch(() => false);
|
const sensorsAvailable = await execAsync(['sensors']).then(() => true).catch(() => false);
|
||||||
|
@ -13,28 +17,35 @@ const wirePlumber = Wp.get_default();
|
||||||
|
|
||||||
function SysTray(): JSX.Element {
|
function SysTray(): JSX.Element {
|
||||||
const tray = Tray.get_default();
|
const tray = Tray.get_default();
|
||||||
|
let items = createBinding(tray, "items");
|
||||||
|
const init = (btn: Gtk.MenuButton, item: Tray.TrayItem) => {
|
||||||
|
btn.menuModel = item.menuModel
|
||||||
|
btn.insert_action_group("dbusmenu", item.actionGroup)
|
||||||
|
item.connect("notify::action-group", () => {
|
||||||
|
btn.insert_action_group("dbusmenu", item.actionGroup)
|
||||||
|
})
|
||||||
|
}
|
||||||
return (
|
return (
|
||||||
<box>
|
<box>
|
||||||
{bind(tray, "items").as((items) =>
|
<For each={items}>
|
||||||
items.map((item) => {
|
{(item: Tray.TrayItem) => {
|
||||||
if (item.iconThemePath) App.add_icons(item.iconThemePath);
|
if (item.iconThemePath) app.add_icons(item.iconThemePath);
|
||||||
return (
|
return (
|
||||||
<menubutton
|
<menubutton
|
||||||
className="systray"
|
$={(self) => init(self, item)}
|
||||||
tooltipMarkup={bind(item, "tooltipMarkup")}
|
class="systray"
|
||||||
usePopover={false}
|
tooltipMarkup={createBinding(item, "tooltipMarkup")}
|
||||||
actionGroup={bind(item, "actionGroup").as(ag => ["dbusmenu", ag])}
|
menuModel={createBinding(item, "menuModel")}>
|
||||||
menuModel={bind(item, "menuModel")}>
|
<image gicon={item.gicon} class="systray-item" />
|
||||||
<icon gicon={bind(item, "gicon")} className="systray-item" />
|
|
||||||
</menubutton>
|
</menubutton>
|
||||||
);
|
);
|
||||||
}),
|
}}
|
||||||
)}
|
</For>
|
||||||
</box>
|
</box>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function Left() : JSX.Element {
|
function Left(): JSX.Element {
|
||||||
return (
|
return (
|
||||||
<box hexpand halign={Gtk.Align.START}>
|
<box hexpand halign={Gtk.Align.START}>
|
||||||
<Clients />
|
<Clients />
|
||||||
|
@ -42,7 +53,7 @@ function Left() : JSX.Element {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function Center() : JSX.Element {
|
function Center(): JSX.Element {
|
||||||
return (
|
return (
|
||||||
<box>
|
<box>
|
||||||
<Workspaces />
|
<Workspaces />
|
||||||
|
@ -51,85 +62,77 @@ function Center() : JSX.Element {
|
||||||
}
|
}
|
||||||
|
|
||||||
function Date({ format = "%Y-%m-%d" }): JSX.Element {
|
function Date({ format = "%Y-%m-%d" }): JSX.Element {
|
||||||
const time = Variable<string>("").poll(60000, () =>
|
const time = createPoll<string>("", 60000, () => GLib.DateTime.new_now_local().format(format)!)
|
||||||
GLib.DateTime.new_now_local().format(format)!)
|
|
||||||
return <button
|
return <button
|
||||||
className="item"
|
class="item"
|
||||||
onDestroy={() => time.drop()}
|
label={time}
|
||||||
label={time()}
|
|
||||||
onClicked={() => execAsync(['gnome-calendar'])}
|
onClicked={() => execAsync(['gnome-calendar'])}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
|
|
||||||
function Time({ format = "%H:%M:%S" }): JSX.Element {
|
function Time({ format = "%H:%M:%S" }): JSX.Element {
|
||||||
const time = Variable<string>("").poll(1000, () =>
|
const time = createPoll<string>("", 1000, () => GLib.DateTime.new_now_local().format(format)!)
|
||||||
GLib.DateTime.new_now_local().format(format)!)
|
|
||||||
return <label
|
return <label
|
||||||
className="item blue"
|
class="item blue"
|
||||||
onDestroy={() => time.drop()}
|
label={time}
|
||||||
label={time()}
|
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
|
|
||||||
function Temp(): JSX.Element {
|
function Temp(): JSX.Element {
|
||||||
let label = Variable<string>("N/A");
|
let [label, _setlabel] = createState<string>("N/A");
|
||||||
if (sensorsAvailable) {
|
if (sensorsAvailable) {
|
||||||
label = Variable<string>("").poll(5000, 'sensors', out => {
|
label = createPoll<string>("", 3000, 'sensors', out => {
|
||||||
const match = out.split('\n').find(line => line.includes('Tctl') || line.includes('Package'))?.match(/[0-9.]*°C/);
|
const match = out.split('\n').find(line => line.includes('Tctl') || line.includes('Package'))?.match(/[0-9.]*°C/);
|
||||||
return match ? match[0] : "N/A";
|
return match ? match[0] : "N/A";
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
return <label
|
return <label
|
||||||
className="item blue"
|
class="item blue"
|
||||||
onDestroy={() => label.drop()}
|
label={label}
|
||||||
label={label()}
|
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
|
|
||||||
function Memory(): JSX.Element {
|
function Memory(): JSX.Element {
|
||||||
const memory = Variable<string>("").poll(2000, "free", out => {
|
const memory = createPoll<string>("", 2000, "free", out => {
|
||||||
const line = out.split('\n').find(line => line.includes('Mem:'));
|
const line = out.split('\n').find(line => line.includes('Mem:'));
|
||||||
if (!line) return "N/A";
|
if (!line) return "N/A";
|
||||||
const split = line.split(/\s+/).map(Number);
|
const split = line.split(/\s+/).map(Number);
|
||||||
return (split[2] / 1000000).toFixed(2) + "GB";
|
return (split[2] / 1000000).toFixed(2) + "GB";
|
||||||
});
|
});
|
||||||
return <label
|
return <label
|
||||||
className="item blue"
|
class="item blue"
|
||||||
onDestroy={() => memory.drop()}
|
label={memory}
|
||||||
label={memory()}
|
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
|
|
||||||
function ClockSpeed(): JSX.Element {
|
function ClockSpeed(): JSX.Element {
|
||||||
const command = 'bash -c "cat /proc/cpuinfo | grep \\"MHz\\" | awk \'{print \\$4}\' | sort -n | tail -1 | awk \'{printf \\"%.2fGHz\\", \\$1/1000}\'"';
|
const command = 'bash -c "cat /proc/cpuinfo | grep \\"MHz\\" | awk \'{print \\$4}\' | sort -n | tail -1 | awk \'{printf \\"%.2fGHz\\", \\$1/1000}\'"';
|
||||||
const speed = Variable<string>("").poll(5000, command)
|
const speed = createPoll<string>("", 1000, command, out => out)
|
||||||
return <label
|
return <label
|
||||||
className="item"
|
class="item"
|
||||||
onDestroy={() => speed.drop()}
|
label={speed}
|
||||||
label={speed()}
|
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
|
|
||||||
function CPU(): JSX.Element {
|
function CPU(): JSX.Element {
|
||||||
const usage = Variable<string>("").poll(2000, "top -b -n 1", out => {
|
const usage = createPoll<string>("", 2000, "top -b -n 1", out => {
|
||||||
const line = out.split("\n").find(line => line.includes('Cpu(s)'));
|
const line = out.split("\n").find(line => line.includes('Cpu(s)'));
|
||||||
if (!line) return "N/A";
|
if (!line) return "N/A";
|
||||||
return line.split(/\s+/)[1].replace(',', '.').toString() + "%";
|
return line.split(/\s+/)[1].replace(',', '.').toString() + "%";
|
||||||
});
|
});
|
||||||
return <box className="item">
|
return <box class="item">
|
||||||
<icon icon="speedometer" css="margin-right: 0.7em;" />
|
<image iconName="speedometer" css="margin-right: 0.7em;" />
|
||||||
<label
|
<label
|
||||||
onDestroy={() => usage.drop()}
|
label={usage}
|
||||||
label={usage()}
|
|
||||||
/>
|
/>
|
||||||
</box>
|
</box>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function Right() : JSX.Element {
|
function Right() {
|
||||||
return (
|
return (
|
||||||
<box className="right" hexpand halign={Gtk.Align.END} spacing={6}>
|
<box class="right" hexpand halign={Gtk.Align.END} spacing={6}>
|
||||||
<Icons />
|
<Icons />
|
||||||
<Volume />
|
<Volume />
|
||||||
<CPU />
|
<CPU />
|
||||||
|
@ -144,25 +147,26 @@ function Right() : JSX.Element {
|
||||||
|
|
||||||
function BatteryIcon(): JSX.Element {
|
function BatteryIcon(): JSX.Element {
|
||||||
if (battery.get_state() == 0) return <box />;
|
if (battery.get_state() == 0) return <box />;
|
||||||
return <button className="battery-item" onClicked={() => execAsync(['gnome-power-statistics'])}>
|
let batteryPercentage = createBinding(battery, "percentage");
|
||||||
|
return <button class="battery-item" onClicked={() => execAsync(['gnome-power-statistics'])}>
|
||||||
<box>
|
<box>
|
||||||
{
|
<With value={batteryPercentage}>
|
||||||
bind(battery, "percentage").as((percentage) => {
|
{(percentage) => {
|
||||||
const thresholds = [...Array(11).keys()].map( i => i * 10);
|
const thresholds = [...Array(11).keys()].map(i => i * 10);
|
||||||
const icon = thresholds.find(threshold => threshold >= percentage * 100)
|
const icon = thresholds.find(threshold => threshold >= percentage * 100)
|
||||||
const charging_name = battery.percentage >= 0.99 ? "charged" : "charging"
|
const charging_name = battery.percentage >= 0.99 ? "charged" : "charging"
|
||||||
return <icon
|
return <image
|
||||||
icon={battery.charging? `battery-level-${icon}-${charging_name}-symbolic` : `battery-level-${icon}-symbolic`}
|
iconName={battery.charging ? `battery-level-${icon}-${charging_name}-symbolic` : `battery-level-${icon}-symbolic`}
|
||||||
/>
|
/>
|
||||||
})
|
}}
|
||||||
}
|
</With>
|
||||||
</box>
|
</box>
|
||||||
</button>
|
</button>
|
||||||
}
|
}
|
||||||
|
|
||||||
function Icons() {
|
function Icons() {
|
||||||
return (
|
return (
|
||||||
<box className="item icon-group">
|
<box class="item icon-group">
|
||||||
<SysTray />
|
<SysTray />
|
||||||
<BatteryIcon />
|
<BatteryIcon />
|
||||||
</box>
|
</box>
|
||||||
|
@ -173,60 +177,74 @@ function Volume(): JSX.Element {
|
||||||
if (!wirePlumber) return <box />;
|
if (!wirePlumber) return <box />;
|
||||||
|
|
||||||
const audio = wirePlumber.audio;
|
const audio = wirePlumber.audio;
|
||||||
const icon = bind(audio.default_speaker, "volume").as((volume) => {
|
const icon = createBinding(audio.default_speaker, "volume").as((volume) => {
|
||||||
const vol = volume * 100
|
const vol = volume * 100
|
||||||
const icon = [
|
const icon = [
|
||||||
[101, 'overamplified'],
|
[101, 'overamplified'],
|
||||||
[67, 'high'],
|
[67, 'high'],
|
||||||
[34, 'medium'],
|
[34, 'medium'],
|
||||||
[1, 'low'],
|
[1, 'low'],
|
||||||
[0, 'muted'],
|
[0, 'muted'],
|
||||||
].find(([threshold]) => Number(threshold) <= vol)?.[1]
|
].find(([threshold]) => Number(threshold) <= vol)?.[1]
|
||||||
return `audio-volume-${icon}-symbolic`
|
return `audio-volume-${icon}-symbolic`
|
||||||
});
|
});
|
||||||
const css = bind(audio.default_speaker, "mute").as((mute) => {
|
const css = createBinding(audio.default_speaker, "mute").as((mute) => {
|
||||||
return mute ? "margin-left:0;": "margin-left: 0.7em;"
|
return mute ? "margin-left:0;" : "margin-left: 0.7em;"
|
||||||
});
|
});
|
||||||
|
let volume = createBinding(audio.default_speaker, "volume");
|
||||||
|
let mute = createBinding(audio.default_speaker, "mute");
|
||||||
return (
|
return (
|
||||||
<button className="item blue" onClicked={() => audio.default_speaker.mute = !audio.default_speaker.mute}>
|
<button class="item blue" onClicked={() => audio.default_speaker.mute = !audio.default_speaker.mute}>
|
||||||
<box>
|
<box>
|
||||||
<icon icon={icon} />
|
<image iconName={icon} />
|
||||||
{
|
<With value={volume}>
|
||||||
bind(audio.default_speaker, "volume").as((volume) => <box>
|
{(vol) => <box>
|
||||||
{
|
<With value={mute}>
|
||||||
bind(audio.default_speaker, "mute").as((mute) => <box>
|
{(muted) => {
|
||||||
{
|
return (
|
||||||
<label label={mute? "": `${Math.floor(volume * 100)}%`} css={css} />
|
<label label={muted ? "" : `${Math.floor(vol * 100)}%`} css={css} />
|
||||||
}
|
)
|
||||||
</box>)
|
}}
|
||||||
}
|
</With>
|
||||||
</box>)
|
</box>}
|
||||||
}
|
</With>
|
||||||
</box>
|
</box>
|
||||||
</button>
|
</button>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function Workspaces() : JSX.Element {
|
function Workspaces(): JSX.Element {
|
||||||
const hyprland = Hyprland.get_default();
|
const hyprland = Hyprland.get_default();
|
||||||
|
let workspaces = createBinding(hyprland, "workspaces");
|
||||||
return (
|
return (
|
||||||
<box className="workspaces">
|
<box class="workspaces">
|
||||||
{bind(hyprland, "workspaces").as((wss) =>
|
<With value={workspaces}>
|
||||||
<box>
|
{(wss: Array<Hyprland.Workspace>) => (
|
||||||
{bind(hyprland, "focusedMonitor").as((fm) =>
|
<box>
|
||||||
wss.sort((a, b) => a.id - b.id)
|
<With value={createBinding(hyprland, "focusedMonitor")}>
|
||||||
.filter(ws => ws && ws.get_monitor() && ws.get_monitor().get_id() === fm.get_id())
|
{(fm: Hyprland.Monitor) => {
|
||||||
.map((ws) => (
|
let filtered_wss = new Accessor(() => wss.sort((a, b) => a.id - b.id)
|
||||||
<button
|
.filter(ws => ws && ws.get_monitor() && ws.get_monitor().get_id() === fm.get_id()))
|
||||||
className={bind(hyprland, "focusedWorkspace").as((fw) => ws === fw ? "focused" : "",)}
|
return (
|
||||||
onClicked={() => ws.focus()}
|
<box>
|
||||||
>
|
<For each={filtered_wss}>
|
||||||
{`${ws.id}`.slice(-1)}
|
{(ws: Hyprland.Workspace, _index) => (
|
||||||
</button>
|
<button
|
||||||
)))}
|
class={createBinding(hyprland, "focusedWorkspace").as((fw) => ws === fw ? "focused" : "",)}
|
||||||
</box>
|
onClicked={() => ws.focus()}
|
||||||
)}
|
>
|
||||||
|
{`${ws.id}`.slice(-1)}
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
|
</For>
|
||||||
|
</box>
|
||||||
|
)
|
||||||
|
}}
|
||||||
|
</With>
|
||||||
|
</box>
|
||||||
|
)}
|
||||||
|
</With>
|
||||||
</box>
|
</box>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -235,59 +253,66 @@ function shorten(title: string) {
|
||||||
return title.length > 40 ? title.slice(0, 20) + "..." : title
|
return title.length > 40 ? title.slice(0, 20) + "..." : title
|
||||||
}
|
}
|
||||||
|
|
||||||
function Clients() : JSX.Element {
|
function Clients(): JSX.Element {
|
||||||
const hyprland = Hyprland.get_default();
|
const hyprland = Hyprland.get_default();
|
||||||
|
let clients = createBinding(hyprland, "clients")
|
||||||
return (
|
return (
|
||||||
<box>
|
<box>
|
||||||
{
|
<With value={createBinding(hyprland, "focusedWorkspace")}>
|
||||||
bind(hyprland, "focusedWorkspace").as(fw => (
|
{(fw: Hyprland.Workspace) => (
|
||||||
<box className="clients">
|
<box class="clients">
|
||||||
{
|
<With value={clients}>
|
||||||
bind(hyprland, "clients").as(cls =>
|
{(cls: Array<Hyprland.Client>) => {
|
||||||
cls
|
let filtered_clients = new Accessor(() => cls
|
||||||
.sort((a, b) => a.pid - b.pid)
|
.sort((a, b) => a.pid - b.pid)
|
||||||
.filter(cl => !cl.title.includes("rofi"))
|
.filter(cl => !cl.title.includes("rofi"))
|
||||||
.filter(cl => fw && cl.get_workspace().get_id() === fw.get_id())
|
.filter(cl => fw && cl.get_workspace().get_id() === fw.get_id()))
|
||||||
.map(cl => (
|
|
||||||
<box
|
return (
|
||||||
className={bind(hyprland, "focusedClient").as(a => a && a.address === cl.address ? "focused" : "unfocused")}
|
<box>
|
||||||
>
|
<For each={filtered_clients}>
|
||||||
<icon
|
{(cl: Hyprland.Client, _index) => (
|
||||||
icon={getIconName(cl)}
|
<box
|
||||||
className="app-icon"
|
class={createBinding(hyprland, "focusedClient").as(a => a && a.address === cl.address ? "focused" : "unfocused")}
|
||||||
/>
|
>
|
||||||
<label label={bind(cl, 'title').as(title => shorten(title))} />
|
<image
|
||||||
|
iconName={getIconName(cl)}
|
||||||
|
class="app-icon"
|
||||||
|
/>
|
||||||
|
<label label={createBinding(cl, 'title').as(title => shorten(title))} />
|
||||||
|
</box>
|
||||||
|
)}
|
||||||
|
</For>
|
||||||
</box>
|
</box>
|
||||||
)
|
)
|
||||||
)
|
}
|
||||||
)
|
}
|
||||||
|
</With>
|
||||||
}
|
|
||||||
</box>
|
</box>
|
||||||
)
|
)
|
||||||
)
|
}
|
||||||
}
|
</With >
|
||||||
</box>
|
</box >
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function Bar(gdkmonitor: Gdk.Monitor, scaleFactor: number = 1): Widget.Window {
|
export default function Bar(gdkmonitor: Gdk.Monitor, scaleFactor: number = 1) {
|
||||||
return new Widget.Window({
|
console.log("Creating Bar on monitor:", gdkmonitor);
|
||||||
gdkmonitor,
|
return (
|
||||||
css: "font-size: " + scaleFactor + "em;",
|
<window
|
||||||
exclusivity: Astal.Exclusivity.EXCLUSIVE,
|
visible
|
||||||
anchor: Astal.WindowAnchor.TOP | Astal.WindowAnchor.LEFT | Astal.WindowAnchor.RIGHT,
|
gdkmonitor={gdkmonitor}
|
||||||
application: App,
|
css={"font-size: " + scaleFactor + "em;"}
|
||||||
className: "Bar",
|
exclusivity={Astal.Exclusivity.EXCLUSIVE}
|
||||||
name: "top-bar",
|
anchor={Astal.WindowAnchor.TOP | Astal.WindowAnchor.LEFT | Astal.WindowAnchor.RIGHT}
|
||||||
setup: self => self.connect("destroy", () => {
|
application={app}
|
||||||
print("Detroying bar");
|
class="Bar"
|
||||||
App.remove_window(self);
|
name="top-bar" >
|
||||||
}),
|
<centerbox class="window-box">
|
||||||
child: <centerbox className="window-box">
|
<Left $type="start" />
|
||||||
<Left />
|
<Center $type="center" />
|
||||||
<Center />
|
<Right $type="end" />
|
||||||
<Right />
|
|
||||||
</centerbox>
|
</centerbox>
|
||||||
})
|
</window >
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
import { App, Gdk, Widget } from "astal/gtk3"
|
import app from "ags/gtk4/app"
|
||||||
import style from "./style.scss"
|
import style from "./style.scss"
|
||||||
import Bar from "./Bar"
|
import Bar from "./Bar"
|
||||||
import Hyprland from "gi://AstalHyprland";
|
import Hyprland from "gi://AstalHyprland";
|
||||||
import NotificationPopups from "./notifications/NotificationPopups"
|
import NotificationPopups from "./notifications/NotificationPopups"
|
||||||
|
import Gtk from "gi://Gtk?version=4.0";
|
||||||
|
import { Gdk } from "ags/gtk4";
|
||||||
|
|
||||||
const hyprland = Hyprland.get_default();
|
const hyprland = Hyprland.get_default();
|
||||||
|
|
||||||
|
@ -22,21 +24,26 @@ function find_main_monitor(): Hyprland.Monitor {
|
||||||
}
|
}
|
||||||
|
|
||||||
function register_windows(monitor: Hyprland.Monitor) {
|
function register_windows(monitor: Hyprland.Monitor) {
|
||||||
let gtkMonitor = App.get_monitors()[0].get_display().get_monitor_at_point(monitor.get_x(), monitor.get_y())
|
let gtkMonitors = app.get_monitors()[0].get_display().get_monitors()
|
||||||
let scale = (monitor.get_width() >= 3000)? 1.2: 1
|
let gtkMonitor = gtkMonitors.get_item(0)
|
||||||
|
if (!gtkMonitor) {
|
||||||
|
console.error("No GTK monitor found for the Hyprland monitor:", monitor.get_name());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let scale = (monitor.get_width() >= 3000) ? 1.2 : 1
|
||||||
Bar(gtkMonitor, scale)
|
Bar(gtkMonitor, scale)
|
||||||
NotificationPopups(gtkMonitor)
|
NotificationPopups()
|
||||||
}
|
}
|
||||||
|
|
||||||
function switch_to_best_monitor() {
|
function switch_to_best_monitor() {
|
||||||
let mainMonitor = find_main_monitor()
|
let mainMonitor = find_main_monitor()
|
||||||
for (var wd of App.get_windows()) {
|
for (var wd of app.get_windows()) {
|
||||||
wd.destroy();
|
wd.destroy();
|
||||||
}
|
}
|
||||||
register_windows(mainMonitor);
|
register_windows(mainMonitor);
|
||||||
}
|
}
|
||||||
|
|
||||||
hyprland.connect("monitor-added", (_, monitor) => {
|
hyprland.connect("monitor-added", (_, _monitor: Hyprland.Monitor) => {
|
||||||
switch_to_best_monitor()
|
switch_to_best_monitor()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -44,7 +51,7 @@ hyprland.connect("monitor-removed", () => {
|
||||||
switch_to_best_monitor()
|
switch_to_best_monitor()
|
||||||
})
|
})
|
||||||
|
|
||||||
App.start({
|
app.start({
|
||||||
css: style,
|
css: style,
|
||||||
iconTheme: "Papirus",
|
iconTheme: "Papirus",
|
||||||
main() {
|
main() {
|
||||||
|
|
|
@ -1,21 +1,21 @@
|
||||||
declare const SRC: string
|
declare const SRC: string
|
||||||
|
|
||||||
declare module "inline:*" {
|
declare module "inline:*" {
|
||||||
const content: string
|
const content: string
|
||||||
export default content
|
export default content
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module "*.scss" {
|
declare module "*.scss" {
|
||||||
const content: string
|
const content: string
|
||||||
export default content
|
export default content
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module "*.blp" {
|
declare module "*.blp" {
|
||||||
const content: string
|
const content: string
|
||||||
export default content
|
export default content
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module "*.css" {
|
declare module "*.css" {
|
||||||
const content: string
|
const content: string
|
||||||
export default content
|
export default content
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,125 +1,110 @@
|
||||||
@use "sass:string";
|
@use "sass:string";
|
||||||
|
|
||||||
@function gtkalpha($c, $a) {
|
@function gtkalpha($c, $a) {
|
||||||
@return string.unquote("alpha(#{$c},#{$a})");
|
@return string.unquote("alpha(#{$c},#{$a})");
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://gitlab.gnome.org/GNOME/gtk/-/blob/gtk-3-24/gtk/theme/Adwaita/_colors-public.scss
|
// https://gitlab.gnome.org/GNOME/gtk/-/blob/gtk-3-24/gtk/theme/Adwaita/_colors-public.scss
|
||||||
$fg-color: #{"@theme_fg_color"};
|
$fg-color: #{"@theme_bg_color"};
|
||||||
$bg-color: #1f2430;
|
$bg-color: #1f2430;
|
||||||
$error: red;
|
$error: red;
|
||||||
|
|
||||||
window.NotificationPopups {
|
window.NotificationPopups {
|
||||||
all: unset;
|
all: unset;
|
||||||
}
|
}
|
||||||
|
|
||||||
eventbox.Notification {
|
.Notification {
|
||||||
|
border-radius: 13px;
|
||||||
|
background-color: $bg-color;
|
||||||
|
margin: 0.5rem 1rem 0.5rem 1rem;
|
||||||
|
box-shadow: 2px 3px 8px 0 gtkalpha(black, 0.4);
|
||||||
|
border: 1pt solid gtkalpha($fg-color, 0.03);
|
||||||
|
|
||||||
&:first-child>box {
|
&.critical {
|
||||||
margin-top: 1rem;
|
border: 1pt solid gtkalpha($error, 0.4);
|
||||||
}
|
|
||||||
|
|
||||||
&:last-child>box {
|
|
||||||
margin-bottom: 1rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
// eventboxes can not take margins so we style its inner box instead
|
|
||||||
>box {
|
|
||||||
min-width: 400px;
|
|
||||||
border-radius: 13px;
|
|
||||||
background-color: #1f2430;
|
|
||||||
margin: .5rem 1rem .5rem 1rem;
|
|
||||||
box-shadow: 2px 3px 8px 0 gtkalpha(black, .4);
|
|
||||||
border: 1pt solid gtkalpha($fg-color, .03);
|
|
||||||
}
|
|
||||||
|
|
||||||
&.critical>box {
|
|
||||||
border: 1pt solid gtkalpha($error, .4);
|
|
||||||
|
|
||||||
.header {
|
|
||||||
|
|
||||||
.app-name {
|
|
||||||
color: gtkalpha($error, .8);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.app-icon {
|
|
||||||
color: gtkalpha($error, .6);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.header {
|
.header {
|
||||||
padding: .5rem;
|
.app-name {
|
||||||
color: gtkalpha($fg-color, 0.5);
|
color: gtkalpha($error, 0.8);
|
||||||
|
}
|
||||||
|
|
||||||
.app-icon {
|
.app-icon {
|
||||||
margin: 0 .4rem;
|
color: gtkalpha($error, 0.6);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.app-name {
|
.header {
|
||||||
margin-right: .3rem;
|
padding: 0.5rem;
|
||||||
font-weight: bold;
|
color: gtkalpha($fg-color, 0.5);
|
||||||
|
|
||||||
&:first-child {
|
.app-icon {
|
||||||
margin-left: .4rem;
|
margin: 0 0.4rem;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.time {
|
|
||||||
margin: 0 .4rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
button {
|
|
||||||
padding: .2rem;
|
|
||||||
min-width: 0;
|
|
||||||
min-height: 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
separator {
|
.app-name {
|
||||||
margin: 0 .4rem;
|
margin-right: 0.3rem;
|
||||||
background-color: gtkalpha($fg-color, .1);
|
font-weight: bold;
|
||||||
|
|
||||||
|
&:first-child {
|
||||||
|
margin-left: 0.4rem;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.content {
|
.time {
|
||||||
margin: 1rem;
|
margin: 0 0.4rem;
|
||||||
margin-top: .5rem;
|
|
||||||
|
|
||||||
.summary {
|
|
||||||
font-size: 1.2em;
|
|
||||||
color: $fg-color;
|
|
||||||
}
|
|
||||||
|
|
||||||
.body {
|
|
||||||
color: gtkalpha($fg-color, 0.8);
|
|
||||||
}
|
|
||||||
|
|
||||||
.image {
|
|
||||||
border: 1px solid gtkalpha($fg-color, .02);
|
|
||||||
margin-right: .5rem;
|
|
||||||
border-radius: 9px;
|
|
||||||
min-width: 100px;
|
|
||||||
min-height: 100px;
|
|
||||||
background-size: cover;
|
|
||||||
background-position: center;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.actions {
|
button {
|
||||||
margin: 1rem;
|
padding: 0.2rem;
|
||||||
margin-top: 0;
|
min-width: 0;
|
||||||
|
min-height: 0;
|
||||||
button {
|
|
||||||
margin: 0 .3rem;
|
|
||||||
|
|
||||||
&:first-child {
|
|
||||||
margin-left: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:last-child {
|
|
||||||
margin-right: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
separator {
|
||||||
|
margin: 0 0.4rem;
|
||||||
|
background-color: gtkalpha($fg-color, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.content {
|
||||||
|
margin: 1rem;
|
||||||
|
margin-top: 0.5rem;
|
||||||
|
|
||||||
|
.summary {
|
||||||
|
font-size: 1.2em;
|
||||||
|
color: $fg-color;
|
||||||
|
}
|
||||||
|
|
||||||
|
.body {
|
||||||
|
color: gtkalpha($fg-color, 0.8);
|
||||||
|
}
|
||||||
|
|
||||||
|
.image {
|
||||||
|
border: 1px solid gtkalpha($fg-color, 0.02);
|
||||||
|
margin-right: 0.5rem;
|
||||||
|
border-radius: 9px;
|
||||||
|
min-width: 100px;
|
||||||
|
min-height: 100px;
|
||||||
|
background-size: cover;
|
||||||
|
background-position: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.actions {
|
||||||
|
margin: 1rem;
|
||||||
|
margin-top: 0;
|
||||||
|
|
||||||
|
button {
|
||||||
|
margin: 0 0.3rem;
|
||||||
|
|
||||||
|
&:first-child {
|
||||||
|
margin-left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:last-child {
|
||||||
|
margin-right: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,107 +1,124 @@
|
||||||
import { GLib } from "astal"
|
import Gtk from "gi://Gtk?version=4.0"
|
||||||
import { Gtk, Astal } from "astal/gtk3"
|
import Gdk from "gi://Gdk?version=4.0"
|
||||||
import { type EventBox } from "astal/gtk3/widget"
|
import Adw from "gi://Adw"
|
||||||
import Notifd from "gi://AstalNotifd"
|
import GLib from "gi://GLib"
|
||||||
|
import AstalNotifd from "gi://AstalNotifd"
|
||||||
|
import Pango from "gi://Pango"
|
||||||
|
import { timeout } from "ags/time"
|
||||||
|
|
||||||
const isIcon = (icon: string) =>
|
function isIcon(icon?: string | null) {
|
||||||
!!Astal.Icon.lookup_icon(icon)
|
const iconTheme = Gtk.IconTheme.get_for_display(Gdk.Display.get_default()!)
|
||||||
|
return icon && iconTheme.has_icon(icon)
|
||||||
|
}
|
||||||
|
|
||||||
const fileExists = (path: string) =>
|
function fileExists(path: string) {
|
||||||
GLib.file_test(path, GLib.FileTest.EXISTS)
|
return GLib.file_test(path, GLib.FileTest.EXISTS)
|
||||||
|
}
|
||||||
|
|
||||||
const time = (time: number, format = "%H:%M") => GLib.DateTime
|
function time(time: number, format = "%H:%M") {
|
||||||
.new_from_unix_local(time)
|
return GLib.DateTime.new_from_unix_local(time).format(format)!
|
||||||
.format(format)!
|
}
|
||||||
|
|
||||||
const urgency = (n: Notifd.Notification) => {
|
function urgency(n: AstalNotifd.Notification) {
|
||||||
const { LOW, NORMAL, CRITICAL } = Notifd.Urgency
|
const { LOW, NORMAL, CRITICAL } = AstalNotifd.Urgency
|
||||||
// match operator when?
|
|
||||||
switch (n.urgency) {
|
switch (n.urgency) {
|
||||||
case LOW: return "low"
|
case LOW:
|
||||||
case CRITICAL: return "critical"
|
return "low"
|
||||||
|
case CRITICAL:
|
||||||
|
return "critical"
|
||||||
case NORMAL:
|
case NORMAL:
|
||||||
default: return "normal"
|
default:
|
||||||
|
return "normal"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
type Props = {
|
export default function Notification({
|
||||||
setup(self: EventBox): void
|
notification: n,
|
||||||
onHoverLost(self: EventBox): void
|
onHoverLost,
|
||||||
notification: Notifd.Notification
|
}: {
|
||||||
}
|
notification: AstalNotifd.Notification
|
||||||
|
onHoverLost: () => void
|
||||||
export default function Notification(props: Props) {
|
}) {
|
||||||
const { notification: n, onHoverLost, setup } = props
|
const timer = timeout(3000, () => {
|
||||||
const { START, CENTER, END } = Gtk.Align
|
onHoverLost()
|
||||||
|
})
|
||||||
return <eventbox
|
return (
|
||||||
className={`Notification ${urgency(n)}`}
|
<Adw.Clamp maximumSize={400}>
|
||||||
setup={setup}
|
<box
|
||||||
onHoverLost={onHoverLost}>
|
widthRequest={400}
|
||||||
<box vertical>
|
class={`Notification ${urgency(n)}`}
|
||||||
<box className="header">
|
orientation={Gtk.Orientation.VERTICAL}
|
||||||
{(n.appIcon || n.desktopEntry) && <icon
|
>
|
||||||
className="app-icon"
|
<Gtk.EventControllerMotion onEnter={() => timer.cancel()} onLeave={onHoverLost} />
|
||||||
visible={Boolean(n.appIcon || n.desktopEntry)}
|
<box class="header">
|
||||||
icon={n.appIcon || n.desktopEntry}
|
{(n.appIcon || isIcon(n.desktopEntry)) && (
|
||||||
/>}
|
<image
|
||||||
<label
|
class="app-icon"
|
||||||
className="app-name"
|
visible={Boolean(n.appIcon || n.desktopEntry)}
|
||||||
halign={START}
|
iconName={n.appIcon || n.desktopEntry}
|
||||||
truncate
|
/>
|
||||||
label={n.appName || "Unknown"}
|
)}
|
||||||
/>
|
|
||||||
<label
|
|
||||||
className="time"
|
|
||||||
hexpand
|
|
||||||
halign={END}
|
|
||||||
label={time(n.time)}
|
|
||||||
/>
|
|
||||||
<button onClicked={() => n.dismiss()}>
|
|
||||||
<icon icon="window-close-symbolic" />
|
|
||||||
</button>
|
|
||||||
</box>
|
|
||||||
<Gtk.Separator visible />
|
|
||||||
<box className="content">
|
|
||||||
{n.image && fileExists(n.image) && <box
|
|
||||||
valign={START}
|
|
||||||
className="image"
|
|
||||||
css={`background-image: url('${n.image}')`}
|
|
||||||
/>}
|
|
||||||
{n.image && isIcon(n.image) && <box
|
|
||||||
expand={false}
|
|
||||||
valign={START}
|
|
||||||
className="icon-image">
|
|
||||||
<icon icon={n.image} expand halign={CENTER} valign={CENTER} />
|
|
||||||
</box>}
|
|
||||||
<box vertical>
|
|
||||||
<label
|
<label
|
||||||
className="summary"
|
class="app-name"
|
||||||
halign={START}
|
halign={Gtk.Align.START}
|
||||||
xalign={0}
|
ellipsize={Pango.EllipsizeMode.END}
|
||||||
label={n.summary}
|
label={n.appName || "Unknown"}
|
||||||
truncate
|
|
||||||
/>
|
/>
|
||||||
{n.body && <label
|
<label
|
||||||
className="body"
|
class="time"
|
||||||
wrap
|
|
||||||
useMarkup
|
|
||||||
halign={START}
|
|
||||||
xalign={0}
|
|
||||||
justifyFill
|
|
||||||
label={n.body}
|
|
||||||
/>}
|
|
||||||
</box>
|
|
||||||
</box>
|
|
||||||
{n.get_actions().length > 0 && <box className="actions">
|
|
||||||
{n.get_actions().map(({ label, id }) => (
|
|
||||||
<button
|
|
||||||
hexpand
|
hexpand
|
||||||
onClicked={() => n.invoke(id)}>
|
halign={Gtk.Align.END}
|
||||||
<label label={label} halign={CENTER} hexpand />
|
label={time(n.time)}
|
||||||
|
/>
|
||||||
|
<button onClicked={() => n.dismiss()}>
|
||||||
|
<image iconName="window-close-symbolic" />
|
||||||
</button>
|
</button>
|
||||||
))}
|
</box>
|
||||||
</box>}
|
<Gtk.Separator visible />
|
||||||
</box>
|
<box class="content">
|
||||||
</eventbox>
|
{n.image && fileExists(n.image) && (
|
||||||
|
<image valign={Gtk.Align.START} class="image" file={n.image} />
|
||||||
|
)}
|
||||||
|
{n.image && isIcon(n.image) && (
|
||||||
|
<box valign={Gtk.Align.START} class="icon-image">
|
||||||
|
<image
|
||||||
|
iconName={n.image}
|
||||||
|
halign={Gtk.Align.CENTER}
|
||||||
|
valign={Gtk.Align.CENTER}
|
||||||
|
/>
|
||||||
|
</box>
|
||||||
|
)}
|
||||||
|
<box orientation={Gtk.Orientation.VERTICAL}>
|
||||||
|
<label
|
||||||
|
class="summary"
|
||||||
|
halign={Gtk.Align.START}
|
||||||
|
xalign={0}
|
||||||
|
label={n.summary}
|
||||||
|
ellipsize={Pango.EllipsizeMode.END}
|
||||||
|
/>
|
||||||
|
{n.body && (
|
||||||
|
<label
|
||||||
|
class="body"
|
||||||
|
wrap
|
||||||
|
useMarkup
|
||||||
|
halign={Gtk.Align.START}
|
||||||
|
xalign={0}
|
||||||
|
justify={Gtk.Justification.FILL}
|
||||||
|
label={n.body}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</box>
|
||||||
|
</box>
|
||||||
|
{n.actions.length > 0 && (
|
||||||
|
<box class="actions">
|
||||||
|
{n.actions.map(({ label, id }) => (
|
||||||
|
<button hexpand onClicked={() => n.invoke(id)}>
|
||||||
|
<label label={label} halign={Gtk.Align.CENTER} hexpand />
|
||||||
|
</button>
|
||||||
|
))}
|
||||||
|
</box>
|
||||||
|
)}
|
||||||
|
</box>
|
||||||
|
</Adw.Clamp>
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,105 +1,65 @@
|
||||||
import { Astal, Gtk, Gdk } from "astal/gtk3"
|
import app from "ags/gtk4/app"
|
||||||
import Notifd from "gi://AstalNotifd"
|
import { Astal, Gtk } from "ags/gtk4"
|
||||||
|
import AstalNotifd from "gi://AstalNotifd"
|
||||||
import Notification from "./Notification"
|
import Notification from "./Notification"
|
||||||
import { type Subscribable } from "astal/binding"
|
import { createBinding, For, createState, onCleanup } from "ags"
|
||||||
import { GLib, Variable, bind, timeout } from "astal"
|
|
||||||
|
|
||||||
// see comment below in constructor
|
export default function NotificationPopups() {
|
||||||
const TIMEOUT_DELAY = 5000
|
const monitors = createBinding(app, "monitors")
|
||||||
|
|
||||||
// The purpose if this class is to replace Variable<Array<Widget>>
|
const notifd = AstalNotifd.get_default()
|
||||||
// with a Map<number, Widget> type in order to track notification widgets
|
|
||||||
// by their id, while making it conviniently bindable as an array
|
|
||||||
class NotifiationMap implements Subscribable {
|
|
||||||
// the underlying map to keep track of id widget pairs
|
|
||||||
private map: Map<number, Gtk.Widget> = new Map()
|
|
||||||
|
|
||||||
// it makes sense to use a Variable under the hood and use its
|
const [notifications, setNotifications] = createState(
|
||||||
// reactivity implementation instead of keeping track of subscribers ourselves
|
new Array<AstalNotifd.Notification>(),
|
||||||
private var: Variable<Array<Gtk.Widget>> = Variable([])
|
)
|
||||||
|
|
||||||
// notify subscribers to rerender when state changes
|
const notifiedHandler = notifd.connect("notified", (_, id, replaced) => {
|
||||||
private notifiy() {
|
const notification = notifd.get_notification(id)
|
||||||
this.var.set([...this.map.values()].reverse())
|
|
||||||
}
|
|
||||||
|
|
||||||
private constructor() {
|
if (replaced && notifications.get().some(n => n.id === id)) {
|
||||||
const notifd = Notifd.get_default()
|
setNotifications((ns) => ns.map((n) => (n.id === id ? notification : n)))
|
||||||
|
} else {
|
||||||
|
setNotifications((ns) => [notification, ...ns])
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
/**
|
const resolvedHandler = notifd.connect("resolved", (_, id) => {
|
||||||
* uncomment this if you want to
|
setNotifications((ns) => ns.filter((n) => n.id !== id))
|
||||||
* ignore timeout by senders and enforce our own timeout
|
})
|
||||||
* note that if the notification has any actions
|
|
||||||
* they might not work, since the sender already treats them as resolved
|
|
||||||
*/
|
|
||||||
// notifd.ignoreTimeout = true
|
|
||||||
|
|
||||||
notifd.connect("notified", (_, id) => {
|
// technically, we don't need to cleanup because in this example this is a root component
|
||||||
this.set(id, Notification({
|
// and this cleanup function is only called when the program exits, but exiting will cleanup either way
|
||||||
notification: notifd.get_notification(id)!,
|
// but it's here to remind you that you should not forget to cleanup signal connections
|
||||||
|
onCleanup(() => {
|
||||||
|
notifd.disconnect(notifiedHandler)
|
||||||
|
notifd.disconnect(resolvedHandler)
|
||||||
|
})
|
||||||
|
|
||||||
// once hovering over the notification is done
|
return (
|
||||||
// destroy the widget without calling notification.dismiss()
|
<For each={monitors} cleanup={(win) => (win as Gtk.Window).destroy()}>
|
||||||
// so that it acts as a "popup" and we can still display it
|
{(monitor) => (
|
||||||
// in a notification center like widget
|
<window
|
||||||
// but clicking on the close button will close it
|
class="NotificationPopups"
|
||||||
onHoverLost: () => this.delete(id),
|
gdkmonitor={monitor}
|
||||||
|
visible={notifications((ns) => ns.length > 0)}
|
||||||
// notifd by default does not close notifications
|
anchor={Astal.WindowAnchor.TOP | Astal.WindowAnchor.RIGHT}
|
||||||
// until user input or the timeout specified by sender
|
>
|
||||||
// which we set to ignore above
|
<box orientation={Gtk.Orientation.VERTICAL}>
|
||||||
setup: () => timeout(TIMEOUT_DELAY, () => {
|
<For each={notifications}>
|
||||||
/**
|
{(notification) => (
|
||||||
* uncomment this if you want to "hide" the notifications
|
<Notification
|
||||||
* after TIMEOUT_DELAY
|
notification={notification}
|
||||||
*/
|
onHoverLost={() =>
|
||||||
this.delete(id)
|
setNotifications((ns) =>
|
||||||
})
|
ns.filter((n) => n.id !== notification.id),
|
||||||
}))
|
)
|
||||||
})
|
}
|
||||||
|
/>
|
||||||
// notifications can be closed by the outside before
|
)}
|
||||||
// any user input, which have to be handled too
|
</For>
|
||||||
notifd.connect("resolved", (_, id) => {
|
</box>
|
||||||
this.delete(id)
|
</window>
|
||||||
})
|
)}
|
||||||
}
|
</For>
|
||||||
|
)
|
||||||
private set(key: number, value: Gtk.Widget) {
|
|
||||||
// in case of replacecment destroy previous widget
|
|
||||||
this.map.get(key)?.destroy()
|
|
||||||
this.map.set(key, value)
|
|
||||||
this.notifiy()
|
|
||||||
}
|
|
||||||
|
|
||||||
private delete(key: number) {
|
|
||||||
this.map.get(key)?.destroy()
|
|
||||||
this.map.delete(key)
|
|
||||||
this.notifiy()
|
|
||||||
}
|
|
||||||
|
|
||||||
// needed by the Subscribable interface
|
|
||||||
get() {
|
|
||||||
return this.var.get()
|
|
||||||
}
|
|
||||||
|
|
||||||
// needed by the Subscribable interface
|
|
||||||
subscribe(callback: (list: Array<Gtk.Widget>) => void) {
|
|
||||||
return this.var.subscribe(callback)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export default function NotificationPopups(gdkmonitor: Gdk.Monitor) {
|
|
||||||
const { TOP, RIGHT } = Astal.WindowAnchor
|
|
||||||
const notifs = new NotifiationMap()
|
|
||||||
|
|
||||||
return <window
|
|
||||||
className="NotificationPopups"
|
|
||||||
gdkmonitor={gdkmonitor}
|
|
||||||
exclusivity={Astal.Exclusivity.EXCLUSIVE}
|
|
||||||
anchor={TOP | RIGHT}>
|
|
||||||
<box vertical>
|
|
||||||
{bind(notifs)}
|
|
||||||
</box>
|
|
||||||
</window>
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
"dependencies": {
|
||||||
|
"ags": "*"
|
||||||
|
}
|
||||||
|
}
|
|
@ -17,7 +17,7 @@ window.Bar {
|
||||||
margin-top: 0.2em;
|
margin-top: 0.2em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.clients box {
|
.clients box box {
|
||||||
margin-right: 0.3em;
|
margin-right: 0.3em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,11 +27,13 @@ window.Bar {
|
||||||
border-radius: 0.3em;
|
border-radius: 0.3em;
|
||||||
background: #1f2430;
|
background: #1f2430;
|
||||||
}
|
}
|
||||||
|
|
||||||
.battery-item:hover {
|
.battery-item:hover {
|
||||||
background: #023269;
|
background: #023269;
|
||||||
}
|
}
|
||||||
|
|
||||||
.item, .clients box {
|
.item,
|
||||||
|
.clients box box {
|
||||||
background: #1f2430;
|
background: #1f2430;
|
||||||
padding-left: 0.7em;
|
padding-left: 0.7em;
|
||||||
padding-right: 0.7em;
|
padding-right: 0.7em;
|
||||||
|
@ -49,12 +51,14 @@ window.Bar {
|
||||||
|
|
||||||
button {
|
button {
|
||||||
background: #1f2430;
|
background: #1f2430;
|
||||||
border:none;
|
border: none;
|
||||||
padding: 0.2em;
|
padding: 0.2em;
|
||||||
border-radius: 0.3em;
|
border-radius: 0.3em;
|
||||||
|
font-weight: normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
.focused, .clients box.focused {
|
.focused,
|
||||||
|
.clients box.focused {
|
||||||
background: #023269;
|
background: #023269;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,22 +1,16 @@
|
||||||
{
|
{
|
||||||
"$schema": "https://json.schemastore.org/tsconfig",
|
"$schema": "https://json.schemastore.org/tsconfig",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"experimentalDecorators": true,
|
|
||||||
"strict": true,
|
"strict": true,
|
||||||
"target": "ES2022",
|
|
||||||
"module": "ES2022",
|
"module": "ES2022",
|
||||||
|
"target": "ES2020",
|
||||||
|
"lib": [
|
||||||
|
"ES2023"
|
||||||
|
],
|
||||||
"moduleResolution": "Bundler",
|
"moduleResolution": "Bundler",
|
||||||
// "checkJs": true,
|
// "checkJs": true,
|
||||||
// "allowJs": true,
|
// "allowJs": true,
|
||||||
"jsx": "react-jsx",
|
"jsx": "react-jsx",
|
||||||
"jsxImportSource": "/nix/store/1pd4fdq90f4vla3zghmfci9axsbvkd3w-astal-gjs/share/astal/gjs/gtk3",
|
"jsxImportSource": "ags/gtk4"
|
||||||
"paths": {
|
|
||||||
"astal": [
|
|
||||||
"/nix/store/1pd4fdq90f4vla3zghmfci9axsbvkd3w-astal-gjs/share/astal/gjs"
|
|
||||||
],
|
|
||||||
"astal/*": [
|
|
||||||
"/nix/store/1pd4fdq90f4vla3zghmfci9axsbvkd3w-astal-gjs/share/astal/gjs/*"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,6 @@
|
||||||
pkgs = nixpkgs.legacyPackages.${system};
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
extraPackages = with ags.packages.${pkgs.system}; [
|
extraPackages = with ags.packages.${pkgs.system}; [
|
||||||
pkgs.gtksourceview
|
pkgs.gtksourceview
|
||||||
pkgs.webkitgtk
|
|
||||||
pkgs.accountsservice
|
pkgs.accountsservice
|
||||||
|
|
||||||
battery
|
battery
|
||||||
|
|
|
@ -49,8 +49,6 @@ in
|
||||||
Value = "strict";
|
Value = "strict";
|
||||||
Status = "locked";
|
Status = "locked";
|
||||||
};
|
};
|
||||||
"browser.uiCustomization.state" = ''
|
|
||||||
{"placements":{"widget-overflow-fixed-list":["fxa-toolbar-menu-button","developer-button"],"unified-extensions-area":["sponsorblocker_ajay_app-browser-action","_testpilot-containers-browser-action","_531906d3-e22f-4a6c-a102-8057b88a1a63_-browser-action","beyond20_kakaroto_homelinux_net-browser-action","_d7742d87-e61d-4b78-b8a1-b469842139fa_-browser-action","_contain-facebook-browser-action","jid1-kkzogwgsw3ao4q_jetpack-browser-action","jid1-mnnxcxisbpnsxq_jetpack-browser-action","_74145f27-f039-47ce-a470-a662b129930a_-browser-action","chrome-gnome-shell_gnome_org-browser-action","_ea4204c0-3209-4116-afd2-2a208e21a779_-browser-action","_f209234a-76f0-4735-9920-eb62507a54cd_-browser-action","_762f9885-5a13-4abd-9c77-433dcd38b8fd_-browser-action","display-anchors_robwu_nl-browser-action","firefoxcolor_mozilla_com-browser-action","search_kagi_com-browser-action","_7a7a4a92-a2a0-41d1-9fd7-1e92480d612d_-browser-action"],"nav-bar":["back-button","forward-button","stop-reload-button","urlbar-container","downloads-button","_446900e4-71c2-419f-a6a7-df9c091e268b_-browser-action","_12cf650b-1822-40aa-bff0-996df6948878_-browser-action","_3e4d2037-d300-4e95-859d-3cba866f46d3_-browser-action","save-as-pdf-ff_pdfcrowd_com-browser-action","user-agent-switcher_ninetailed_ninja-browser-action","_d66c8515-1e0d-408f-82ee-2682f2362726_-browser-action","ublock0_raymondhill_net-browser-action","reset-pbm-toolbar-button","adguardadblocker_adguard_com-browser-action","unified-extensions-button"],"toolbar-menubar":["menubar-items"],"TabsToolbar":["tabbrowser-tabs","new-tab-button","alltabs-button"],"PersonalToolbar":["import-button","personal-bookmarks"]},"seen":["developer-button","profiler-button","chrome-gnome-shell_gnome_org-browser-action","_446900e4-71c2-419f-a6a7-df9c091e268b_-browser-action","_74145f27-f039-47ce-a470-a662b129930a_-browser-action","_contain-facebook-browser-action","_testpilot-containers-browser-action","jid1-kkzogwgsw3ao4q_jetpack-browser-action","jid1-mnnxcxisbpnsxq_jetpack-browser-action","ublock0_raymondhill_net-browser-action","_531906d3-e22f-4a6c-a102-8057b88a1a63_-browser-action","beyond20_kakaroto_homelinux_net-browser-action","_12cf650b-1822-40aa-bff0-996df6948878_-browser-action","_3e4d2037-d300-4e95-859d-3cba866f46d3_-browser-action","save-as-pdf-ff_pdfcrowd_com-browser-action","_d7742d87-e61d-4b78-b8a1-b469842139fa_-browser-action","user-agent-switcher_ninetailed_ninja-browser-action","_d66c8515-1e0d-408f-82ee-2682f2362726_-browser-action","_ea4204c0-3209-4116-afd2-2a208e21a779_-browser-action","adguardadblocker_adguard_com-browser-action","_f209234a-76f0-4735-9920-eb62507a54cd_-browser-action","_762f9885-5a13-4abd-9c77-433dcd38b8fd_-browser-action","sponsorblocker_ajay_app-browser-action","display-anchors_robwu_nl-browser-action","firefoxcolor_mozilla_com-browser-action","search_kagi_com-browser-action","_7a7a4a92-a2a0-41d1-9fd7-1e92480d612d_-browser-action"],"dirtyAreaCache":["nav-bar","PersonalToolbar","toolbar-menubar","TabsToolbar","widget-overflow-fixed-list","unified-extensions-area"],"currentVersion":20,"newElementCount":11}'';
|
|
||||||
"privacy.trackingprotection.enabled" = true;
|
"privacy.trackingprotection.enabled" = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -8,7 +8,7 @@ video-sync=display-resample
|
||||||
interpolation
|
interpolation
|
||||||
tscale=oversample
|
tscale=oversample
|
||||||
vo=gpu-next
|
vo=gpu-next
|
||||||
gpu-api=opengl
|
hwdec=auto
|
||||||
force-window=yes
|
force-window=yes
|
||||||
keep-open=yes
|
keep-open=yes
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
../lf
|
../lf
|
||||||
../tmux
|
../tmux
|
||||||
../yazi
|
../yazi
|
||||||
|
../zellij
|
||||||
];
|
];
|
||||||
|
|
||||||
home.stateVersion = "24.11";
|
home.stateVersion = "24.11";
|
||||||
|
@ -20,6 +21,7 @@
|
||||||
waypipe
|
waypipe
|
||||||
inputs.worktimer.packages.${pkgs.system}.default
|
inputs.worktimer.packages.${pkgs.system}.default
|
||||||
usbutils
|
usbutils
|
||||||
|
gocryptfs
|
||||||
];
|
];
|
||||||
programs.nh = {
|
programs.nh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
];
|
];
|
||||||
|
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
|
spotify
|
||||||
slack
|
slack
|
||||||
eid-mw
|
eid-mw
|
||||||
onlyoffice-bin
|
onlyoffice-bin
|
||||||
|
@ -80,6 +81,8 @@
|
||||||
|
|
||||||
services.cliphist = { enable = true; };
|
services.cliphist = { enable = true; };
|
||||||
|
|
||||||
|
services.mpris-proxy.enable = true; # Bluetooth media control
|
||||||
|
|
||||||
xdg.mimeApps = {
|
xdg.mimeApps = {
|
||||||
enable = true;
|
enable = true;
|
||||||
defaultApplications = {
|
defaultApplications = {
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
enable = true;
|
enable = true;
|
||||||
enableZshIntegration = true;
|
enableZshIntegration = true;
|
||||||
settings = {
|
settings = {
|
||||||
manager = {
|
mgr = {
|
||||||
sort_by = "natural";
|
sort_by = "natural";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
{ config, ... }:
|
||||||
|
{
|
||||||
|
programs.zellij = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
home.file."${config.xdg.configHome}/zellij" = {
|
||||||
|
source = ./files;
|
||||||
|
recursive = true;
|
||||||
|
};
|
||||||
|
}
|
|
@ -0,0 +1,451 @@
|
||||||
|
ui {
|
||||||
|
pane_frames {
|
||||||
|
hide_session_name true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
keybinds clear-defaults=true {
|
||||||
|
locked {
|
||||||
|
bind "Ctrl a" { SwitchToMode "normal"; }
|
||||||
|
bind "Ctrl H" { MoveFocus "left"; }
|
||||||
|
bind "Ctrl J" { MoveFocus "down"; }
|
||||||
|
bind "Ctrl K" { MoveFocus "up"; }
|
||||||
|
bind "Ctrl L" { MoveFocus "right"; }
|
||||||
|
}
|
||||||
|
normal {
|
||||||
|
bind "-" { NewPane "down"; SwitchToMode "locked"; }
|
||||||
|
bind "|" { NewPane "right"; SwitchToMode "locked"; }
|
||||||
|
bind "c" { NewTab; SwitchToMode "locked"; }
|
||||||
|
bind "d" { Detach; }
|
||||||
|
bind "n" { GoToNextTab; SwitchToMode "locked"; }
|
||||||
|
}
|
||||||
|
pane {
|
||||||
|
bind "left" { MoveFocus "left"; }
|
||||||
|
bind "down" { MoveFocus "down"; }
|
||||||
|
bind "up" { MoveFocus "up"; }
|
||||||
|
bind "right" { MoveFocus "right"; }
|
||||||
|
bind "c" { SwitchToMode "renamepane"; PaneNameInput 0; }
|
||||||
|
bind "d" { NewPane "down"; SwitchToMode "locked"; }
|
||||||
|
bind "e" { TogglePaneEmbedOrFloating; SwitchToMode "locked"; }
|
||||||
|
bind "f" { ToggleFocusFullscreen; SwitchToMode "locked"; }
|
||||||
|
bind "h" { MoveFocus "left"; }
|
||||||
|
bind "i" { TogglePanePinned; SwitchToMode "locked"; }
|
||||||
|
bind "j" { MoveFocus "down"; }
|
||||||
|
bind "k" { MoveFocus "up"; }
|
||||||
|
bind "l" { MoveFocus "right"; }
|
||||||
|
bind "n" { NewPane; SwitchToMode "locked"; }
|
||||||
|
bind "p" { SwitchToMode "normal"; }
|
||||||
|
bind "r" { NewPane "right"; SwitchToMode "locked"; }
|
||||||
|
bind "w" { ToggleFloatingPanes; SwitchToMode "locked"; }
|
||||||
|
bind "x" { CloseFocus; SwitchToMode "locked"; }
|
||||||
|
bind "z" { TogglePaneFrames; SwitchToMode "locked"; }
|
||||||
|
bind "tab" { SwitchFocus; }
|
||||||
|
}
|
||||||
|
tab {
|
||||||
|
bind "left" { GoToPreviousTab; }
|
||||||
|
bind "down" { GoToNextTab; }
|
||||||
|
bind "up" { GoToPreviousTab; }
|
||||||
|
bind "right" { GoToNextTab; }
|
||||||
|
bind "1" { GoToTab 1; SwitchToMode "locked"; }
|
||||||
|
bind "2" { GoToTab 2; SwitchToMode "locked"; }
|
||||||
|
bind "3" { GoToTab 3; SwitchToMode "locked"; }
|
||||||
|
bind "4" { GoToTab 4; SwitchToMode "locked"; }
|
||||||
|
bind "5" { GoToTab 5; SwitchToMode "locked"; }
|
||||||
|
bind "6" { GoToTab 6; SwitchToMode "locked"; }
|
||||||
|
bind "7" { GoToTab 7; SwitchToMode "locked"; }
|
||||||
|
bind "8" { GoToTab 8; SwitchToMode "locked"; }
|
||||||
|
bind "9" { GoToTab 9; SwitchToMode "locked"; }
|
||||||
|
bind "[" { BreakPaneLeft; SwitchToMode "locked"; }
|
||||||
|
bind "]" { BreakPaneRight; SwitchToMode "locked"; }
|
||||||
|
bind "b" { BreakPane; SwitchToMode "locked"; }
|
||||||
|
bind "h" { GoToPreviousTab; }
|
||||||
|
bind "j" { GoToNextTab; }
|
||||||
|
bind "k" { GoToPreviousTab; }
|
||||||
|
bind "l" { GoToNextTab; }
|
||||||
|
bind "n" { NewTab; SwitchToMode "locked"; }
|
||||||
|
bind "r" { SwitchToMode "renametab"; TabNameInput 0; }
|
||||||
|
bind "s" { ToggleActiveSyncTab; SwitchToMode "locked"; }
|
||||||
|
bind "t" { SwitchToMode "normal"; }
|
||||||
|
bind "x" { CloseTab; SwitchToMode "locked"; }
|
||||||
|
bind "tab" { ToggleTab; }
|
||||||
|
}
|
||||||
|
resize {
|
||||||
|
bind "left" { Resize "Increase left"; }
|
||||||
|
bind "down" { Resize "Increase down"; }
|
||||||
|
bind "up" { Resize "Increase up"; }
|
||||||
|
bind "right" { Resize "Increase right"; }
|
||||||
|
bind "+" { Resize "Increase"; }
|
||||||
|
bind "-" { Resize "Decrease"; }
|
||||||
|
bind "=" { Resize "Increase"; }
|
||||||
|
bind "H" { Resize "Decrease left"; }
|
||||||
|
bind "J" { Resize "Decrease down"; }
|
||||||
|
bind "K" { Resize "Decrease up"; }
|
||||||
|
bind "L" { Resize "Decrease right"; }
|
||||||
|
bind "h" { Resize "Increase left"; }
|
||||||
|
bind "j" { Resize "Increase down"; }
|
||||||
|
bind "k" { Resize "Increase up"; }
|
||||||
|
bind "l" { Resize "Increase right"; }
|
||||||
|
bind "r" { SwitchToMode "normal"; }
|
||||||
|
}
|
||||||
|
move {
|
||||||
|
bind "left" { MovePane "left"; }
|
||||||
|
bind "down" { MovePane "down"; }
|
||||||
|
bind "up" { MovePane "up"; }
|
||||||
|
bind "right" { MovePane "right"; }
|
||||||
|
bind "h" { MovePane "left"; }
|
||||||
|
bind "j" { MovePane "down"; }
|
||||||
|
bind "k" { MovePane "up"; }
|
||||||
|
bind "l" { MovePane "right"; }
|
||||||
|
bind "m" { SwitchToMode "normal"; }
|
||||||
|
bind "n" { MovePane; }
|
||||||
|
bind "p" { MovePaneBackwards; }
|
||||||
|
bind "tab" { MovePane; }
|
||||||
|
}
|
||||||
|
scroll {
|
||||||
|
bind "Alt left" { MoveFocusOrTab "left"; SwitchToMode "locked"; }
|
||||||
|
bind "Alt down" { MoveFocus "down"; SwitchToMode "locked"; }
|
||||||
|
bind "Alt up" { MoveFocus "up"; SwitchToMode "locked"; }
|
||||||
|
bind "Alt right" { MoveFocusOrTab "right"; SwitchToMode "locked"; }
|
||||||
|
bind "e" { EditScrollback; SwitchToMode "locked"; }
|
||||||
|
bind "f" { SwitchToMode "entersearch"; SearchInput 0; }
|
||||||
|
bind "Alt h" { MoveFocusOrTab "left"; SwitchToMode "locked"; }
|
||||||
|
bind "Alt j" { MoveFocus "down"; SwitchToMode "locked"; }
|
||||||
|
bind "Alt k" { MoveFocus "up"; SwitchToMode "locked"; }
|
||||||
|
bind "Alt l" { MoveFocusOrTab "right"; SwitchToMode "locked"; }
|
||||||
|
bind "s" { SwitchToMode "normal"; }
|
||||||
|
}
|
||||||
|
search {
|
||||||
|
bind "c" { SearchToggleOption "CaseSensitivity"; }
|
||||||
|
bind "n" { Search "down"; }
|
||||||
|
bind "o" { SearchToggleOption "WholeWord"; }
|
||||||
|
bind "p" { Search "up"; }
|
||||||
|
bind "w" { SearchToggleOption "Wrap"; }
|
||||||
|
}
|
||||||
|
session {
|
||||||
|
bind "a" {
|
||||||
|
LaunchOrFocusPlugin "zellij:about" {
|
||||||
|
floating true
|
||||||
|
move_to_focused_tab true
|
||||||
|
}
|
||||||
|
SwitchToMode "locked"
|
||||||
|
}
|
||||||
|
bind "c" {
|
||||||
|
LaunchOrFocusPlugin "configuration" {
|
||||||
|
floating true
|
||||||
|
move_to_focused_tab true
|
||||||
|
}
|
||||||
|
SwitchToMode "locked"
|
||||||
|
}
|
||||||
|
bind "d" { Detach; }
|
||||||
|
bind "o" { SwitchToMode "normal"; }
|
||||||
|
bind "p" {
|
||||||
|
LaunchOrFocusPlugin "plugin-manager" {
|
||||||
|
floating true
|
||||||
|
move_to_focused_tab true
|
||||||
|
}
|
||||||
|
SwitchToMode "locked"
|
||||||
|
}
|
||||||
|
bind "w" {
|
||||||
|
LaunchOrFocusPlugin "session-manager" {
|
||||||
|
floating true
|
||||||
|
move_to_focused_tab true
|
||||||
|
}
|
||||||
|
SwitchToMode "locked"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
shared_among "normal" "locked" {
|
||||||
|
bind "Alt left" { MoveFocusOrTab "left"; }
|
||||||
|
bind "Alt down" { MoveFocus "down"; }
|
||||||
|
bind "Alt up" { MoveFocus "up"; }
|
||||||
|
bind "Alt right" { MoveFocusOrTab "right"; }
|
||||||
|
bind "Alt +" { Resize "Increase"; }
|
||||||
|
bind "Alt -" { Resize "Decrease"; }
|
||||||
|
bind "Alt =" { Resize "Increase"; }
|
||||||
|
bind "Alt [" { PreviousSwapLayout; }
|
||||||
|
bind "Alt ]" { NextSwapLayout; }
|
||||||
|
bind "Alt f" { ToggleFloatingPanes; }
|
||||||
|
bind "Alt h" { MoveFocusOrTab "left"; }
|
||||||
|
bind "Alt i" { MoveTab "left"; }
|
||||||
|
bind "Alt j" { MoveFocus "down"; }
|
||||||
|
bind "Alt k" { MoveFocus "up"; }
|
||||||
|
bind "Alt l" { MoveFocusOrTab "right"; }
|
||||||
|
bind "Alt n" { NewPane; }
|
||||||
|
bind "Alt o" { MoveTab "right"; }
|
||||||
|
}
|
||||||
|
shared_except "locked" "renametab" "renamepane" {
|
||||||
|
bind "Ctrl g" { SwitchToMode "locked"; }
|
||||||
|
bind "Ctrl q" { Quit; }
|
||||||
|
}
|
||||||
|
shared_except "locked" "entersearch" {
|
||||||
|
bind "enter" { SwitchToMode "locked"; }
|
||||||
|
}
|
||||||
|
shared_except "locked" "entersearch" "renametab" "renamepane" {
|
||||||
|
bind "esc" { SwitchToMode "locked"; }
|
||||||
|
}
|
||||||
|
shared_except "locked" "entersearch" "renametab" "renamepane" "move" {
|
||||||
|
bind "m" { SwitchToMode "move"; }
|
||||||
|
}
|
||||||
|
shared_except "locked" "entersearch" "search" "renametab" "renamepane" "session" {
|
||||||
|
bind "o" { SwitchToMode "session"; }
|
||||||
|
}
|
||||||
|
shared_except "locked" "tab" "entersearch" "renametab" "renamepane" {
|
||||||
|
bind "t" { SwitchToMode "tab"; }
|
||||||
|
}
|
||||||
|
shared_except "locked" "tab" "scroll" "entersearch" "renametab" "renamepane" {
|
||||||
|
bind "s" { SwitchToMode "scroll"; }
|
||||||
|
}
|
||||||
|
shared_among "normal" "resize" "tab" "scroll" "prompt" "tmux" {
|
||||||
|
bind "p" { SwitchToMode "pane"; }
|
||||||
|
}
|
||||||
|
shared_except "locked" "resize" "pane" "tab" "entersearch" "renametab" "renamepane" {
|
||||||
|
bind "r" { SwitchToMode "resize"; }
|
||||||
|
}
|
||||||
|
shared_among "scroll" "search" {
|
||||||
|
bind "PageDown" { PageScrollDown; }
|
||||||
|
bind "PageUp" { PageScrollUp; }
|
||||||
|
bind "left" { PageScrollUp; }
|
||||||
|
bind "down" { ScrollDown; }
|
||||||
|
bind "up" { ScrollUp; }
|
||||||
|
bind "right" { PageScrollDown; }
|
||||||
|
bind "Ctrl b" { PageScrollUp; }
|
||||||
|
bind "Ctrl c" { ScrollToBottom; SwitchToMode "locked"; }
|
||||||
|
bind "d" { HalfPageScrollDown; }
|
||||||
|
bind "Ctrl f" { PageScrollDown; }
|
||||||
|
bind "h" { PageScrollUp; }
|
||||||
|
bind "j" { ScrollDown; }
|
||||||
|
bind "k" { ScrollUp; }
|
||||||
|
bind "l" { PageScrollDown; }
|
||||||
|
bind "u" { HalfPageScrollUp; }
|
||||||
|
}
|
||||||
|
entersearch {
|
||||||
|
bind "Ctrl c" { SwitchToMode "scroll"; }
|
||||||
|
bind "esc" { SwitchToMode "scroll"; }
|
||||||
|
bind "enter" { SwitchToMode "search"; }
|
||||||
|
}
|
||||||
|
renametab {
|
||||||
|
bind "esc" { UndoRenameTab; SwitchToMode "tab"; }
|
||||||
|
}
|
||||||
|
shared_among "renametab" "renamepane" {
|
||||||
|
bind "Ctrl c" { SwitchToMode "locked"; }
|
||||||
|
}
|
||||||
|
renamepane {
|
||||||
|
bind "esc" { UndoRenamePane; SwitchToMode "pane"; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Plugin aliases - can be used to change the implementation of Zellij
|
||||||
|
// changing these requires a restart to take effect
|
||||||
|
plugins {
|
||||||
|
about location="zellij:about"
|
||||||
|
compact-bar location="zellij:compact-bar"
|
||||||
|
configuration location="zellij:configuration"
|
||||||
|
filepicker location="zellij:strider" {
|
||||||
|
cwd "/"
|
||||||
|
}
|
||||||
|
plugin-manager location="zellij:plugin-manager"
|
||||||
|
session-manager location="zellij:session-manager"
|
||||||
|
status-bar location="zellij:status-bar"
|
||||||
|
strider location="zellij:strider"
|
||||||
|
tab-bar location="zellij:tab-bar"
|
||||||
|
welcome-screen location="zellij:session-manager" {
|
||||||
|
welcome_screen true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Plugins to load in the background when a new session starts
|
||||||
|
// eg. "file:/path/to/my-plugin.wasm"
|
||||||
|
// eg. "https://example.com/my-plugin.wasm"
|
||||||
|
load_plugins {
|
||||||
|
}
|
||||||
|
|
||||||
|
// Use a simplified UI without special fonts (arrow glyphs)
|
||||||
|
// Options:
|
||||||
|
// - true
|
||||||
|
// - false (Default)
|
||||||
|
//
|
||||||
|
// simplified_ui true
|
||||||
|
|
||||||
|
// Choose the theme that is specified in the themes section.
|
||||||
|
// Default: default
|
||||||
|
//
|
||||||
|
theme "tokyo-night-dark"
|
||||||
|
|
||||||
|
// Choose the base input mode of zellij.
|
||||||
|
// Default: normal
|
||||||
|
//
|
||||||
|
default_mode "locked"
|
||||||
|
|
||||||
|
// Choose the path to the default shell that zellij will use for opening new panes
|
||||||
|
// Default: $SHELL
|
||||||
|
//
|
||||||
|
// default_shell "fish"
|
||||||
|
|
||||||
|
// Choose the path to override cwd that zellij will use for opening new panes
|
||||||
|
//
|
||||||
|
// default_cwd "/tmp"
|
||||||
|
|
||||||
|
// The name of the default layout to load on startup
|
||||||
|
// Default: "default"
|
||||||
|
//
|
||||||
|
default_layout "compact"
|
||||||
|
|
||||||
|
// The folder in which Zellij will look for layouts
|
||||||
|
// (Requires restart)
|
||||||
|
//
|
||||||
|
// layout_dir "/tmp"
|
||||||
|
|
||||||
|
// The folder in which Zellij will look for themes
|
||||||
|
// (Requires restart)
|
||||||
|
//
|
||||||
|
// theme_dir "/tmp"
|
||||||
|
|
||||||
|
// Toggle enabling the mouse mode.
|
||||||
|
// On certain configurations, or terminals this could
|
||||||
|
// potentially interfere with copying text.
|
||||||
|
// Options:
|
||||||
|
// - true (default)
|
||||||
|
// - false
|
||||||
|
//
|
||||||
|
mouse_mode true
|
||||||
|
|
||||||
|
// Toggle having pane frames around the panes
|
||||||
|
// Options:
|
||||||
|
// - true (default, enabled)
|
||||||
|
// - false
|
||||||
|
//
|
||||||
|
pane_frames false
|
||||||
|
|
||||||
|
// When attaching to an existing session with other users,
|
||||||
|
// should the session be mirrored (true)
|
||||||
|
// or should each user have their own cursor (false)
|
||||||
|
// (Requires restart)
|
||||||
|
// Default: false
|
||||||
|
//
|
||||||
|
// mirror_session true
|
||||||
|
|
||||||
|
// Choose what to do when zellij receives SIGTERM, SIGINT, SIGQUIT or SIGHUP
|
||||||
|
// eg. when terminal window with an active zellij session is closed
|
||||||
|
// (Requires restart)
|
||||||
|
// Options:
|
||||||
|
// - detach (Default)
|
||||||
|
// - quit
|
||||||
|
//
|
||||||
|
// on_force_close "quit"
|
||||||
|
|
||||||
|
// Configure the scroll back buffer size
|
||||||
|
// This is the number of lines zellij stores for each pane in the scroll back
|
||||||
|
// buffer. Excess number of lines are discarded in a FIFO fashion.
|
||||||
|
// (Requires restart)
|
||||||
|
// Valid values: positive integers
|
||||||
|
// Default value: 10000
|
||||||
|
//
|
||||||
|
// scroll_buffer_size 10000
|
||||||
|
|
||||||
|
// Provide a command to execute when copying text. The text will be piped to
|
||||||
|
// the stdin of the program to perform the copy. This can be used with
|
||||||
|
// terminal emulators which do not support the OSC 52 ANSI control sequence
|
||||||
|
// that will be used by default if this option is not set.
|
||||||
|
// Examples:
|
||||||
|
//
|
||||||
|
// copy_command "xclip -selection clipboard" // x11
|
||||||
|
copy_command "wl-copy" // wayland
|
||||||
|
// copy_command "pbcopy" // osx
|
||||||
|
//
|
||||||
|
// copy_command "pbcopy"
|
||||||
|
|
||||||
|
// Choose the destination for copied text
|
||||||
|
// Allows using the primary selection buffer (on x11/wayland) instead of the system clipboard.
|
||||||
|
// Does not apply when using copy_command.
|
||||||
|
// Options:
|
||||||
|
// - system (default)
|
||||||
|
// - primary
|
||||||
|
//
|
||||||
|
// copy_clipboard "primary"
|
||||||
|
|
||||||
|
// Enable automatic copying (and clearing) of selection when releasing mouse
|
||||||
|
// Default: true
|
||||||
|
//
|
||||||
|
// copy_on_select true
|
||||||
|
|
||||||
|
// Path to the default editor to use to edit pane scrollbuffer
|
||||||
|
// Default: $EDITOR or $VISUAL
|
||||||
|
// scrollback_editor "/usr/bin/vim"
|
||||||
|
|
||||||
|
// A fixed name to always give the Zellij session.
|
||||||
|
// Consider also setting `attach_to_session true,`
|
||||||
|
// otherwise this will error if such a session exists.
|
||||||
|
// Default: <RANDOM>
|
||||||
|
//
|
||||||
|
// session_name "My singleton session"
|
||||||
|
|
||||||
|
// When `session_name` is provided, attaches to that session
|
||||||
|
// if it is already running or creates it otherwise.
|
||||||
|
// Default: false
|
||||||
|
//
|
||||||
|
// attach_to_session true
|
||||||
|
|
||||||
|
// Toggle between having Zellij lay out panes according to a predefined set of layouts whenever possible
|
||||||
|
// Options:
|
||||||
|
// - true (default)
|
||||||
|
// - false
|
||||||
|
//
|
||||||
|
// auto_layout false
|
||||||
|
|
||||||
|
// Whether sessions should be serialized to the cache folder (including their tabs/panes, cwds and running commands) so that they can later be resurrected
|
||||||
|
// Options:
|
||||||
|
// - true (default)
|
||||||
|
// - false
|
||||||
|
//
|
||||||
|
// session_serialization false
|
||||||
|
|
||||||
|
// Whether pane viewports are serialized along with the session, default is false
|
||||||
|
// Options:
|
||||||
|
// - true
|
||||||
|
// - false (default)
|
||||||
|
//
|
||||||
|
// serialize_pane_viewport false
|
||||||
|
|
||||||
|
// Scrollback lines to serialize along with the pane viewport when serializing sessions, 0
|
||||||
|
// defaults to the scrollback size. If this number is higher than the scrollback size, it will
|
||||||
|
// also default to the scrollback size. This does nothing if `serialize_pane_viewport` is not true.
|
||||||
|
//
|
||||||
|
// scrollback_lines_to_serialize 10000
|
||||||
|
|
||||||
|
// Enable or disable the rendering of styled and colored underlines (undercurl).
|
||||||
|
// May need to be disabled for certain unsupported terminals
|
||||||
|
// (Requires restart)
|
||||||
|
// Default: true
|
||||||
|
//
|
||||||
|
// styled_underlines false
|
||||||
|
|
||||||
|
// How often in seconds sessions are serialized
|
||||||
|
//
|
||||||
|
// serialization_interval 10000
|
||||||
|
|
||||||
|
// Enable or disable writing of session metadata to disk (if disabled, other sessions might not know
|
||||||
|
// metadata info on this session)
|
||||||
|
// (Requires restart)
|
||||||
|
// Default: false
|
||||||
|
//
|
||||||
|
// disable_session_metadata false
|
||||||
|
|
||||||
|
// Enable or disable support for the enhanced Kitty Keyboard Protocol (the host terminal must also support it)
|
||||||
|
// (Requires restart)
|
||||||
|
// Default: true (if the host terminal supports it)
|
||||||
|
//
|
||||||
|
support_kitty_keyboard_protocol true
|
||||||
|
|
||||||
|
// Whether to stack panes when resizing beyond a certain size
|
||||||
|
// Default: true
|
||||||
|
//
|
||||||
|
// stacked_resize false
|
||||||
|
|
||||||
|
// Whether to show tips on startup
|
||||||
|
// Default: true
|
||||||
|
//
|
||||||
|
show_startup_tips false
|
||||||
|
|
||||||
|
// Whether to show release notes on first version run
|
||||||
|
// Default: true
|
||||||
|
//
|
||||||
|
// show_release_notes false
|
|
@ -7,7 +7,7 @@ in {
|
||||||
(import ../Common/desktop.nix { inherit inputs pkgs config; })
|
(import ../Common/desktop.nix { inherit inputs pkgs config; })
|
||||||
(import ../Common/nfs.nix { inherit pkgs serverIP; })
|
(import ../Common/nfs.nix { inherit pkgs serverIP; })
|
||||||
(import ../Common/zfs.nix {inherit inputs pkgs config; })
|
(import ../Common/zfs.nix {inherit inputs pkgs config; })
|
||||||
(import ../Common/android.nix { inherit pkgs serverIP; })
|
(import ../Common/android.nix { inherit pkgs; })
|
||||||
];
|
];
|
||||||
|
|
||||||
hardware.graphics.extraPackages = [
|
hardware.graphics.extraPackages = [
|
||||||
|
|
|
@ -75,8 +75,8 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
services.resolved = {
|
services.resolved = {
|
||||||
enable = true;
|
enable = pkgs.lib.mkDefault true;
|
||||||
fallbackDns = [ "1.1.1.1" "1.0.0.1" ];
|
fallbackDns = [ "1.1.1.1" "1.0.0.1" ];
|
||||||
};
|
};
|
||||||
networking.nameservers = ["1.1.1.1" "1.0.0.1"];
|
networking.nameservers = pkgs.lib.mkDefault ["1.1.1.1" "1.0.0.1"];
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,18 +49,14 @@
|
||||||
jack.enable = true;
|
jack.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
hardware.bluetooth.enable = true;
|
hardware.bluetooth = {
|
||||||
hardware.bluetooth.powerOnBoot = true;
|
enable = true;
|
||||||
services.blueman.enable = true;
|
powerOnBoot = true;
|
||||||
systemd.user.services.mpris-proxy = {
|
settings = {
|
||||||
description = "Mpris proxy";
|
General = {
|
||||||
after = [ "network.target" "sound.target" ];
|
Experimental = true;
|
||||||
wantedBy = [ "default.target" ];
|
};
|
||||||
serviceConfig.ExecStart = "${pkgs.bluez}/bin/mpris-proxy";
|
|
||||||
};
|
|
||||||
hardware.bluetooth.settings = {
|
|
||||||
General = {
|
|
||||||
Experimental = true;
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
services.blueman.enable = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ let
|
||||||
"soft"
|
"soft"
|
||||||
"bg"
|
"bg"
|
||||||
"intr"
|
"intr"
|
||||||
"x-systemd.automount"
|
# "x-systemd.automount"
|
||||||
"x-systemd.idle-timeout=600"
|
"x-systemd.idle-timeout=600"
|
||||||
"x-systemd.device-timeout=2s"
|
"x-systemd.device-timeout=2s"
|
||||||
"x-systemd.mount-timeout=2s"
|
"x-systemd.mount-timeout=2s"
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
imports = [
|
imports = [
|
||||||
(import ../Common/default.nix { inherit inputs config pkgs; })
|
(import ../Common/default.nix { inherit inputs config pkgs; })
|
||||||
(import ../Common/desktop.nix { inherit inputs pkgs config; })
|
(import ../Common/desktop.nix { inherit inputs pkgs config; })
|
||||||
|
(import ../Common/nvidia.nix { inherit pkgs config; })
|
||||||
];
|
];
|
||||||
|
|
||||||
boot.kernelPackages = pkgs.linuxPackages_latest;
|
boot.kernelPackages = pkgs.linuxPackages_latest;
|
||||||
|
@ -44,4 +45,12 @@
|
||||||
device = "/home/server/Workspace";
|
device = "/home/server/Workspace";
|
||||||
options = ["bind"];
|
options = ["bind"];
|
||||||
};
|
};
|
||||||
|
services.resolved = {
|
||||||
|
enable = false;
|
||||||
|
};
|
||||||
|
networking.nameservers = ["192.168.1.2"];
|
||||||
|
programs.steam = {
|
||||||
|
enable = true;
|
||||||
|
gamescopeSession.enable = true;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue