Standardize networking, add more Librewolf configs, standardize synatxing for Waybar, generalize app usage
This commit is contained in:
parent
f4acc6c10d
commit
0042da23be
17 changed files with 90 additions and 114 deletions
|
@ -32,7 +32,10 @@
|
|||
on-click = "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle";
|
||||
on-click-middle = "wpctl set-volume @DEFAULT_AUDIO_SINK@ 100%";
|
||||
on-click-right = "wpctl set-volume @DEFAULT_AUDIO_SINK@ 60%";
|
||||
ignored-sinks = ["Easy Effects Sink" "USB FS AUDIO Analog Stereo"];
|
||||
ignored-sinks = [
|
||||
"Easy Effects Sink"
|
||||
"USB FS AUDIO Analog Stereo"
|
||||
];
|
||||
};
|
||||
|
||||
# CPU, Ram and Vram
|
||||
|
@ -43,6 +46,7 @@
|
|||
ramModule = {
|
||||
format = " {used}G";
|
||||
tooltip = false;
|
||||
interval = 3;
|
||||
};
|
||||
vramModule = {
|
||||
exec = pkgs.writeScript "vramScript" ''
|
||||
|
@ -56,7 +60,7 @@
|
|||
|
||||
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')
|
||||
temperature=$(${pkgs.lm_sensors}/bin/sensors | grep 'edge' | awk '{print $2}' | sed 's/[^0-9.-]//g')
|
||||
fi
|
||||
|
||||
# Check if VRAM usage is under 1GB
|
||||
|
@ -80,7 +84,6 @@
|
|||
# Clocks
|
||||
longClockModule = {
|
||||
exec = pkgs.writeScript "longClock" ''
|
||||
# Long clock format, with a numeric date and military time tooltip
|
||||
time=$(date +'%a %b %d %l:%M:%S%p' | tr -s ' ')
|
||||
date=$(date "+%Y-%m-%d")
|
||||
echo "{\"text\":\" $time\",\"tooltip\":\"$date\"}"
|
||||
|
@ -99,9 +102,7 @@
|
|||
};
|
||||
|
||||
# Tray, gamemode, bluetooth, and network tray modules
|
||||
trayModule = {
|
||||
spacing = 5;
|
||||
};
|
||||
trayModule.spacing = 5;
|
||||
networkModule = {
|
||||
format-ethernet = "";
|
||||
format-wifi = "";
|
||||
|
@ -140,37 +141,11 @@
|
|||
|
||||
# Special per-bar modules
|
||||
mediaModule = {
|
||||
exec-if = "mpc status | grep -q '^\\[playing\\] \\|^\\[paused\\]'";
|
||||
exec = pkgs.writeScript "mpvMetadata" ''
|
||||
get_metadata() {
|
||||
mpc | head -n 1
|
||||
}
|
||||
|
||||
truncate_string() {
|
||||
local str="$1"
|
||||
local max_length=30
|
||||
if [ $(expr length "$str") -gt $max_length ]; then
|
||||
str=$(expr substr "$str" 1 $max_length)...
|
||||
fi
|
||||
echo "$str"
|
||||
}
|
||||
|
||||
if mpc status 2>/dev/null | grep -q playing; then
|
||||
song_name=$(get_metadata | awk -F ' - ' '{print $2}')
|
||||
if [ -z "$song_name" ]; then
|
||||
song_name=$(get_metadata)
|
||||
fi
|
||||
echo "{\"text\":\"$(truncate_string " $song_name")\",\"tooltip\":\"$(get_metadata)\"}"
|
||||
elif mpc status 2>/dev/null | grep -q paused; then
|
||||
artist_name=$(get_metadata | awk -F ' - ' '{print $1}')
|
||||
if [ -z "$artist_name" ]; then
|
||||
artist_name=$(get_metadata)
|
||||
fi
|
||||
echo "{\"text\":\"$(truncate_string " $artist_name")\",\"tooltip\":\"$(get_metadata)\",\"class\":\"paused\"}"
|
||||
fi
|
||||
'';
|
||||
format = "{}";
|
||||
return-type = "json";
|
||||
format = " {title}";
|
||||
format-paused = " {artist}";
|
||||
format-stopped = "";
|
||||
format-disconnected = "";
|
||||
tooltip-format = "{artist} - {title}";
|
||||
interval = 2;
|
||||
max-length = 30;
|
||||
on-click = "mpc toggle";
|
||||
|
@ -196,39 +171,17 @@
|
|||
on-click = "makotoggle";
|
||||
};
|
||||
weatherModule = {
|
||||
exec = let
|
||||
weatherConf = pkgs.writeText "weather.jsonc" ''
|
||||
{
|
||||
"logo": {
|
||||
"source": "none"
|
||||
},
|
||||
"modules": [
|
||||
{
|
||||
"type": "weather",
|
||||
"outputFormat": "%0A%t%0A%C%0A%l"
|
||||
}
|
||||
]
|
||||
}
|
||||
'';
|
||||
in pkgs.writeScript "weatherScript" ''
|
||||
# Fetch weather data
|
||||
fetch=$(fastfetch -c ${weatherConf} | sed 's/[[:space:]]*$//')
|
||||
temp=$(echo "$fetch" | sed -n '2s/^\+//p')
|
||||
condition=$(echo "$fetch" | sed -n '3p')
|
||||
location=$(echo "$fetch" | sed -n '4p')
|
||||
|
||||
# Display weather emoji and temperature
|
||||
echo {\"text\":\" $temp\",\"tooltip\":\"$location: $condition\"}
|
||||
'';
|
||||
format = "<span font_size='11pt'>{}</span>";
|
||||
exec = "${pkgs.wttrbar}/bin/wttrbar --ampm";
|
||||
format = "{}°";
|
||||
tooltip = true;
|
||||
return-type = "json";
|
||||
interval = 150;
|
||||
interval = 3600;
|
||||
};
|
||||
|
||||
# Laptop modules
|
||||
backlightModule = {
|
||||
format = "{icon} {percent}%";
|
||||
format-icons = ["" ""];
|
||||
format-icons = [ "" "" ];
|
||||
tooltip = false;
|
||||
};
|
||||
batteryModule = {
|
||||
|
@ -238,7 +191,7 @@
|
|||
critical = 15;
|
||||
};
|
||||
format = "{icon} {capacity}%";
|
||||
format-icons = ["" "" "" "" ""];
|
||||
format-icons = [ "" "" "" "" "" ];
|
||||
};
|
||||
in {
|
||||
enable = config.home.desktop.enable;
|
||||
|
@ -247,8 +200,14 @@
|
|||
name = "bar1";
|
||||
position = "top";
|
||||
layer = "bottom";
|
||||
output = [ config.displays.d1 "VGA-1" ];
|
||||
modules-left = ["sway/workspaces" "sway/window"];
|
||||
output = [
|
||||
config.displays.d1
|
||||
"VGA-1"
|
||||
];
|
||||
modules-left = [
|
||||
"sway/workspaces"
|
||||
"sway/window"
|
||||
];
|
||||
modules-right = [
|
||||
"pulseaudio"
|
||||
"cpu"
|
||||
|
@ -279,10 +238,13 @@
|
|||
position = "top";
|
||||
layer = "bottom";
|
||||
output = [ config.displays.d2 ];
|
||||
modules-left = ["sway/workspaces" "sway/window"];
|
||||
modules-left = [
|
||||
"sway/workspaces"
|
||||
"sway/window"
|
||||
];
|
||||
modules-right = [
|
||||
"pulseaudio"
|
||||
"custom/media"
|
||||
"mpd"
|
||||
"custom/notifs"
|
||||
"cpu"
|
||||
"memory"
|
||||
|
@ -292,7 +254,7 @@
|
|||
"sway/workspaces" = swayWorkspacesModule;
|
||||
"sway/window" = swayWindowsModule;
|
||||
"pulseaudio" = pulseModule;
|
||||
"custom/media" = mediaModule;
|
||||
"mpd" = mediaModule;
|
||||
"custom/notifs" = notificationModule;
|
||||
"cpu" = cpuModule;
|
||||
"memory" = ramModule;
|
||||
|
@ -304,7 +266,10 @@
|
|||
position = "top";
|
||||
layer = "bottom";
|
||||
output = [ config.displays.d3 ];
|
||||
modules-left = ["sway/workspaces" "sway/window"];
|
||||
modules-left = [
|
||||
"sway/workspaces"
|
||||
"sway/window"
|
||||
];
|
||||
modules-right = [
|
||||
"pulseaudio"
|
||||
"custom/weather"
|
||||
|
@ -326,11 +291,19 @@
|
|||
name = "laptop";
|
||||
position = "top";
|
||||
layer = "bottom";
|
||||
output = [ "eDP-1" "LVDS-1" "DSI-1" "HDMI-A-1" ];
|
||||
modules-left = [ "sway/workspaces" "sway/window" ];
|
||||
output = [
|
||||
"eDP-1"
|
||||
"LVDS-1"
|
||||
"DSI-1"
|
||||
"HDMI-A-1"
|
||||
];
|
||||
modules-left = [
|
||||
"sway/workspaces"
|
||||
"sway/window"
|
||||
];
|
||||
modules-right = [
|
||||
"pulseaudio"
|
||||
"custom/media"
|
||||
"mpd"
|
||||
"custom/notifs"
|
||||
"custom/weather2"
|
||||
"cpu"
|
||||
|
@ -348,7 +321,7 @@
|
|||
"sway/workspaces" = swayWorkspacesModule;
|
||||
"sway/window" = swayWindowsModule;
|
||||
"pulseaudio" = pulseModule;
|
||||
"custom/media" = mediaModule;
|
||||
"mpd" = mediaModule;
|
||||
"custom/notifs" = notificationModule;
|
||||
"custom/weather2" = weatherModule;
|
||||
"cpu" = cpuModule;
|
||||
|
@ -411,7 +384,7 @@
|
|||
#scratchpad {
|
||||
margin-left: 2px;
|
||||
}
|
||||
#cpu, #memory, #custom-vram, #custom-media, #custom-clock-long, #custom-clock-short, #backlight, #battery, #custom-weather, #custom-weather2, #custom-notifs {
|
||||
#cpu, #memory, #custom-vram, #mpd, #custom-clock-long, #custom-clock-short, #backlight, #battery, #custom-weather, #custom-weather2, #custom-notifs {
|
||||
margin: 0 5px 0 2px;
|
||||
}
|
||||
#cpu {
|
||||
|
@ -423,9 +396,12 @@
|
|||
#custom-vram {
|
||||
border-bottom: 3px solid #33FF00;
|
||||
}
|
||||
#custom-media {
|
||||
#mpd {
|
||||
border-bottom: 3px solid #ffb066;
|
||||
}
|
||||
#mpd.paused {
|
||||
color: #888;
|
||||
}
|
||||
#custom-clock-long {
|
||||
border-bottom: 3px solid #0a6cf5;
|
||||
}
|
||||
|
@ -438,9 +414,6 @@
|
|||
#battery {
|
||||
border-bottom: 3px solid #fcfc16;
|
||||
}
|
||||
#custom-media.paused {
|
||||
color: #888;
|
||||
}
|
||||
#custom-weather {
|
||||
border-bottom: 3px solid #3823C4;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue