1
0
Fork 0
forked from Bun/nixos-config

Alright this ain't finished cause of the home stuff but I don't wanna lose what I've done. Impermanence, disko, lots of changes. TODO: add modularity to home.

This commit is contained in:
Jimbo 2024-11-02 17:19:40 -04:00
parent 7a3f60038b
commit 15ab10152b
109 changed files with 766 additions and 749 deletions

View file

@ -28,10 +28,6 @@
url = "https://raw.githubusercontent.com/iguanajuice/sway-font-awesome/6b7a9d08974eea1b9cddb8d444e1c89d6837083a/icons";
sha256 = "09ki5qw1h91kd33k3fwzq7cb6ck8sq4haswgizrsy387sfr2a75x";
}}
# Switch to workspace 1
workspace ${config.ws.w7}
workspace ${config.ws.w1}
'';
};
}

View file

@ -5,8 +5,8 @@
# Set default modifier and variables
primeMod = "Mod4";
secMod = "Mod1";
resizeAmount = ''55'';
sendNotif = ''notify-send --expire-time=1500'';
resizeAmount = "55";
sendNotif = "notify-send --expire-time=1500";
in {
# Hotkeys
modifier = "${primeMod}";

View file

@ -1,14 +1,15 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
wl-clipboard
wdisplays
clipman
swaybg
libnotify
grim
slurp
swappy
jq
lm_sensors
wl-clipboard
wdisplays
jq
];
}

View file

@ -5,30 +5,30 @@
# Assign workspaces to config
workspaceOutputAssign = let
workspaces1 = [
"${config.ws.w0}"
"${config.ws.w1}"
"${config.ws.w2}"
"${config.ws.w3}"
"${config.ws.w1a}"
"${config.ws.w2a}"
"${config.ws.w3a}"
];
"${config.ws.w0}"
"${config.ws.w1}"
"${config.ws.w2}"
"${config.ws.w3}"
"${config.ws.w1a}"
"${config.ws.w2a}"
"${config.ws.w3a}"
];
workspaces2 = [
"${config.ws.w4}"
"${config.ws.w5}"
"${config.ws.w6}"
"${config.ws.w4a}"
"${config.ws.w5a}"
"${config.ws.w6a}"
];
"${config.ws.w4}"
"${config.ws.w5}"
"${config.ws.w6}"
"${config.ws.w4a}"
"${config.ws.w5a}"
"${config.ws.w6a}"
];
workspaces3 = [
"${config.ws.w7}"
"${config.ws.w8}"
"${config.ws.w9}"
"${config.ws.w7a}"
"${config.ws.w8a}"
"${config.ws.w9a}"
];
"${config.ws.w7}"
"${config.ws.w8}"
"${config.ws.w9}"
"${config.ws.w7a}"
"${config.ws.w8a}"
"${config.ws.w9a}"
];
assign = output: workspaces:
map (workspace: {
inherit workspace;
@ -37,94 +37,103 @@
workspaces;
in
(assign "${config.displays.d1}" workspaces1) ++
(assign "${config.displays.d2}" workspaces2) ++
(assign "${config.displays.d3}" workspaces3);
(assign "${config.displays.d2}" workspaces2) ++
(assign "${config.displays.d3}" workspaces3);
# Rules
defaultWorkspace = config.ws.w1;
window = {
border = config.look.border.int;
titlebar = false;
commands = [
# Scratchpads
{
criteria = {con_mark = "scratchpad";};
criteria = { con_mark = "scratchpad"; };
command = ''floating enable, sticky enable, move scratchpad, mark borderless'';
}
{
criteria = {app_id = "gotop";};
criteria = { app_id = "gotop"; };
command = ''mark scratchpad'';
}
{
criteria = {app_id = "music";};
criteria = { app_id = "music"; };
command = ''mark scratchpad'';
}
{
criteria = {app_id = "sound";};
criteria = { app_id = "sound"; };
command = ''mark scratchpad'';
}
{
criteria = {app_id = "com.github.wwmm.easyeffects";};
criteria = { app_id = "com.github.wwmm.easyeffects"; };
command = ''mark scratchpad, opacity 0.9'';
}
# Create a "Scratchpad" for apps I don't want to be seen when launched
{
criteria = {con_mark = "hiddenaway";};
criteria = { con_mark = "hiddenaway"; };
command = ''move scratchpad'';
}
# Give apps that don't have them borders
{
criteria = {con_mark = "borderless";};
criteria = { con_mark = "borderless"; };
command = ''border pixel ${config.look.border.string}'';
}
{
criteria = {app_id = "com.github.wwmm.easyeffects";};
criteria = { app_id = "com.github.wwmm.easyeffects"; };
command = ''mark borderless'';
}
{
criteria = {class = "steam";};
criteria = { class = "steam"; };
command = ''mark borderless'';
}
{
criteria = {app_id = "swappy";};
criteria = { app_id = "swappy"; };
command = ''mark borderless'';
}
{
criteria = {app_id = "virt-manager";};
criteria = { app_id = "virt-manager"; };
command = ''mark borderless'';
}
{
criteria = {window_role = "pop-up";};
criteria = { window_role = "pop-up"; };
command = ''mark borderless'';
}
# Floating or fullscreen rules
{
criteria = {app_id = "float";};
criteria = { app_id = "float"; };
command = ''floating enable'';
}
{
criteria = {title = "^GlobalShot";};
criteria = { title = "^GlobalShot"; };
command = ''floating enable, fullscreen enable global'';
}
];
};
assigns = {
# Broconfig.wsers
"${config.ws.w1}" = [{app_id = "MainBrowser";}];
"${config.ws.w1a}" = [{app_id = "AltBrowser";}];
"${config.ws.w1}" = [{ app_id = "MainBrowser"; }];
"${config.ws.w1a}" = [{ app_id = "AltBrowser"; }];
# Communication
"${config.ws.w3a}" = [{class = "zoom";}];
"${config.ws.w7}" = [{app_id = "MiscBrowser";} {app_id = "vesktop";} {class = "vesktop";}];
"${config.ws.w8}" = [{app_id = "org.gnome.Fractal";}];
"${config.ws.w9}" = [{app_id = "thunderbird";}];
"${config.ws.w3a}" = [{ class = "zoom"; }];
"${config.ws.w7}" = [
{ app_id = "MiscBrowser"; }
{ app_id = "vesktop"; }
{ class = "vesktop"; }
];
"${config.ws.w8}" = [{ app_id = "org.gnome.Fractal"; }];
"${config.ws.w9}" = [{ app_id = "thunderbird"; }];
# Else
"${config.ws.w2}" = [{class = "steam";} {app_id = "heroic";}];
"${config.ws.w2a}" = [{app_id = "looking-glass-client";}];
"${config.ws.w4a}" = [{app_id = "com.obsproject.Studio";}];
# Etc
"${config.ws.w2}" = [
{ class = "steam"; }
{app_id = "heroic";}
];
"${config.ws.w2a}" = [{ app_id = "looking-glass-client"; }];
"${config.ws.w4a}" = [{ app_id = "com.obsproject.Studio"; }];
};
focus.newWindow = "focus";
};

View file

@ -47,15 +47,14 @@
vramModule = {
exec = pkgs.writeScript "vramScript" ''
# Don't run the script if running on integrated graphics
if lspci -k | grep "Kernel driver in use: nvidia" &> /dev/null || lspci -k | grep "Kernel driver in use: amdgpu" &> /dev/null; then
gpu_driver=$(${pkgs.pciutils}/bin/lspci -k | grep -Eo "in use: (nvidia|amdgpu)" | awk '{print $3}')
# Run the nvidia-smi command and capture the VRAM usage and GPU utilization output
if lspci -k | grep "Kernel driver in use: nvidia" &> /dev/null; then
if [ -n "$gpu_driver" ]; then
if [ "$gpu_driver" == "nvidia" ]; then
vram_usage_mb=$(nvidia-smi --query-gpu=memory.used --format=csv,noheader,nounits)
temperature=$(nvidia-smi --query-gpu=temperature.gpu --format=csv,noheader,nounits)
# Check the drm memory if an AMD GPU is present
elif lspci -k | grep "Kernel driver in use: amdgpu" &> /dev/null; then
elif [ "$gpu_driver" == "amdgpu" ]; then
vram_usage_mb=$(echo "$(cat /sys/class/drm/card0/device/mem_info_vram_used || cat /sys/class/drm/card1/device/mem_info_vram_used) / 1024 / 1024" | bc)
temperature=$(sensors | grep 'edge' | awk '{print $2}' | sed 's/[^0-9.-]//g')
fi
@ -69,10 +68,8 @@
vram_usage_display="$(echo $vram_usage_gib)G"
fi
# Print the VRAM usage in MB or GiB, and include GPU utilization and temperature
echo "{\"text\":\"󰢮 $(echo $vram_usage_display)\",\"tooltip\":\"$(echo $temperature)°C\"}"
else
:
# Print the VRAM usage and temperature
echo "{\"text\":\"󰢮 $(echo $vram_usage_display)\",\"tooltip\":\"$(echo $temperature)°C\"}"
fi
'';
format = "{}";