feat: refactor and add recording function on waybar
This commit is contained in:
parent
47b5336149
commit
f3475c7d02
15 changed files with 656 additions and 586 deletions
|
|
@ -164,7 +164,8 @@
|
||||||
nixosConfigurations = builtins.mapAttrs (
|
nixosConfigurations = builtins.mapAttrs (
|
||||||
dev: conf:
|
dev: conf:
|
||||||
let
|
let
|
||||||
inherit (conf) username hostname domain;
|
domain = if conf.domain != null then conf.domain else "local";
|
||||||
|
inherit (conf) username hostname;
|
||||||
in
|
in
|
||||||
nixpkgs.lib.nixosSystem {
|
nixpkgs.lib.nixosSystem {
|
||||||
modules = [
|
modules = [
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
configuration {
|
configuration {
|
||||||
show-icons: true;
|
show-icons: true;
|
||||||
font: "FreeSans Regular 12";
|
font: "JetBrainsMono 12";
|
||||||
icon-theme: "Gruvbox-Plus-Dark";
|
icon-theme: "Gruvbox-Plus-Dark";
|
||||||
|
|
||||||
display-ssh: " ssh:";
|
display-ssh: " ssh:";
|
||||||
|
|
|
||||||
|
|
@ -1,173 +0,0 @@
|
||||||
{
|
|
||||||
terminal,
|
|
||||||
osConfig,
|
|
||||||
wallRand,
|
|
||||||
rofiWall,
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
}:
|
|
||||||
let
|
|
||||||
modulesConfig = import ./modules.nix {
|
|
||||||
inherit
|
|
||||||
terminal
|
|
||||||
osConfig
|
|
||||||
wallRand
|
|
||||||
rofiWall
|
|
||||||
pkgs
|
|
||||||
lib
|
|
||||||
;
|
|
||||||
};
|
|
||||||
in
|
|
||||||
map (dev: dev // modulesConfig) [
|
|
||||||
# Monitor 1
|
|
||||||
{
|
|
||||||
output = "DP-5";
|
|
||||||
layer = "top";
|
|
||||||
exclusive = true;
|
|
||||||
passthrough = false;
|
|
||||||
position = "top";
|
|
||||||
fixed-center = true;
|
|
||||||
ipc = true;
|
|
||||||
margin-top = 0;
|
|
||||||
margin-left = 0;
|
|
||||||
margin-right = 0;
|
|
||||||
margin-bottom = 0;
|
|
||||||
modules-left = [
|
|
||||||
"custom/os"
|
|
||||||
"hyprland/workspaces"
|
|
||||||
"clock"
|
|
||||||
"custom/cava"
|
|
||||||
"mpris"
|
|
||||||
];
|
|
||||||
modules-center = [
|
|
||||||
"hyprland/window"
|
|
||||||
];
|
|
||||||
modules-right = (
|
|
||||||
[
|
|
||||||
"wlr/taskbar"
|
|
||||||
]
|
|
||||||
++ (
|
|
||||||
if osConfig.programs.gamemode.enable then
|
|
||||||
[
|
|
||||||
"custom/gamemode"
|
|
||||||
]
|
|
||||||
else
|
|
||||||
[ ]
|
|
||||||
)
|
|
||||||
++ [
|
|
||||||
"custom/airplay"
|
|
||||||
"custom/wallRand"
|
|
||||||
"custom/wireguard"
|
|
||||||
"idle_inhibitor"
|
|
||||||
"network"
|
|
||||||
"cpu"
|
|
||||||
"memory"
|
|
||||||
"pulseaudio"
|
|
||||||
"custom/swaync"
|
|
||||||
]
|
|
||||||
);
|
|
||||||
}
|
|
||||||
# Monitor 2
|
|
||||||
{
|
|
||||||
output = "DP-6";
|
|
||||||
layer = "top";
|
|
||||||
exclusive = true;
|
|
||||||
height = 54;
|
|
||||||
passthrough = false;
|
|
||||||
position = "top";
|
|
||||||
fixed-center = true;
|
|
||||||
ipc = true;
|
|
||||||
margin-top = 0;
|
|
||||||
margin-left = 0;
|
|
||||||
margin-right = 0;
|
|
||||||
margin-bottom = 0;
|
|
||||||
modules-left = [
|
|
||||||
"clock"
|
|
||||||
"mpris"
|
|
||||||
];
|
|
||||||
modules-center = [
|
|
||||||
"hyprland/window"
|
|
||||||
];
|
|
||||||
modules-right = [
|
|
||||||
"wlr/taskbar"
|
|
||||||
"temperature"
|
|
||||||
"cpu"
|
|
||||||
"memory"
|
|
||||||
"pulseaudio"
|
|
||||||
];
|
|
||||||
}
|
|
||||||
# Lap
|
|
||||||
{
|
|
||||||
output = "eDP-1";
|
|
||||||
layer = "top";
|
|
||||||
exclusive = true;
|
|
||||||
passthrough = false;
|
|
||||||
position = "top";
|
|
||||||
fixed-center = true;
|
|
||||||
ipc = true;
|
|
||||||
margin-top = 0;
|
|
||||||
margin-left = 0;
|
|
||||||
margin-right = 0;
|
|
||||||
margin-bottom = 0;
|
|
||||||
modules-left = [
|
|
||||||
"custom/os"
|
|
||||||
"hyprland/workspaces"
|
|
||||||
"clock"
|
|
||||||
"mpris"
|
|
||||||
];
|
|
||||||
modules-center = [
|
|
||||||
"hyprland/window"
|
|
||||||
];
|
|
||||||
modules-right = [
|
|
||||||
"wlr/taskbar"
|
|
||||||
"temperature"
|
|
||||||
"custom/wallRand"
|
|
||||||
"custom/wireguard"
|
|
||||||
"idle_inhibitor"
|
|
||||||
"network"
|
|
||||||
"pulseaudio"
|
|
||||||
"battery"
|
|
||||||
"custom/swaync"
|
|
||||||
];
|
|
||||||
}
|
|
||||||
# Other
|
|
||||||
{
|
|
||||||
output = [
|
|
||||||
"!eDP-1"
|
|
||||||
"!DP-1"
|
|
||||||
"!DP-3"
|
|
||||||
];
|
|
||||||
layer = "top";
|
|
||||||
exclusive = true;
|
|
||||||
passthrough = false;
|
|
||||||
position = "top";
|
|
||||||
fixed-center = true;
|
|
||||||
ipc = true;
|
|
||||||
margin-top = 0;
|
|
||||||
margin-left = 0;
|
|
||||||
margin-right = 0;
|
|
||||||
margin-bottom = 0;
|
|
||||||
modules-left = [
|
|
||||||
"custom/os"
|
|
||||||
"hyprland/workspaces"
|
|
||||||
"clock"
|
|
||||||
"mpris"
|
|
||||||
"custom/cava"
|
|
||||||
];
|
|
||||||
modules-center = [
|
|
||||||
"hyprland/window"
|
|
||||||
];
|
|
||||||
modules-right = [
|
|
||||||
"wlr/taskbar"
|
|
||||||
"temperature"
|
|
||||||
"custom/wireguard"
|
|
||||||
"idle_inhibitor"
|
|
||||||
"network"
|
|
||||||
"cpu"
|
|
||||||
"memory"
|
|
||||||
"pulseaudio"
|
|
||||||
"battery"
|
|
||||||
"custom/swaync"
|
|
||||||
];
|
|
||||||
}
|
|
||||||
]
|
|
||||||
|
|
@ -1,314 +0,0 @@
|
||||||
{
|
|
||||||
terminal,
|
|
||||||
osConfig,
|
|
||||||
wallRand,
|
|
||||||
pkgs,
|
|
||||||
rofiWall,
|
|
||||||
lib,
|
|
||||||
}:
|
|
||||||
let
|
|
||||||
terminalRun = "${terminal} -e";
|
|
||||||
in
|
|
||||||
{
|
|
||||||
"hyprland/workspaces" = {
|
|
||||||
active-only = false;
|
|
||||||
all-outputs = true;
|
|
||||||
format = "{icon}";
|
|
||||||
show-special = false;
|
|
||||||
on-click = "activate";
|
|
||||||
on-scroll-up = "hyprctl dispatch workspace e+1";
|
|
||||||
on-scroll-down = "hyprctl dispatch workspace e-1";
|
|
||||||
persistent-workspaces = {
|
|
||||||
"1" = [ ];
|
|
||||||
"2" = [ ];
|
|
||||||
"3" = [ ];
|
|
||||||
"4" = [ ];
|
|
||||||
};
|
|
||||||
format-icons = {
|
|
||||||
active = "";
|
|
||||||
default = "";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
clock = {
|
|
||||||
format = "<b> {:%H:%M %d/%m}</b>";
|
|
||||||
tooltip-format = "{:%A %d %B %Y}";
|
|
||||||
};
|
|
||||||
actions = {
|
|
||||||
on-click-right = "mode";
|
|
||||||
on-click-forward = "tz_up";
|
|
||||||
on-click-backward = "tz_down";
|
|
||||||
on-scroll-up = "shift_up";
|
|
||||||
on-scroll-down = "shift_down";
|
|
||||||
};
|
|
||||||
"custom/os" = {
|
|
||||||
format = "";
|
|
||||||
on-click = "wlogout --protocol layer-shell";
|
|
||||||
};
|
|
||||||
cpu = {
|
|
||||||
format = " {usage}%";
|
|
||||||
max-length = 20;
|
|
||||||
interval = 5;
|
|
||||||
on-click-right = "${terminalRun} btop";
|
|
||||||
};
|
|
||||||
"hyprland/window" = {
|
|
||||||
format = "{}";
|
|
||||||
max-length = 40;
|
|
||||||
separate-outputs = true;
|
|
||||||
offscreen-css = true;
|
|
||||||
offscreen-css-text = "(inactive)";
|
|
||||||
rewrite = {
|
|
||||||
"nvim . (.*)" = " $1";
|
|
||||||
"(.*) - Visual Studio Code" = " $1";
|
|
||||||
"\\(\\d+\\) Discord (.*)" = " $1";
|
|
||||||
|
|
||||||
# Firefox
|
|
||||||
"(.*) - YouTube — Mozilla Firefox" = " $1";
|
|
||||||
"(.*)\\.pdf — Mozilla Firefox" = " $1";
|
|
||||||
"(.*) — Mozilla Firefox" = " $1";
|
|
||||||
"(.*) - YouTube Music — Mozilla Firefox" = " $1";
|
|
||||||
|
|
||||||
# Firefox Nightly
|
|
||||||
"(.*) - YouTube — Firefox Nightly" = " $1";
|
|
||||||
"(.*)\\.pdf — Firefox Nightly" = " $1";
|
|
||||||
"(.*) — Firefox Nightly" = " $1";
|
|
||||||
"(.*) - YouTube Music — Firefox Nightly" = " $1";
|
|
||||||
|
|
||||||
# Zen
|
|
||||||
"(.*) - YouTube — Zen Browser" = " $1";
|
|
||||||
"(.*) - YouTube Music — Zen Browser" = " $1";
|
|
||||||
"(.*) — Zen Browser" = " $1";
|
|
||||||
|
|
||||||
"(.*) - VLC media player" = " $1";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
memory = {
|
|
||||||
interval = 30;
|
|
||||||
format = " {used:0.1f}GB/{total:0.1f}G";
|
|
||||||
format-alt-click = "click";
|
|
||||||
tooltip = true;
|
|
||||||
tooltip-format = "{used:0.1f}GB/{total:0.1f}G";
|
|
||||||
on-click-right = "${terminalRun} btop";
|
|
||||||
};
|
|
||||||
mpris = {
|
|
||||||
interval = 10;
|
|
||||||
format = " {status_icon} <i>{title} | {artist} </i>";
|
|
||||||
format-paused = " {status_icon} <i>{title} | {artist} </i>";
|
|
||||||
on-click = "playerctl play-pause";
|
|
||||||
on-click-right = "playerctl next";
|
|
||||||
scroll-step = 5.0;
|
|
||||||
smooth-scrolling-threshold = 1;
|
|
||||||
status-icons = {
|
|
||||||
paused = "";
|
|
||||||
playing = "";
|
|
||||||
stopped = "";
|
|
||||||
};
|
|
||||||
max-length = 30;
|
|
||||||
};
|
|
||||||
pulseaudio = {
|
|
||||||
format = "{icon} {volume}%";
|
|
||||||
format-bluetooth = " {volume}%";
|
|
||||||
format-muted = " Muted";
|
|
||||||
format-icons = {
|
|
||||||
default = [
|
|
||||||
""
|
|
||||||
""
|
|
||||||
" "
|
|
||||||
" "
|
|
||||||
];
|
|
||||||
ignored-sinks = [
|
|
||||||
"Easy Effects Sink"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
scroll-step = 5.0;
|
|
||||||
on-click = "pavucontrol -t 3";
|
|
||||||
tooltip-format = "{icon} {desc} | {volume}%";
|
|
||||||
smooth-scrolling-threshold = 1;
|
|
||||||
};
|
|
||||||
temperature = {
|
|
||||||
interval = 10;
|
|
||||||
tooltip = true;
|
|
||||||
hwmon-path = [
|
|
||||||
"/sys/class/hwmon/hwmon1/temp1_input"
|
|
||||||
"/sys/class/thermal/thermal_zone0/temp"
|
|
||||||
];
|
|
||||||
critical-threshold = 82;
|
|
||||||
format-critical = " {temperatureC}°C";
|
|
||||||
format = "{icon} {temperatureC}°C";
|
|
||||||
format-icons = [
|
|
||||||
""
|
|
||||||
""
|
|
||||||
""
|
|
||||||
""
|
|
||||||
];
|
|
||||||
on-click-right = "kitty -c ~/.config/kitty/kitty.conf --title btop sh -c 'btop'";
|
|
||||||
};
|
|
||||||
"custom/swaync" = {
|
|
||||||
tooltip = true;
|
|
||||||
format = "{icon}";
|
|
||||||
format-icons = {
|
|
||||||
notification = "";
|
|
||||||
none = "";
|
|
||||||
dnd-notification = "<span foreground='red'><sup></sup></span>";
|
|
||||||
dnd-none = "";
|
|
||||||
inhibited-notification = "<span foreground='red'><sup></sup></span>";
|
|
||||||
inhibited-none = "";
|
|
||||||
dnd-inhibited-notification = "<span foreground='red'><sup></sup></span>";
|
|
||||||
dnd-inhibited-none = "";
|
|
||||||
};
|
|
||||||
return-type = "json";
|
|
||||||
exec-if = "which swaync-client";
|
|
||||||
exec = "swaync-client -swb";
|
|
||||||
on-click = "sleep 0.1 && swaync-client -t -sw";
|
|
||||||
on-click-right = "swaync-client -d -sw";
|
|
||||||
escape = true;
|
|
||||||
};
|
|
||||||
"wlr/taskbar" = {
|
|
||||||
format = " {icon} ";
|
|
||||||
icon-size = 20;
|
|
||||||
all-outputs = false;
|
|
||||||
tooltip-format = "{title}";
|
|
||||||
on-click = "activate";
|
|
||||||
on-click-middle = "close";
|
|
||||||
ignore-list = [
|
|
||||||
"rofi"
|
|
||||||
"firefox"
|
|
||||||
"firefox-nightly"
|
|
||||||
"zen"
|
|
||||||
"kitty"
|
|
||||||
"jetbrains-studio"
|
|
||||||
"Brave-browser"
|
|
||||||
"Spotify"
|
|
||||||
"nemo"
|
|
||||||
"vlc"
|
|
||||||
"com.mitchellh.ghostty"
|
|
||||||
"code"
|
|
||||||
".virt-manager-wrapped"
|
|
||||||
"virt-manager"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
"custom/cava" = {
|
|
||||||
exec = "~/.config/scripts/waybarCava.sh";
|
|
||||||
format = "{}";
|
|
||||||
on-click = "${terminalRun} cava";
|
|
||||||
};
|
|
||||||
battery =
|
|
||||||
let
|
|
||||||
fullAt = if osConfig.services.tlp.enable then 80 else 96;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
full-at = fullAt;
|
|
||||||
states = {
|
|
||||||
good = fullAt;
|
|
||||||
warning = 30;
|
|
||||||
critical = 15;
|
|
||||||
};
|
|
||||||
format = "{icon} {capacity}%";
|
|
||||||
format-icons = [
|
|
||||||
""
|
|
||||||
""
|
|
||||||
""
|
|
||||||
""
|
|
||||||
""
|
|
||||||
""
|
|
||||||
""
|
|
||||||
""
|
|
||||||
""
|
|
||||||
""
|
|
||||||
""
|
|
||||||
];
|
|
||||||
format-charging = " {capacity}%";
|
|
||||||
format-plugged = " {capacity}%";
|
|
||||||
format-alt = "{icon} {time}";
|
|
||||||
};
|
|
||||||
network = {
|
|
||||||
format = "{ifname}";
|
|
||||||
format-wifi = "";
|
|
||||||
format-ethernet = "";
|
|
||||||
format-disconnected = "";
|
|
||||||
tooltip-format = "{ifname} via {gwaddr} ";
|
|
||||||
tooltip-format-wifi = " {essid}: {signalStrength}%";
|
|
||||||
tooltip-format-ethernet = "{ifname} via {gwaddr} ";
|
|
||||||
tooltip-format-disconnected = "Disconnected";
|
|
||||||
max-length = 50;
|
|
||||||
interval = 5;
|
|
||||||
on-click = "~/.config/scripts/rofiWifi.sh";
|
|
||||||
};
|
|
||||||
idle_inhibitor = {
|
|
||||||
format = "{icon}";
|
|
||||||
format-icons = {
|
|
||||||
activated = "";
|
|
||||||
deactivated = "";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
"custom/wireguard" = {
|
|
||||||
format = "{icon}";
|
|
||||||
format-icons = {
|
|
||||||
connected = "";
|
|
||||||
disconnected = "";
|
|
||||||
};
|
|
||||||
exec = "~/.config/scripts/wgStatus.sh";
|
|
||||||
exec-if = "which wg-quick";
|
|
||||||
on-click = "~/.config/scripts/wgStatus.sh toggle";
|
|
||||||
tooltip = true;
|
|
||||||
interval = 3;
|
|
||||||
return-type = "json";
|
|
||||||
escape = true;
|
|
||||||
};
|
|
||||||
"custom/gamemode" = {
|
|
||||||
format = "{icon}";
|
|
||||||
format-icons = {
|
|
||||||
active = "";
|
|
||||||
inactive = "";
|
|
||||||
};
|
|
||||||
exec = "~/.config/scripts/gamemodeStatus.sh";
|
|
||||||
on-click = "~/.config/scripts/gamemodeStatus.sh toggle";
|
|
||||||
tooltip = true;
|
|
||||||
interval = 3;
|
|
||||||
return-type = "json";
|
|
||||||
escape = true;
|
|
||||||
};
|
|
||||||
"custom/wallRand" = {
|
|
||||||
format = "";
|
|
||||||
on-click = "${rofiWall}";
|
|
||||||
on-click-right = "${wallRand}";
|
|
||||||
};
|
|
||||||
"custom/airplay" =
|
|
||||||
let
|
|
||||||
toggleScript = pkgs.writeShellScript "airplayStatus" ''
|
|
||||||
SERVICE="uxplay"
|
|
||||||
ICON=""
|
|
||||||
|
|
||||||
if [ "$1" = "toggle" ]; then
|
|
||||||
if systemctl --user is-active --quiet "$SERVICE"; then
|
|
||||||
systemctl --user stop "$SERVICE"
|
|
||||||
notify-send "$ICON Airplay" "off" >/dev/null 2>&1
|
|
||||||
else
|
|
||||||
systemctl --user start "$SERVICE"
|
|
||||||
notify-send "$ICON Airplay" "on" >/dev/null 2>&1
|
|
||||||
fi
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ! systemctl --user is-active --quiet "$SERVICE"; then
|
|
||||||
echo "{\"text\": \"inactive\", \"tooltip\": \"airplay is inactive\", \"alt\": \"inactive\", \"class\": \"inactive\"}"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "{\"text\": \"active\", \"tooltip\": \"airplay is running\", \"alt\": \"active\", \"class\": \"active\"}"
|
|
||||||
exit 0
|
|
||||||
'';
|
|
||||||
in
|
|
||||||
{
|
|
||||||
format = "{icon}";
|
|
||||||
format-icons = {
|
|
||||||
active = "";
|
|
||||||
inactive = "";
|
|
||||||
};
|
|
||||||
exec = toggleScript;
|
|
||||||
interval = 3;
|
|
||||||
tooltip = true;
|
|
||||||
return-type = "json";
|
|
||||||
escape = true;
|
|
||||||
on-click = "${toggleScript} toggle";
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -46,6 +46,8 @@ tooltip label {
|
||||||
#custom-gamemode,
|
#custom-gamemode,
|
||||||
#custom-wallRand,
|
#custom-wallRand,
|
||||||
#custom-airplay,
|
#custom-airplay,
|
||||||
|
#custom-bitwarden,
|
||||||
|
#custom-recording,
|
||||||
#clock,
|
#clock,
|
||||||
#cpu,
|
#cpu,
|
||||||
#memory,
|
#memory,
|
||||||
|
|
@ -86,6 +88,8 @@ tooltip label {
|
||||||
#custom-gamemode,
|
#custom-gamemode,
|
||||||
#custom-wallRand,
|
#custom-wallRand,
|
||||||
#custom-airplay,
|
#custom-airplay,
|
||||||
|
#custom-bitwarden,
|
||||||
|
#custom-recording,
|
||||||
#battery {
|
#battery {
|
||||||
margin-left: 4px;
|
margin-left: 4px;
|
||||||
}
|
}
|
||||||
|
|
@ -135,6 +139,8 @@ tooltip label {
|
||||||
#custom-gamemode,
|
#custom-gamemode,
|
||||||
#custom-wallRand,
|
#custom-wallRand,
|
||||||
#custom-airplay,
|
#custom-airplay,
|
||||||
|
#custom-bitwarden,
|
||||||
|
#custom-recording,
|
||||||
#network,
|
#network,
|
||||||
#idle_inhibitor {
|
#idle_inhibitor {
|
||||||
padding-left: 10px; padding-right: 14px;
|
padding-left: 10px; padding-right: 14px;
|
||||||
|
|
|
||||||
17
home/scripts/mkWall.nix
Normal file
17
home/scripts/mkWall.nix
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
{ config, pkgs }:
|
||||||
|
let
|
||||||
|
mkWall = pkgs.writeShellScriptBin "setWall" ''
|
||||||
|
url="$1"
|
||||||
|
filepath="/tmp/wall_cache/$(echo -n "$url" | base64 | tr -d '\n')"
|
||||||
|
|
||||||
|
if [[ ! -f "$filepath" ]]; then
|
||||||
|
curl -sL "$url" -o "$filepath"
|
||||||
|
fi
|
||||||
|
|
||||||
|
${config.services.swww.package}/bin/swww img "$filepath" \
|
||||||
|
--transition-fps 45 \
|
||||||
|
--transition-duration 1 \
|
||||||
|
--transition-type random
|
||||||
|
'';
|
||||||
|
in
|
||||||
|
mkWall
|
||||||
17
home/scripts/rbwSelector.nix
Normal file
17
home/scripts/rbwSelector.nix
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
# Rofi selecter for bitwarden cli
|
||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
selector = pkgs.writeShellScript "rbw-selector" ''
|
||||||
|
selection=$(rbw list | rofi -dmenu -p "Search" )
|
||||||
|
|
||||||
|
if [[ -z "$selection" ]]; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
rbw get "$selection" | tr -d '\n' | wl-copy
|
||||||
|
notify-send " Bitwarden" "Password for $selection: Copied"
|
||||||
|
'';
|
||||||
|
in
|
||||||
|
selector
|
||||||
47
home/scripts/record.nix
Normal file
47
home/scripts/record.nix
Normal file
|
|
@ -0,0 +1,47 @@
|
||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
record = pkgs.writeShellScript "toggle-wf-record" ''
|
||||||
|
PID_FILE="/tmp/wf-recorder.pid"
|
||||||
|
OUTPUT_DIR="$HOME/Videos/recordings"
|
||||||
|
FILENAME="$OUTPUT_DIR/recording_$(date +%Y%m%d_%H%M%S).mp4"
|
||||||
|
SINK_DEV="$(${pkgs.pulseaudio.out}/bin/pactl get-default-sink).monitor"
|
||||||
|
|
||||||
|
declare -A recordOptions=(
|
||||||
|
[Monitor]="${pkgs.slurp}/bin/slurp -o"
|
||||||
|
[Area]="${pkgs.slurp}/bin/slurp"
|
||||||
|
)
|
||||||
|
|
||||||
|
if [[ -f "$PID_FILE" ]]; then
|
||||||
|
pid=$(cat "$PID_FILE")
|
||||||
|
|
||||||
|
if kill "$pid" 2>/dev/null; then
|
||||||
|
rm "$PID_FILE"
|
||||||
|
echo "Stopped recording"
|
||||||
|
notify-send " RECORD" "Recording saved to $FILENAME"
|
||||||
|
else
|
||||||
|
echo "No process found, cleaning up"
|
||||||
|
notify-send " RECORD" "Failed: No process found, cleaning up"
|
||||||
|
rm "$PID_FILE"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
choice=$(printf "%s\n" "''\${!recordOptions[@]}" | rofi -i -dmenu -config ~/.config/rofi/config.rasi -p "Which mode")
|
||||||
|
|
||||||
|
if [[ -z "$choice" ]]; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
mkdir -p "$OUTPUT_DIR"
|
||||||
|
|
||||||
|
${pkgs.wf-recorder}/bin/wf-recorder -y \
|
||||||
|
-g "$(''\${recordOptions[$choice]})" \
|
||||||
|
--audio="$SINK_DEV" \
|
||||||
|
-f "$FILENAME" &
|
||||||
|
echo $! > "$PID_FILE"
|
||||||
|
echo "Started recording: $FILENAME"
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
in
|
||||||
|
record
|
||||||
9
home/scripts/rofiwall.nix
Normal file
9
home/scripts/rofiwall.nix
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
{ pkgs, config }:
|
||||||
|
let
|
||||||
|
mkWall = import ./mkWall.nix { inherit pkgs config; };
|
||||||
|
rofiWall = pkgs.writeShellScript "rofiWall" ''
|
||||||
|
url=$(rofi -i -dmenu -config ~/.config/rofi/config.rasi -p "URL")
|
||||||
|
${mkWall}/bin/setWall "$url"
|
||||||
|
'';
|
||||||
|
in
|
||||||
|
rofiWall
|
||||||
|
|
@ -1,12 +1,17 @@
|
||||||
{
|
{
|
||||||
mainMod,
|
mainMod,
|
||||||
|
config,
|
||||||
nvidia-offload-enabled,
|
nvidia-offload-enabled,
|
||||||
|
lib,
|
||||||
pkgs,
|
pkgs,
|
||||||
rofiWall,
|
|
||||||
monitors ? [ ],
|
monitors ? [ ],
|
||||||
}:
|
}:
|
||||||
with builtins;
|
with builtins;
|
||||||
let
|
let
|
||||||
|
inherit (lib) optionalString;
|
||||||
|
|
||||||
|
notransTag = "notrans";
|
||||||
|
|
||||||
firefox = "firefox";
|
firefox = "firefox";
|
||||||
prefix = if nvidia-offload-enabled then "nvidia-offload" else "";
|
prefix = if nvidia-offload-enabled then "nvidia-offload" else "";
|
||||||
browser = "${prefix} ${firefox}";
|
browser = "${prefix} ${firefox}";
|
||||||
|
|
@ -26,6 +31,10 @@ let
|
||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
rofiWall = import ../../scripts/rofiwall.nix { inherit config pkgs; };
|
||||||
|
|
||||||
|
rbwSelector = import ../../scripts/rbwSelector.nix { inherit pkgs; };
|
||||||
|
|
||||||
scrollStep =
|
scrollStep =
|
||||||
let
|
let
|
||||||
monitorsNum = length monitors;
|
monitorsNum = length monitors;
|
||||||
|
|
@ -47,6 +56,12 @@ in
|
||||||
''${mainMod}, S, togglesplit, # dwindle''
|
''${mainMod}, S, togglesplit, # dwindle''
|
||||||
''CTRL ${mainMod} SHIFT, L, exec, hyprlock''
|
''CTRL ${mainMod} SHIFT, L, exec, hyprlock''
|
||||||
|
|
||||||
|
# Toggle transparent
|
||||||
|
''${mainMod}, n, tagwindow, ${notransTag}''
|
||||||
|
|
||||||
|
# Bitwarden Selector
|
||||||
|
(optionalString config.programs.rbw.enable ''CTRL ${mainMod}, P, exec, ${rbwSelector}'')
|
||||||
|
|
||||||
# Screenshot
|
# Screenshot
|
||||||
''${mainMod} SHIFT, s, exec, hyprshot -m region ${clipboardOnly}''
|
''${mainMod} SHIFT, s, exec, hyprshot -m region ${clipboardOnly}''
|
||||||
''CTRL SHIFT, s, exec, hyprshot -m window ${clipboardOnly}''
|
''CTRL SHIFT, s, exec, hyprshot -m window ${clipboardOnly}''
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,16 @@
|
||||||
let
|
let
|
||||||
|
inherit (builtins) map concatLists;
|
||||||
top = "60";
|
top = "60";
|
||||||
right = "100%-w-10";
|
right = "100%-w-10";
|
||||||
|
notransTag = "notrans";
|
||||||
|
noTransList = [
|
||||||
|
"title:(.*)( - YouTube — Mozilla Firefox)"
|
||||||
|
"title:(.*)( - 巴哈姆特動畫瘋 — Mozilla Firefox)"
|
||||||
|
];
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
windowrule = [
|
windowrule = [
|
||||||
"pseudo, class:fcitx"
|
"pseudo, class:(org.fcitx.)"
|
||||||
"float, class:file_progress"
|
"float, class:file_progress"
|
||||||
"float, class:confirm"
|
"float, class:confirm"
|
||||||
"float, class:dialog"
|
"float, class:dialog"
|
||||||
|
|
@ -21,10 +27,7 @@ in
|
||||||
"fullscreen, title:wlogout"
|
"fullscreen, title:wlogout"
|
||||||
"float, title:wlogout"
|
"float, title:wlogout"
|
||||||
"fullscreen, title:wlogout"
|
"fullscreen, title:wlogout"
|
||||||
"idleinhibit stayfocused, class:mpv"
|
|
||||||
];
|
|
||||||
|
|
||||||
windowrulev2 = [
|
|
||||||
"float, title:^(Media viewer)$"
|
"float, title:^(Media viewer)$"
|
||||||
"float, title:^(File Operation Progress)$"
|
"float, title:^(File Operation Progress)$"
|
||||||
"float, class:^(it.mijorus.smile)"
|
"float, class:^(it.mijorus.smile)"
|
||||||
|
|
@ -67,7 +70,7 @@ in
|
||||||
# Airplay
|
# Airplay
|
||||||
"pin, class: ^(GStreamer)$"
|
"pin, class: ^(GStreamer)$"
|
||||||
"float, class: ^(GStreamer)$"
|
"float, class: ^(GStreamer)$"
|
||||||
"opacity 1.0, class: ^(GStreamer)$"
|
"opacity 1.0 override 1.0 override, class: ^(GStreamer)$"
|
||||||
"animation slide right 20%, class: ^(GStreamer)$"
|
"animation slide right 20%, class: ^(GStreamer)$"
|
||||||
|
|
||||||
# Bluetooth
|
# Bluetooth
|
||||||
|
|
@ -94,7 +97,24 @@ in
|
||||||
|
|
||||||
# Davinci resolve
|
# Davinci resolve
|
||||||
"center 1, initialClass: ^(resolve), floating: 1"
|
"center 1, initialClass: ^(resolve), floating: 1"
|
||||||
];
|
|
||||||
|
# Disable Tansparent for youtube video
|
||||||
|
"opacity 1.0 override 1.0 override, title:(.*)( - YouTube — Mozilla Firefox)"
|
||||||
|
"noblur, title:(.*)( - YouTube — Mozilla Firefox)"
|
||||||
|
|
||||||
|
"opacity 1.0 override 1.0 override, title:(.*)( - 巴哈姆特動畫瘋 — Mozilla Firefox)"
|
||||||
|
"noblur, title:(.*)( - YouTube — Mozilla Firefox)"
|
||||||
|
|
||||||
|
# Disable Tansparent
|
||||||
|
"opacity 1.0 override 1.0 override, tag:${notransTag}"
|
||||||
|
"noblur, tag: ^(${notransTag})$"
|
||||||
|
]
|
||||||
|
++ (concatLists (
|
||||||
|
map (w: [
|
||||||
|
"opacity 1.0 override 1.0 override, ${w}"
|
||||||
|
"noblur, ${w}"
|
||||||
|
]) noTransList
|
||||||
|
));
|
||||||
|
|
||||||
layerrule = [
|
layerrule = [
|
||||||
"blur, waybar"
|
"blur, waybar"
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,6 @@
|
||||||
inputs,
|
inputs,
|
||||||
config,
|
config,
|
||||||
system,
|
system,
|
||||||
username,
|
|
||||||
osConfig,
|
osConfig,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
|
|
@ -28,54 +27,12 @@ let
|
||||||
song_info=$(playerctl metadata --format '{{title}} {{artist}}')
|
song_info=$(playerctl metadata --format '{{title}} {{artist}}')
|
||||||
echo "$song_info"
|
echo "$song_info"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
mkWall = pkgs.writeShellScriptBin "setWall" ''
|
|
||||||
url="$1"
|
|
||||||
filepath="/tmp/wall_cache/$(echo -n "$url" | base64 | tr -d '\n')"
|
|
||||||
|
|
||||||
if [[ ! -f "$filepath" ]]; then
|
|
||||||
curl -sL "$url" -o "$filepath"
|
|
||||||
fi
|
|
||||||
|
|
||||||
${config.services.swww.package}/bin/swww img "$filepath" \
|
|
||||||
--transition-fps 45 \
|
|
||||||
--transition-duration 1 \
|
|
||||||
--transition-type random
|
|
||||||
'';
|
|
||||||
|
|
||||||
rofiWall = pkgs.writeShellScript "rofiWall" ''
|
|
||||||
url=$(rofi -i -dmenu -config ~/.config/rofi/config.rasi -p "URL")
|
|
||||||
${mkWall}/bin/setWall "$url"
|
|
||||||
'';
|
|
||||||
|
|
||||||
# Change Wallpaper
|
|
||||||
wallRand = pkgs.writeShellScript "wallRand" ''
|
|
||||||
mapfile -t wallpapers < <(find /tmp/wall_cache -type f)
|
|
||||||
|
|
||||||
count="''${#wallpapers[@]}"
|
|
||||||
|
|
||||||
random_index=$(( RANDOM % count ))
|
|
||||||
selected="''${wallpapers[$random_index]}"
|
|
||||||
|
|
||||||
if [ ! -f "$selected" ]; then
|
|
||||||
echo "File not exist: $selected"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
${config.services.swww.package}/bin/swww img $selected --transition-fps 45 --transition-duration 1 --transition-type random
|
|
||||||
'';
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
# For wallpapers
|
|
||||||
systemd.user.tmpfiles.rules = [
|
|
||||||
"d /tmp/wall_cache 700 ${username} -"
|
|
||||||
];
|
|
||||||
|
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
mpvpaper # Video Wallpaper
|
mpvpaper # Video Wallpaper
|
||||||
hyprcursor
|
hyprcursor
|
||||||
libnotify
|
libnotify
|
||||||
mkWall
|
|
||||||
];
|
];
|
||||||
|
|
||||||
wayland.windowManager.hyprland = {
|
wayland.windowManager.hyprland = {
|
||||||
|
|
@ -106,7 +63,8 @@ in
|
||||||
mainMod
|
mainMod
|
||||||
pkgs
|
pkgs
|
||||||
monitors
|
monitors
|
||||||
rofiWall
|
config
|
||||||
|
lib
|
||||||
;
|
;
|
||||||
nvidia-offload-enabled = osConfig.hardware.nvidia.prime.offload.enableOffloadCmd;
|
nvidia-offload-enabled = osConfig.hardware.nvidia.prime.offload.enableOffloadCmd;
|
||||||
};
|
};
|
||||||
|
|
@ -181,7 +139,7 @@ in
|
||||||
package = inputs.swww.packages.${system}.swww;
|
package = inputs.swww.packages.${system}.swww;
|
||||||
};
|
};
|
||||||
|
|
||||||
# === hyprpaper === #
|
# === hyprpaper (Disabled) === #
|
||||||
services.hyprpaper = {
|
services.hyprpaper = {
|
||||||
enable = false;
|
enable = false;
|
||||||
settings = {
|
settings = {
|
||||||
|
|
@ -384,33 +342,6 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# === waybar === #
|
|
||||||
systemd.user.services.waybar = {
|
|
||||||
Unit = {
|
|
||||||
PartOf = [ "graphical-session.target" ];
|
|
||||||
After = [ "graphical-session.target" ];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
programs.waybar = {
|
|
||||||
enable = true;
|
|
||||||
style = ../../home/config/waybar/style.css;
|
|
||||||
settings = import ../../home/config/waybar/config.nix {
|
|
||||||
inherit
|
|
||||||
terminal
|
|
||||||
osConfig
|
|
||||||
wallRand
|
|
||||||
rofiWall
|
|
||||||
pkgs
|
|
||||||
lib
|
|
||||||
;
|
|
||||||
};
|
|
||||||
systemd = {
|
|
||||||
enable = true;
|
|
||||||
target = "graphical-session.target";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
# === swaync === #
|
# === swaync === #
|
||||||
services.swaync = {
|
services.swaync = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
|
||||||
424
home/user/waybar.nix
Normal file
424
home/user/waybar.nix
Normal file
|
|
@ -0,0 +1,424 @@
|
||||||
|
{
|
||||||
|
settings ? [ ],
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
osConfig,
|
||||||
|
config,
|
||||||
|
username,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
mkWall = import ../scripts/mkWall.nix { inherit config pkgs; };
|
||||||
|
rofiWall = import ../scripts/rofiwall.nix { inherit config pkgs; };
|
||||||
|
|
||||||
|
# Change Wallpaper
|
||||||
|
wallRand = pkgs.writeShellScript "wallRand" ''
|
||||||
|
mapfile -t wallpapers < <(find /tmp/wall_cache -type f)
|
||||||
|
|
||||||
|
count="''${#wallpapers[@]}"
|
||||||
|
|
||||||
|
random_index=$(( RANDOM % count ))
|
||||||
|
selected="''${wallpapers[$random_index]}"
|
||||||
|
|
||||||
|
if [ ! -f "$selected" ]; then
|
||||||
|
echo "File not exist: $selected"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
${config.services.swww.package}/bin/swww img $selected --transition-fps 45 --transition-duration 1 --transition-type random
|
||||||
|
'';
|
||||||
|
|
||||||
|
rbwSelector = import ../scripts/rbwSelector.nix { inherit pkgs; };
|
||||||
|
|
||||||
|
toggleRecord = pkgs.callPackage ../scripts/record.nix { };
|
||||||
|
in
|
||||||
|
{
|
||||||
|
home.packages = [
|
||||||
|
mkWall
|
||||||
|
];
|
||||||
|
|
||||||
|
# For wallpapers
|
||||||
|
systemd.user.tmpfiles.rules = [
|
||||||
|
"d /tmp/wall_cache 700 ${username} -"
|
||||||
|
];
|
||||||
|
|
||||||
|
# === waybar === #
|
||||||
|
systemd.user.services.waybar = {
|
||||||
|
Unit = {
|
||||||
|
PartOf = [ "graphical-session.target" ];
|
||||||
|
After = [ "graphical-session.target" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
programs.waybar = {
|
||||||
|
enable = true;
|
||||||
|
style = ../../home/config/waybar/style.css;
|
||||||
|
settings =
|
||||||
|
let
|
||||||
|
commonConfig = {
|
||||||
|
layer = "top";
|
||||||
|
exclusive = true;
|
||||||
|
passthrough = false;
|
||||||
|
position = "top";
|
||||||
|
fixed-center = true;
|
||||||
|
ipc = true;
|
||||||
|
margin-top = 0;
|
||||||
|
margin-left = 0;
|
||||||
|
margin-right = 0;
|
||||||
|
margin-bottom = 0;
|
||||||
|
|
||||||
|
modules-center = [
|
||||||
|
"hyprland/window"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
modulesConfig =
|
||||||
|
let
|
||||||
|
terminalRun = "${config.programs.ghostty.package}/bin/ghostty -e";
|
||||||
|
in
|
||||||
|
{
|
||||||
|
"hyprland/workspaces" = {
|
||||||
|
active-only = false;
|
||||||
|
all-outputs = true;
|
||||||
|
format = "{icon}";
|
||||||
|
show-special = false;
|
||||||
|
on-click = "activate";
|
||||||
|
on-scroll-up = "hyprctl dispatch workspace e+1";
|
||||||
|
on-scroll-down = "hyprctl dispatch workspace e-1";
|
||||||
|
persistent-workspaces = {
|
||||||
|
"1" = [ ];
|
||||||
|
"2" = [ ];
|
||||||
|
"3" = [ ];
|
||||||
|
"4" = [ ];
|
||||||
|
};
|
||||||
|
format-icons = {
|
||||||
|
active = "";
|
||||||
|
default = "";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
clock = {
|
||||||
|
format = "<b> {:%H:%M %d/%m}</b>";
|
||||||
|
tooltip-format = "{:%A %d %B %Y}";
|
||||||
|
};
|
||||||
|
actions = {
|
||||||
|
on-click-right = "mode";
|
||||||
|
on-click-forward = "tz_up";
|
||||||
|
on-click-backward = "tz_down";
|
||||||
|
on-scroll-up = "shift_up";
|
||||||
|
on-scroll-down = "shift_down";
|
||||||
|
};
|
||||||
|
"custom/os" = {
|
||||||
|
format = "";
|
||||||
|
on-click = "wlogout --protocol layer-shell";
|
||||||
|
};
|
||||||
|
cpu = {
|
||||||
|
format = " {usage}%";
|
||||||
|
max-length = 20;
|
||||||
|
interval = 5;
|
||||||
|
on-click-right = "${terminalRun} btop";
|
||||||
|
};
|
||||||
|
"hyprland/window" = {
|
||||||
|
format = "{}";
|
||||||
|
max-length = 40;
|
||||||
|
separate-outputs = true;
|
||||||
|
offscreen-css = true;
|
||||||
|
offscreen-css-text = "(inactive)";
|
||||||
|
rewrite = {
|
||||||
|
"nvim . (.*)" = " $1";
|
||||||
|
"(.*) - Visual Studio Code" = " $1";
|
||||||
|
"\\(\\d+\\) Discord (.*)" = " $1";
|
||||||
|
|
||||||
|
# Firefox
|
||||||
|
"(.*) - YouTube — Mozilla Firefox" = " $1";
|
||||||
|
"(.*)\\.pdf — Mozilla Firefox" = " $1";
|
||||||
|
"(.*) — Mozilla Firefox" = " $1";
|
||||||
|
"(.*) - YouTube Music — Mozilla Firefox" = " $1";
|
||||||
|
|
||||||
|
# Firefox Nightly
|
||||||
|
"(.*) - YouTube — Firefox Nightly" = " $1";
|
||||||
|
"(.*)\\.pdf — Firefox Nightly" = " $1";
|
||||||
|
"(.*) — Firefox Nightly" = " $1";
|
||||||
|
"(.*) - YouTube Music — Firefox Nightly" = " $1";
|
||||||
|
|
||||||
|
# Zen
|
||||||
|
"(.*) - YouTube — Zen Browser" = " $1";
|
||||||
|
"(.*) - YouTube Music — Zen Browser" = " $1";
|
||||||
|
"(.*) — Zen Browser" = " $1";
|
||||||
|
|
||||||
|
"(.*) - VLC media player" = " $1";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
memory = {
|
||||||
|
interval = 30;
|
||||||
|
format = " {used:0.1f}GB/{total:0.1f}G";
|
||||||
|
format-alt-click = "click";
|
||||||
|
tooltip = true;
|
||||||
|
tooltip-format = "{used:0.1f}GB/{total:0.1f}G";
|
||||||
|
on-click-right = "${terminalRun} btop";
|
||||||
|
};
|
||||||
|
mpris = {
|
||||||
|
interval = 10;
|
||||||
|
format = " {status_icon} <i>{title} | {artist} </i>";
|
||||||
|
format-paused = " {status_icon} <i>{title} | {artist} </i>";
|
||||||
|
on-click = "playerctl play-pause";
|
||||||
|
on-click-right = "playerctl next";
|
||||||
|
scroll-step = 5.0;
|
||||||
|
smooth-scrolling-threshold = 1;
|
||||||
|
status-icons = {
|
||||||
|
paused = "";
|
||||||
|
playing = "";
|
||||||
|
stopped = "";
|
||||||
|
};
|
||||||
|
max-length = 30;
|
||||||
|
};
|
||||||
|
pulseaudio = {
|
||||||
|
format = "{icon} {volume}%";
|
||||||
|
format-bluetooth = " {volume}%";
|
||||||
|
format-muted = " Muted";
|
||||||
|
format-icons = {
|
||||||
|
default = [
|
||||||
|
""
|
||||||
|
""
|
||||||
|
" "
|
||||||
|
" "
|
||||||
|
];
|
||||||
|
ignored-sinks = [
|
||||||
|
"Easy Effects Sink"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
scroll-step = 5.0;
|
||||||
|
on-click = "pavucontrol -t 3";
|
||||||
|
tooltip-format = "{icon} {desc} | {volume}%";
|
||||||
|
smooth-scrolling-threshold = 1;
|
||||||
|
};
|
||||||
|
temperature = {
|
||||||
|
interval = 10;
|
||||||
|
tooltip = true;
|
||||||
|
hwmon-path = [
|
||||||
|
"/sys/class/hwmon/hwmon1/temp1_input"
|
||||||
|
"/sys/class/thermal/thermal_zone0/temp"
|
||||||
|
];
|
||||||
|
critical-threshold = 82;
|
||||||
|
format-critical = " {temperatureC}°C";
|
||||||
|
format = "{icon} {temperatureC}°C";
|
||||||
|
format-icons = [
|
||||||
|
""
|
||||||
|
""
|
||||||
|
""
|
||||||
|
""
|
||||||
|
];
|
||||||
|
on-click-right = "kitty -c ~/.config/kitty/kitty.conf --title btop sh -c 'btop'";
|
||||||
|
};
|
||||||
|
"custom/swaync" = {
|
||||||
|
tooltip = true;
|
||||||
|
format = "{icon}";
|
||||||
|
format-icons = {
|
||||||
|
notification = "";
|
||||||
|
none = "";
|
||||||
|
dnd-notification = "<span foreground='red'><sup></sup></span>";
|
||||||
|
dnd-none = "";
|
||||||
|
inhibited-notification = "<span foreground='red'><sup></sup></span>";
|
||||||
|
inhibited-none = "";
|
||||||
|
dnd-inhibited-notification = "<span foreground='red'><sup></sup></span>";
|
||||||
|
dnd-inhibited-none = "";
|
||||||
|
};
|
||||||
|
return-type = "json";
|
||||||
|
exec-if = "which swaync-client";
|
||||||
|
exec = "swaync-client -swb";
|
||||||
|
on-click = "sleep 0.1 && swaync-client -t -sw";
|
||||||
|
on-click-right = "swaync-client -d -sw";
|
||||||
|
escape = true;
|
||||||
|
};
|
||||||
|
"wlr/taskbar" = {
|
||||||
|
format = " {icon} ";
|
||||||
|
icon-size = 20;
|
||||||
|
all-outputs = false;
|
||||||
|
tooltip-format = "{title}";
|
||||||
|
on-click = "activate";
|
||||||
|
on-click-middle = "close";
|
||||||
|
ignore-list = [
|
||||||
|
"rofi"
|
||||||
|
"firefox"
|
||||||
|
"firefox-nightly"
|
||||||
|
"zen"
|
||||||
|
"kitty"
|
||||||
|
"jetbrains-studio"
|
||||||
|
"Brave-browser"
|
||||||
|
"Spotify"
|
||||||
|
"nemo"
|
||||||
|
"vlc"
|
||||||
|
"com.mitchellh.ghostty"
|
||||||
|
"code"
|
||||||
|
".virt-manager-wrapped"
|
||||||
|
"virt-manager"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
"custom/cava" = {
|
||||||
|
exec = "~/.config/scripts/waybarCava.sh";
|
||||||
|
format = "{}";
|
||||||
|
on-click = "${terminalRun} cava";
|
||||||
|
};
|
||||||
|
battery =
|
||||||
|
let
|
||||||
|
fullAt = if osConfig.services.tlp.enable then 80 else 96;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
full-at = fullAt;
|
||||||
|
states = {
|
||||||
|
good = fullAt;
|
||||||
|
warning = 30;
|
||||||
|
critical = 15;
|
||||||
|
};
|
||||||
|
format = "{icon} {capacity}%";
|
||||||
|
format-icons = [
|
||||||
|
""
|
||||||
|
""
|
||||||
|
""
|
||||||
|
""
|
||||||
|
""
|
||||||
|
""
|
||||||
|
""
|
||||||
|
""
|
||||||
|
""
|
||||||
|
""
|
||||||
|
""
|
||||||
|
];
|
||||||
|
format-charging = " {capacity}%";
|
||||||
|
format-plugged = " {capacity}%";
|
||||||
|
format-alt = "{icon} {time}";
|
||||||
|
};
|
||||||
|
network = {
|
||||||
|
format = "{ifname}";
|
||||||
|
format-wifi = "";
|
||||||
|
format-ethernet = "";
|
||||||
|
format-disconnected = "";
|
||||||
|
tooltip-format = "{ifname} via {gwaddr} ";
|
||||||
|
tooltip-format-wifi = " {essid}: {signalStrength}%";
|
||||||
|
tooltip-format-ethernet = "{ifname} via {gwaddr} ";
|
||||||
|
tooltip-format-disconnected = "Disconnected";
|
||||||
|
max-length = 50;
|
||||||
|
interval = 5;
|
||||||
|
on-click = "~/.config/scripts/rofiWifi.sh";
|
||||||
|
};
|
||||||
|
idle_inhibitor = {
|
||||||
|
format = "{icon}";
|
||||||
|
format-icons = {
|
||||||
|
activated = "";
|
||||||
|
deactivated = "";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
"custom/wireguard" = {
|
||||||
|
format = "{icon}";
|
||||||
|
format-icons = {
|
||||||
|
connected = "";
|
||||||
|
disconnected = "";
|
||||||
|
};
|
||||||
|
exec = "~/.config/scripts/wgStatus.sh";
|
||||||
|
exec-if = "which wg-quick";
|
||||||
|
on-click = "~/.config/scripts/wgStatus.sh toggle";
|
||||||
|
tooltip = true;
|
||||||
|
interval = 3;
|
||||||
|
return-type = "json";
|
||||||
|
escape = true;
|
||||||
|
};
|
||||||
|
"custom/gamemode" = {
|
||||||
|
format = "{icon}";
|
||||||
|
format-icons = {
|
||||||
|
active = "";
|
||||||
|
inactive = "";
|
||||||
|
};
|
||||||
|
exec = "~/.config/scripts/gamemodeStatus.sh";
|
||||||
|
on-click = "~/.config/scripts/gamemodeStatus.sh toggle";
|
||||||
|
tooltip = true;
|
||||||
|
interval = 3;
|
||||||
|
return-type = "json";
|
||||||
|
escape = true;
|
||||||
|
};
|
||||||
|
"custom/wallRand" = {
|
||||||
|
format = "";
|
||||||
|
on-click = "${rofiWall}";
|
||||||
|
on-click-right = "${wallRand}";
|
||||||
|
};
|
||||||
|
"custom/airplay" =
|
||||||
|
let
|
||||||
|
toggleScript = pkgs.writeShellScript "airplayStatus" ''
|
||||||
|
SERVICE="uxplay"
|
||||||
|
ICON=""
|
||||||
|
|
||||||
|
if [ "$1" = "toggle" ]; then
|
||||||
|
if systemctl --user is-active --quiet "$SERVICE"; then
|
||||||
|
systemctl --user stop "$SERVICE"
|
||||||
|
notify-send "$ICON Airplay" "off" >/dev/null 2>&1
|
||||||
|
else
|
||||||
|
systemctl --user start "$SERVICE"
|
||||||
|
notify-send "$ICON Airplay" "on" >/dev/null 2>&1
|
||||||
|
fi
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! systemctl --user is-active --quiet "$SERVICE"; then
|
||||||
|
echo "{\"text\": \"inactive\", \"tooltip\": \"airplay is inactive\", \"alt\": \"inactive\", \"class\": \"inactive\"}"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "{\"text\": \"active\", \"tooltip\": \"airplay is running\", \"alt\": \"active\", \"class\": \"active\"}"
|
||||||
|
exit 0
|
||||||
|
'';
|
||||||
|
in
|
||||||
|
{
|
||||||
|
format = "{icon}";
|
||||||
|
format-icons = {
|
||||||
|
active = "";
|
||||||
|
inactive = "";
|
||||||
|
};
|
||||||
|
exec = toggleScript;
|
||||||
|
interval = 3;
|
||||||
|
tooltip = true;
|
||||||
|
return-type = "json";
|
||||||
|
escape = true;
|
||||||
|
on-click = "${toggleScript} toggle";
|
||||||
|
};
|
||||||
|
"custom/bitwarden" = {
|
||||||
|
format = "";
|
||||||
|
on-click = "${rbwSelector}";
|
||||||
|
};
|
||||||
|
"custom/recording" = {
|
||||||
|
exec = "[ -f \"/tmp/wf-recorder.pid\" ] && echo \"\" || echo \"\" ";
|
||||||
|
interval = 1;
|
||||||
|
on-click = "${toggleRecord}";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
otherConfig = {
|
||||||
|
modules-left = [
|
||||||
|
"custom/os"
|
||||||
|
"hyprland/workspaces"
|
||||||
|
"clock"
|
||||||
|
"mpris"
|
||||||
|
"custom/cava"
|
||||||
|
];
|
||||||
|
modules-right = [
|
||||||
|
"wlr/taskbar"
|
||||||
|
"temperature"
|
||||||
|
"custom/recording"
|
||||||
|
"idle_inhibitor"
|
||||||
|
"network"
|
||||||
|
"cpu"
|
||||||
|
"memory"
|
||||||
|
"pulseaudio"
|
||||||
|
"battery"
|
||||||
|
"custom/swaync"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
finalList = if ((builtins.length settings) == 0) then [ otherConfig ] else settings;
|
||||||
|
in
|
||||||
|
map (dev: dev // modulesConfig // commonConfig) finalList;
|
||||||
|
|
||||||
|
systemd = {
|
||||||
|
enable = true;
|
||||||
|
target = "graphical-session.target";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
username,
|
username,
|
||||||
|
config,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
|
|
@ -35,23 +36,6 @@ in
|
||||||
{
|
{
|
||||||
wayland.windowManager.hyprland = {
|
wayland.windowManager.hyprland = {
|
||||||
settings = {
|
settings = {
|
||||||
windowrulev2 = [
|
|
||||||
# Meidia control
|
|
||||||
"move 1680 59, class: ^(org.pulseaudio.pavucontrol)$"
|
|
||||||
"size 868 561, class: ^(org.pulseaudio.pavucontrol)$"
|
|
||||||
|
|
||||||
# Local Send (File Sharing)
|
|
||||||
"size 523 1372, class: ^(localsend_app)$"
|
|
||||||
"move 2024 56, class: ^(localsend_app)$"
|
|
||||||
|
|
||||||
# Airplay
|
|
||||||
"size 487 1055, class: ^(GStreamer)$"
|
|
||||||
|
|
||||||
# Bluetooth
|
|
||||||
"move 1943 59, class: ^(blueberry.py)$"
|
|
||||||
"size 605 763, class: ^(blueberry.py)$"
|
|
||||||
];
|
|
||||||
|
|
||||||
monitors = [
|
monitors = [
|
||||||
''desc:LG Display 0x0665, preferred, 0x0, 1.25''
|
''desc:LG Display 0x0665, preferred, 0x0, 1.25''
|
||||||
];
|
];
|
||||||
|
|
@ -60,6 +44,33 @@ in
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# waybar
|
||||||
|
(import ../../../home/user/waybar.nix {
|
||||||
|
settings = [
|
||||||
|
{
|
||||||
|
output = "eDP-1";
|
||||||
|
modules-left = [
|
||||||
|
"custom/os"
|
||||||
|
"hyprland/workspaces"
|
||||||
|
"clock"
|
||||||
|
"mpris"
|
||||||
|
];
|
||||||
|
modules-right = [
|
||||||
|
"wlr/taskbar"
|
||||||
|
"temperature"
|
||||||
|
"custom/wallRand"
|
||||||
|
"custom/wireguard"
|
||||||
|
"custom/recording"
|
||||||
|
"idle_inhibitor"
|
||||||
|
"network"
|
||||||
|
"pulseaudio"
|
||||||
|
"battery"
|
||||||
|
"custom/swaync"
|
||||||
|
];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
})
|
||||||
|
|
||||||
# Git
|
# Git
|
||||||
(import ../../../home/user/git.nix {
|
(import ../../../home/user/git.nix {
|
||||||
inherit username;
|
inherit username;
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
|
inherit (lib) optionalString;
|
||||||
monitors = [
|
monitors = [
|
||||||
"desc:ASUSTek COMPUTER INC ASUS VG32VQ1B 0x00002271"
|
"desc:ASUSTek COMPUTER INC ASUS VG32VQ1B 0x00002271"
|
||||||
"desc:Acer Technologies XV272U V3 1322131231233"
|
"desc:Acer Technologies XV272U V3 1322131231233"
|
||||||
|
|
@ -74,6 +75,65 @@ in
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# waybar
|
||||||
|
(import ../../../home/user/waybar.nix {
|
||||||
|
settings = [
|
||||||
|
# monitor 1
|
||||||
|
{
|
||||||
|
output = "DP-5";
|
||||||
|
modules-left = [
|
||||||
|
"custom/os"
|
||||||
|
"hyprland/workspaces"
|
||||||
|
"clock"
|
||||||
|
"custom/cava"
|
||||||
|
"mpris"
|
||||||
|
];
|
||||||
|
modules-right = (
|
||||||
|
[
|
||||||
|
"wlr/taskbar"
|
||||||
|
]
|
||||||
|
++ (
|
||||||
|
if config.programs.gamemode.enable then
|
||||||
|
[
|
||||||
|
"custom/gamemode"
|
||||||
|
]
|
||||||
|
else
|
||||||
|
[ ]
|
||||||
|
)
|
||||||
|
++ [
|
||||||
|
"custom/bitwarden"
|
||||||
|
"custom/airplay"
|
||||||
|
"custom/wallRand"
|
||||||
|
"custom/wireguard"
|
||||||
|
"custom/recording"
|
||||||
|
"idle_inhibitor"
|
||||||
|
"network"
|
||||||
|
"cpu"
|
||||||
|
"memory"
|
||||||
|
"pulseaudio"
|
||||||
|
"custom/swaync"
|
||||||
|
]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
# monitor 2
|
||||||
|
{
|
||||||
|
output = "DP-6";
|
||||||
|
height = 54;
|
||||||
|
modules-left = [
|
||||||
|
"clock"
|
||||||
|
"mpris"
|
||||||
|
];
|
||||||
|
modules-right = [
|
||||||
|
"wlr/taskbar"
|
||||||
|
"temperature"
|
||||||
|
"cpu"
|
||||||
|
"memory"
|
||||||
|
"pulseaudio"
|
||||||
|
];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
})
|
||||||
|
|
||||||
# Hyprland
|
# Hyprland
|
||||||
(import ../../../home/user/hyprland.nix { inherit monitors; })
|
(import ../../../home/user/hyprland.nix { inherit monitors; })
|
||||||
{
|
{
|
||||||
|
|
@ -92,7 +152,6 @@ in
|
||||||
inherit username;
|
inherit username;
|
||||||
email = "danny10132024@gmail.com";
|
email = "danny10132024@gmail.com";
|
||||||
})
|
})
|
||||||
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue