mass reformat

This commit is contained in:
notgne2 2022-10-03 17:08:32 -07:00
parent ed1c53e94c
commit 9cb456ad60
No known key found for this signature in database
GPG key ID: 5CE0A245A2DAC84A
25 changed files with 1216 additions and 1043 deletions

View file

@ -1,7 +1,10 @@
inputs:
{ config, lib, pkgs, ... }:
with lib;
let
inputs: {
config,
lib,
pkgs,
...
}:
with lib; let
cfg = config.ezpcusr;
lockCommand = "${pkgs.swaylock-effects}/bin/swaylock --clock --indicator --screenshots --effect-scale 0.8 --effect-blur 8x3 --effect-vignette 0.2:0.5 --fade-in 0.5 --text-color ${config.ezcolors.base16.base08} --inside-color ${config.ezcolors.base16.base00} --ring-color ${config.ezcolors.base16.base01} --datestr \"%Y-%m-%e\" --timestr \"%I:%M %p\"";
@ -30,7 +33,8 @@ let
'';
scrsaveup =
if cfg.uploadScript != null then
if cfg.uploadScript != null
then
pkgs.writeScript "scr-save-up.sh" ''
#!${pkgs.zsh}/bin/zsh
LOC=$(${getscrloc})
@ -38,8 +42,7 @@ let
${cfg.uploadScript} $LOC | xargs echo -n | ${pkgs.wl-clipboard}/bin/wl-copy
notify-send "Screenshot Uploaded!"
''
else
null;
else null;
scrvidsaveclip = pkgs.writeScript "scr-vid-save-clip.sh" ''
#!${pkgs.zsh}/bin/zsh
@ -49,7 +52,8 @@ let
'';
scrvidsaveup =
if cfg.uploadScript != null then
if cfg.uploadScript != null
then
pkgs.writeScript "scr-vid-save-up.sh" ''
#!${pkgs.zsh}/bin/zsh
LOC=$(${getscrloc} mp4)
@ -57,41 +61,42 @@ let
${cfg.uploadScript} $LOC | ${pkgs.findutils}/bin/xargs echo -n | ${pkgs.wl-clipboard}/bin/wl-copy
notify-send "Screen Recording Uploaded!"
''
else
null;
else null;
scrvidstop = pkgs.writeScript "scr-vid-stop.sh" ''
#!${pkgs.zsh}/bin/zsh
${pkgs.procps}/bin/pkill -2 wf-recorder
'';
ezDrv = pkgs.runCommand "ez-commands" { } (''
mkdir -p $out/bin
ln -s ${selshot} $out/bin/selshot
ln -s ${selvid} $out/bin/selvid
ln -s ${getscrloc} $out/bin/getscrloc
ln -s ${scrsaveclip} $out/bin/scrsaveclip
ln -s ${scrvidsaveclip} $out/bin/scrvidsaveclip
ln -s ${scrvidstop} $out/bin/scrvidstop
'' + (
if cfg.uploadScript != null then ''
ln -s ${cfg.uploadScript} $out/bin/upload_file
ezDrv = pkgs.runCommand "ez-commands" {} (
''
mkdir -p $out/bin
ln -s ${selshot} $out/bin/selshot
ln -s ${selvid} $out/bin/selvid
ln -s ${getscrloc} $out/bin/getscrloc
ln -s ${scrsaveclip} $out/bin/scrsaveclip
ln -s ${scrvidsaveclip} $out/bin/scrvidsaveclip
ln -s ${scrvidstop} $out/bin/scrvidstop
''
+ (
if cfg.uploadScript != null
then ''
ln -s ${cfg.uploadScript} $out/bin/upload_file
ln -s ${scrsaveup} $out/bin/scrsaveup
ln -s ${scrvidsaveup} $out/bin/scrvidsaveup
'' else ""
)
ln -s ${scrsaveup} $out/bin/scrsaveup
ln -s ${scrvidsaveup} $out/bin/scrvidsaveup
''
else ""
)
);
in
{
in {
options.ezpcusr = {
enable = mkEnableOption "Enable simple PC user config";
uploadScript = mkOption {
type = types.nullOr types.package;
default = null;
description =
"A path to a script that takes a path to a file and returns a URL";
description = "A path to a script that takes a path to a file and returns a URL";
};
screenshotsPath = mkOption {
@ -102,18 +107,18 @@ in
outputOptions = mkOption {
description = "Additional output options";
default = { };
default = {};
type = types.attrsOf (types.attrsOf types.str);
};
waybarConfig = mkOption {
description = "Waybar config";
default = { };
default = {};
};
screensaver = mkOption {
description = "ezpcusr screensaver";
default = { };
default = {};
type = types.submodule {
options = {
enable = mkOption {
@ -137,7 +142,7 @@ in
favIcons = mkOption {
description = "Your favourite icons pack";
default = { };
default = {};
type = types.submodule {
options = {
name = mkOption {
@ -194,64 +199,76 @@ in
modifier = lib.mkDefault "Mod4";
keybindings =
let
# ugly stupid way of doing things but im lazy
bwRofi = pkgs.writeScript "bw-rofi" ''
#!${pkgs.bash}/bin/bash
LIST=$(${pkgs.bitwarden-cli}/bin/bw list items)
USERLIST=$(echo "$LIST" | ${pkgs.jq}/bin/jq -r '.[] | "\(.name) - \(.login.username)"')
keybindings = let
# ugly stupid way of doing things but im lazy
bwRofi = pkgs.writeScript "bw-rofi" ''
#!${pkgs.bash}/bin/bash
LIST=$(${pkgs.bitwarden-cli}/bin/bw list items)
USERLIST=$(echo "$LIST" | ${pkgs.jq}/bin/jq -r '.[] | "\(.name) - \(.login.username)"')
CHOSEN=$(echo "$USERLIST" | ${pkgs.rofi}/bin/rofi -dmenu -i)
NUMBER=$(echo "$USERLIST" | grep -n "^$CHOSEN$" | cut -d':' -f1)
NTH=$(expr $NUMBER - 1)
CHOSEN=$(echo "$USERLIST" | ${pkgs.rofi}/bin/rofi -dmenu -i)
NUMBER=$(echo "$USERLIST" | grep -n "^$CHOSEN$" | cut -d':' -f1)
NTH=$(expr $NUMBER - 1)
echo "$LIST" | ${pkgs.jq}/bin/jq -j -r ".[$NTH].login.password" | ${pkgs.wl-clipboard}/bin/wl-copy
'';
echo "$LIST" | ${pkgs.jq}/bin/jq -j -r ".[$NTH].login.password" | ${pkgs.wl-clipboard}/bin/wl-copy
'';
# very ugly stupid way of doing things but im still lazy
bwRofiOtp = pkgs.writeScript "bw-rofi-otp" ''
#!${pkgs.bash}/bin/bash
LIST=$(${pkgs.bitwarden-cli}/bin/bw list items)
USERLIST=$(echo "$LIST" | ${pkgs.jq}/bin/jq -r '.[] | "\(.name) - \(.login.username)"')
# very ugly stupid way of doing things but im still lazy
bwRofiOtp = pkgs.writeScript "bw-rofi-otp" ''
#!${pkgs.bash}/bin/bash
LIST=$(${pkgs.bitwarden-cli}/bin/bw list items)
USERLIST=$(echo "$LIST" | ${pkgs.jq}/bin/jq -r '.[] | "\(.name) - \(.login.username)"')
CHOSEN=$(echo "$USERLIST" | ${pkgs.rofi}/bin/rofi -dmenu -i)
NUMBER=$(echo "$USERLIST" | grep -n "^$CHOSEN$" | cut -d':' -f1)
NTH=$(expr $NUMBER - 1)
CHOSEN=$(echo "$USERLIST" | ${pkgs.rofi}/bin/rofi -dmenu -i)
NUMBER=$(echo "$USERLIST" | grep -n "^$CHOSEN$" | cut -d':' -f1)
NTH=$(expr $NUMBER - 1)
ID=$(echo "$LIST" | ${pkgs.jq}/bin/jq -j -r ".[$NTH].id")
ID=$(echo "$LIST" | ${pkgs.jq}/bin/jq -j -r ".[$NTH].id")
${pkgs.bitwarden-cli}/bin/bw get totp $ID | ${pkgs.wl-clipboard}/bin/wl-copy
'';
${pkgs.bitwarden-cli}/bin/bw get totp $ID | ${pkgs.wl-clipboard}/bin/wl-copy
'';
emojiRofi = pkgs.writeScript "rofi-emoji" ''
line=$(${pkgs.coreutils}/bin/cat ${toString ../data/emojis.txt} | ${pkgs.rofi}/bin/rofi -dmenu -i)
${pkgs.coreutils}/bin/echo ''${line::1} | ${pkgs.wl-clipboard}/bin/wl-copy
'';
emojiRofi = pkgs.writeScript "rofi-emoji" ''
line=$(${pkgs.coreutils}/bin/cat ${toString ../data/emojis.txt} | ${pkgs.rofi}/bin/rofi -dmenu -i)
${pkgs.coreutils}/bin/echo ''${line::1} | ${pkgs.wl-clipboard}/bin/wl-copy
'';
modifier = config.wayland.windowManager.sway.config.modifier;
modifier = config.wayland.windowManager.sway.config.modifier;
alphabet = [ "Ctrl" "Alt" "Ctrl+Alt" ];
genKeyAttrs = move: lib.listToAttrs (
alphabet = ["Ctrl" "Alt" "Ctrl+Alt"];
genKeyAttrs = move:
lib.listToAttrs (
map
(
n: {
name = "${modifier}${if move then "+Shift" else ""}+${builtins.elemAt alphabet ((n - 11) / 10)}+${toString (lib.mod n 10)}";
value = "${if move then "move container to " else ""}workspace ${toString n}";
}
)
(lib.lists.range 11 (10 * (builtins.length alphabet) + 10))
(
n: {
name = "${modifier}${
if move
then "+Shift"
else ""
}+${builtins.elemAt alphabet ((n - 11) / 10)}+${toString (lib.mod n 10)}";
value = "${
if move
then "move container to "
else ""
}workspace ${toString n}";
}
)
(lib.lists.range 11 (10 * (builtins.length alphabet) + 10))
);
in
in
lib.mkOptionDefault (
genKeyAttrs true // genKeyAttrs false // (
genKeyAttrs true
// genKeyAttrs false
// (
let
volumeUp = "exec ${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ +5%";
volumeDown = "exec ${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ -5%";
in
{
in {
"Print" = "exec ${scrsaveclip}";
"Shift+Print" = if cfg.uploadScript != null then "exec ${scrsaveup}" else "nop";
"Shift+Print" =
if cfg.uploadScript != null
then "exec ${scrsaveup}"
else "nop";
"Ctrl+Print" = "exec ${scrvidsaveclip}";
"Ctrl+Alt+Print" = "exec ${scrvidstop}";
@ -261,10 +278,8 @@ in
"XF86AudioRaiseVolume" = volumeUp;
"XF86AudioLowerVolume" = volumeDown;
"XF86AudioMute" =
"exec ${pkgs.pulseaudio}/bin/pactl set-sink-mute @DEFAULT_SINK@ toggle";
"XF86AudioMicMute" =
"exec ${pkgs.pulseaudio}/bin/pactl set-source-mute @DEFAULT_SOURCE@ toggle";
"XF86AudioMute" = "exec ${pkgs.pulseaudio}/bin/pactl set-sink-mute @DEFAULT_SINK@ toggle";
"XF86AudioMicMute" = "exec ${pkgs.pulseaudio}/bin/pactl set-source-mute @DEFAULT_SOURCE@ toggle";
"XF86MonBrightnessDown" = "exec ${pkgs.light}/bin/light -U 10";
"XF86MonBrightnessUp" = "exec ${pkgs.light}/bin/light -A 10";
@ -272,12 +287,9 @@ in
"${modifier}+apostrophe" = "exec ${pkgs.light}/bin/light -A 10";
# Previous/next but change the shuffle/random state before action (and change back afterwards)
"${modifier}+Shift+bracketright" =
"exec ${pkgs.playerctl}/bin/playerctl shuffle Toggle && ${pkgs.playerctl}/bin/playerctl next && ${pkgs.playerctl}/bin/playerctl shuffle Toggle";
"${modifier}+Shift+bracketleft" =
"exec ${pkgs.playerctl}/bin/playerctl shuffle Toggle && ${pkgs.playerctl}/bin/playerctl previous && ${pkgs.playerctl}/bin/playerctl shuffle Toggle";
"Shift+XF86AudioNext" =
"exec ${pkgs.playerctl}/bin/playerctl shuffle Toggle && ${pkgs.playerctl}/bin/playerctl next && ${pkgs.playerctl}/bin/playerctl shuffle Toggle";
"${modifier}+Shift+bracketright" = "exec ${pkgs.playerctl}/bin/playerctl shuffle Toggle && ${pkgs.playerctl}/bin/playerctl next && ${pkgs.playerctl}/bin/playerctl shuffle Toggle";
"${modifier}+Shift+bracketleft" = "exec ${pkgs.playerctl}/bin/playerctl shuffle Toggle && ${pkgs.playerctl}/bin/playerctl previous && ${pkgs.playerctl}/bin/playerctl shuffle Toggle";
"Shift+XF86AudioNext" = "exec ${pkgs.playerctl}/bin/playerctl shuffle Toggle && ${pkgs.playerctl}/bin/playerctl next && ${pkgs.playerctl}/bin/playerctl shuffle Toggle";
# Previous/next
"${modifier}+bracketright" = "exec ${pkgs.playerctl}/bin/playerctl next";
@ -296,66 +308,58 @@ in
"XF86AudioPause" = "exec ${pkgs.playerctl}/bin/playerctl play-pause";
"${modifier}+backslash" = "exec ${pkgs.playerctl}/bin/playerctl play-pause";
"${modifier}+Ctrl+Shift+m" =
let
ripMusicAdvanced = pkgs.writeShellScript "rip-music-advanced.sh" ''
CURRENT=$(${pkgs.mpc_cli}/bin/mpc -f '%file%' current)
URLIFIED=$(${pkgs.gnused}/bin/sed 's/youtube:video:/https:\/\/youtube.com\/watch?v=/'<<<$CURRENT)
PARAMS=$(${pkgs.rofi}/bin/rofi -dmenu)
echo y | ${inputs.mudl.defaultPackage.${pkgs.system}}/bin/mudl "$URLIFIED" "$PARAMS"
'';
in
"exec ${ripMusicAdvanced}";
"${modifier}+Ctrl+m" =
let
ripMusic = pkgs.writeShellScript "rip-music.sh" ''
CURRENT=$(${pkgs.mpc_cli}/bin/mpc -f '%file%' current)
URLIFIED=$(${pkgs.gnused}/bin/sed 's/youtube:video:/https:\/\/youtube.com\/watch?v=/'<<<$CURRENT)
"${modifier}+Ctrl+Shift+m" = let
ripMusicAdvanced = pkgs.writeShellScript "rip-music-advanced.sh" ''
CURRENT=$(${pkgs.mpc_cli}/bin/mpc -f '%file%' current)
URLIFIED=$(${pkgs.gnused}/bin/sed 's/youtube:video:/https:\/\/youtube.com\/watch?v=/'<<<$CURRENT)
PARAMS=$(${pkgs.rofi}/bin/rofi -dmenu)
echo y | ${inputs.mudl.defaultPackage.${pkgs.system}}/bin/mudl "$URLIFIED" "$PARAMS"
'';
in "exec ${ripMusicAdvanced}";
"${modifier}+Ctrl+m" = let
ripMusic = pkgs.writeShellScript "rip-music.sh" ''
CURRENT=$(${pkgs.mpc_cli}/bin/mpc -f '%file%' current)
URLIFIED=$(${pkgs.gnused}/bin/sed 's/youtube:video:/https:\/\/youtube.com\/watch?v=/'<<<$CURRENT)
DL_OUT=$(echo y | ${inputs.mudl.defaultPackage.${pkgs.system}}/bin/mudl "$URLIFIED")
DL_OUT=$(echo y | ${inputs.mudl.defaultPackage.${pkgs.system}}/bin/mudl "$URLIFIED")
if echo "$DL_OUT" | ${pkgs.gnugrep}/bin/grep -qE 'Album: $'; then
${pkgs.libnotify}/bin/notify-send mudl 'Album name required'
ALBUM=$(${pkgs.rofi}/bin/rofi -dmenu)
echo y | ${inputs.mudl.defaultPackage.${pkgs.system}}/bin/mudl "$URLIFIED" "$ALBUM"
fi
'';
in
"exec ${ripMusic}";
if echo "$DL_OUT" | ${pkgs.gnugrep}/bin/grep -qE 'Album: $'; then
${pkgs.libnotify}/bin/notify-send mudl 'Album name required'
ALBUM=$(${pkgs.rofi}/bin/rofi -dmenu)
echo y | ${inputs.mudl.defaultPackage.${pkgs.system}}/bin/mudl "$URLIFIED" "$ALBUM"
fi
'';
in "exec ${ripMusic}";
"${modifier}+m" =
let
musicRofi = pkgs.writeShellScript "music-rofi" ''
SONGN=$(${pkgs.mpc_cli}/bin/mpc -f "%position% - %artist% - %album% - %title%" playlist | ${pkgs.rofi}/bin/rofi -dmenu -i | ${pkgs.coreutils}/bin/cut -d " " -f 1)
[ ! -z "$SONGN" ] && ${pkgs.mpc_cli}/bin/mpc play "$SONGN"
'';
in
"exec ${musicRofi}";
"${modifier}+m" = let
musicRofi = pkgs.writeShellScript "music-rofi" ''
SONGN=$(${pkgs.mpc_cli}/bin/mpc -f "%position% - %artist% - %album% - %title%" playlist | ${pkgs.rofi}/bin/rofi -dmenu -i | ${pkgs.coreutils}/bin/cut -d " " -f 1)
[ ! -z "$SONGN" ] && ${pkgs.mpc_cli}/bin/mpc play "$SONGN"
'';
in "exec ${musicRofi}";
"${modifier}+k" = "exec ${pkgs.mpc_cli}/bin/mpc clear";
"${config.wayland.windowManager.sway.config.modifier}+Shift+k" = lib.mkForce "exec ${pkgs.mpc_cli}/bin/mpc ls \"Local media/Tracks\" | ${pkgs.mpc_cli}/bin/mpc add";
"${config.wayland.windowManager.sway.config.modifier}+Shift+m" =
let
mopidySearch = pkgs.writeShellScript "mopidy-search.sh" ''
QUERY=$(${pkgs.rofi}/bin/rofi -dmenu)
[ -z "$QUERY" ] && exit
RESULTS=$(${pkgs.mpc_cli}/bin/mpc search -f '%file% / %artist% - %title%' any "$QUERY")
USERLIST=$(echo "$RESULTS" | ${pkgs.gawk}/bin/awk -F' / ' '{print $2}')
"${config.wayland.windowManager.sway.config.modifier}+Shift+m" = let
mopidySearch = pkgs.writeShellScript "mopidy-search.sh" ''
QUERY=$(${pkgs.rofi}/bin/rofi -dmenu)
[ -z "$QUERY" ] && exit
RESULTS=$(${pkgs.mpc_cli}/bin/mpc search -f '%file% / %artist% - %title%' any "$QUERY")
USERLIST=$(echo "$RESULTS" | ${pkgs.gawk}/bin/awk -F' / ' '{print $2}')
CHOSEN=$(echo "$USERLIST" | ${pkgs.rofi}/bin/rofi -dmenu -i)
[ -z "$CHOSEN" ] && exit
NTH=$(echo "$USERLIST" | ${pkgs.gnugrep}/bin/grep -n "^$CHOSEN$" | cut -d':' -f1)
CHOSEN=$(echo "$USERLIST" | ${pkgs.rofi}/bin/rofi -dmenu -i)
[ -z "$CHOSEN" ] && exit
NTH=$(echo "$USERLIST" | ${pkgs.gnugrep}/bin/grep -n "^$CHOSEN$" | cut -d':' -f1)
LINE=$(echo "$RESULTS" | ${pkgs.coreutils}/bin/tail "-n+$NTH" | ${pkgs.coreutils}/bin/head -1)
NAME=$(echo "$LINE" | ${pkgs.gawk}/bin/awk -F' / ' '{print $1}')
LINE=$(echo "$RESULTS" | ${pkgs.coreutils}/bin/tail "-n+$NTH" | ${pkgs.coreutils}/bin/head -1)
NAME=$(echo "$LINE" | ${pkgs.gawk}/bin/awk -F' / ' '{print $1}')
${pkgs.mpc_cli}/bin/mpc add "$NAME"
PLAYLIST=$(${pkgs.mpc_cli}/bin/mpc -f "%position% / %file%" playlist)
PLAYLIST_ENTRY=$(echo "$PLAYLIST" | ${pkgs.gnugrep}/bin/grep -E "^.* / $NAME$" | head -1)
PLAYLIST_ENTRY_POSITION=$(echo "$PLAYLIST_ENTRY" | ${pkgs.gawk}/bin/awk -F' / ' '{print $1}')
${pkgs.mpc_cli}/bin/mpc play "$PLAYLIST_ENTRY_POSITION"
'';
in
"exec ${mopidySearch}";
${pkgs.mpc_cli}/bin/mpc add "$NAME"
PLAYLIST=$(${pkgs.mpc_cli}/bin/mpc -f "%position% / %file%" playlist)
PLAYLIST_ENTRY=$(echo "$PLAYLIST" | ${pkgs.gnugrep}/bin/grep -E "^.* / $NAME$" | head -1)
PLAYLIST_ENTRY_POSITION=$(echo "$PLAYLIST_ENTRY" | ${pkgs.gawk}/bin/awk -F' / ' '{print $1}')
${pkgs.mpc_cli}/bin/mpc play "$PLAYLIST_ENTRY_POSITION"
'';
in "exec ${mopidySearch}";
"${modifier}+p" = "exec ${bwRofi}";
"${modifier}+t" = "exec ${bwRofiOtp}";
@ -372,7 +376,7 @@ in
menu = "${pkgs.rofi}/bin/rofi -show drun -show-icons -run-command '${pkgs.sway}/bin/swaymsg exec -- {cmd}'";
bars = [ ];
bars = [];
gaps = {
smartGaps = lib.mkDefault true;
@ -398,107 +402,107 @@ in
settings = [
({
position = "left";
height = null;
position = "left";
height = null;
modules-left = [ "sway/workspaces" "custom/spacer" "custom/weather-temp" "custom/weather-precip" "custom/weather-wind" ];
modules-center = [ "clock#1" "clock#2" "custom/spacer" "custom/media" "custom/spacer" "clock#3" "custom/spacer" "clock#4" ];
modules-right = [ "pulseaudio" "custom/spacer" "memory" "custom/spacer" "cpu" ] ++ lib.optionals cfg.battery [ "custom/spacer" "battery" ] ++ [ "custom/spacer" "tray" ];
modules-left = ["sway/workspaces" "custom/spacer" "custom/weather-temp" "custom/weather-precip" "custom/weather-wind"];
modules-center = ["clock#1" "clock#2" "custom/spacer" "custom/media" "custom/spacer" "clock#3" "custom/spacer" "clock#4"];
modules-right = ["pulseaudio" "custom/spacer" "memory" "custom/spacer" "cpu"] ++ lib.optionals cfg.battery ["custom/spacer" "battery"] ++ ["custom/spacer" "tray"];
modules = {
"custom/spacer" = {
format = "";
rotate = 90;
tooltip = false;
};
"custom/weather-temp" = {
exec = "${pkgs.curl}/bin/curl 'wttr.in/${cfg.location}?format=%c+%t' || echo ERR";
on-click = "${pkgs.xdg-utils}/bin/xdg-open 'https://weather.com/weather/today/l/85625'";
on-click-right = "${pkgs.xdg-utils}/bin/xdg-open 'https://wttr.in/${cfg.location}'";
interval = 900;
};
"custom/weather-precip" = {
exec = "${pkgs.curl}/bin/curl 'wttr.in/${cfg.location}?format=🌧+%p'";
on-click = "${pkgs.xdg-utils}/bin/xdg-open 'https://www.lightningmaps.org/'";
on-click-right = "${pkgs.xdg-utils}/bin/xdg-open 'https://wttr.in/${cfg.location}'";
interval = 900;
};
"custom/weather-wind" = {
exec = "${pkgs.curl}/bin/curl 'wttr.in/${cfg.location}?format=🌬+%w'";
on-click = "${pkgs.xdg-utils}/bin/xdg-open 'https://www.ventusky.com/";
on-click-right = "${pkgs.xdg-utils}/bin/xdg-open 'https://wttr.in/${cfg.location}'";
interval = 900;
};
"custom/media" = {
rotate = 90;
max-length = 60;
on-click = "${pkgs.playerctl}/bin/playerctl play-pause";
exec = "${pkgs.playerctl}/bin/playerctl metadata --format '{{ emoji(status) }} {{ artist }} - {{ title }}' --follow";
};
"sway/workspaces" = {
disable-scroll = true;
};
"clock#1" = {
tooltip = false;
format = "{:%a}";
};
"clock#2" = {
tooltip = false;
format = "{:%m-%d}";
};
"clock#3" = {
tooltip = false;
format = "{:%I:%M %p}";
};
"clock#4" = {
tooltip = false;
timezone = "Etc/UTC";
format = "{:%H:%M} UTC";
};
pulseaudio = {
format = "{icon} {volume}%";
format-bluetooth = "{icon} {volume}%";
format-muted = "MUTE";
format-icons = {
headphone = "";
default = "";
modules = {
"custom/spacer" = {
format = "";
rotate = 90;
tooltip = false;
};
on-click = "${pkgs.pulseaudio}/bin/pactl set-source-mute @DEFAULT_SOURCE@ toggle";
on-click-right = "${pkgs.pavucontrol}/bin/pavucontrol";
};
memory = {
interval = 20;
format = " {}%";
};
cpu = {
interval = 20;
format = " {usage}%";
};
battery = {
states = {
good = 90;
warning = 25;
critical = 10;
"custom/weather-temp" = {
exec = "${pkgs.curl}/bin/curl 'wttr.in/${cfg.location}?format=%c+%t' || echo ERR";
on-click = "${pkgs.xdg-utils}/bin/xdg-open 'https://weather.com/weather/today/l/85625'";
on-click-right = "${pkgs.xdg-utils}/bin/xdg-open 'https://wttr.in/${cfg.location}'";
interval = 900;
};
"custom/weather-precip" = {
exec = "${pkgs.curl}/bin/curl 'wttr.in/${cfg.location}?format=🌧+%p'";
on-click = "${pkgs.xdg-utils}/bin/xdg-open 'https://www.lightningmaps.org/'";
on-click-right = "${pkgs.xdg-utils}/bin/xdg-open 'https://wttr.in/${cfg.location}'";
interval = 900;
};
"custom/weather-wind" = {
exec = "${pkgs.curl}/bin/curl 'wttr.in/${cfg.location}?format=🌬+%w'";
on-click = "${pkgs.xdg-utils}/bin/xdg-open 'https://www.ventusky.com/";
on-click-right = "${pkgs.xdg-utils}/bin/xdg-open 'https://wttr.in/${cfg.location}'";
interval = 900;
};
format = "{icon} {capacity}%";
format-icons = [ "" "" "" "" "" ];
};
tray = {
icon-size = 18;
spacing = 5;
};
};
"custom/media" = {
rotate = 90;
max-length = 60;
on-click = "${pkgs.playerctl}/bin/playerctl play-pause";
exec = "${pkgs.playerctl}/bin/playerctl metadata --format '{{ emoji(status) }} {{ artist }} - {{ title }}' --follow";
};
} // cfg.waybarConfig)
"sway/workspaces" = {
disable-scroll = true;
};
"clock#1" = {
tooltip = false;
format = "{:%a}";
};
"clock#2" = {
tooltip = false;
format = "{:%m-%d}";
};
"clock#3" = {
tooltip = false;
format = "{:%I:%M %p}";
};
"clock#4" = {
tooltip = false;
timezone = "Etc/UTC";
format = "{:%H:%M} UTC";
};
pulseaudio = {
format = "{icon} {volume}%";
format-bluetooth = "{icon} {volume}%";
format-muted = "MUTE";
format-icons = {
headphone = "";
default = "";
};
on-click = "${pkgs.pulseaudio}/bin/pactl set-source-mute @DEFAULT_SOURCE@ toggle";
on-click-right = "${pkgs.pavucontrol}/bin/pavucontrol";
};
memory = {
interval = 20;
format = " {}%";
};
cpu = {
interval = 20;
format = " {usage}%";
};
battery = {
states = {
good = 90;
warning = 25;
critical = 10;
};
format = "{icon} {capacity}%";
format-icons = ["" "" "" "" ""];
};
tray = {
icon-size = 18;
spacing = 5;
};
};
}
// cfg.waybarConfig)
];
style = ''
@ -581,7 +585,7 @@ in
programs.mako = {
enable = lib.mkDefault true;
maxVisible = lib.mkDefault 6;
extraConfig = lib.generators.toKeyValue { } {
extraConfig = lib.generators.toKeyValue {} {
on-button-middle = "dismiss-all";
};
};
@ -591,8 +595,8 @@ in
ExecStart = "${pkgs.mako}/bin/mako";
};
Install = {
After = [ "sway-session.target" ];
WantedBy = [ "sway-session.target" ];
After = ["sway-session.target"];
WantedBy = ["sway-session.target"];
};
};
@ -663,17 +667,15 @@ in
};
};
xdg.configFile."neofetch/config.conf".text =
let
image = builtins.path {
name = "nixos_circlejerk.png";
path = ../data/nixos_circlejerk.png;
};
in
''
image_source="${image}"
image_backend="kitty"
'';
xdg.configFile."neofetch/config.conf".text = let
image = builtins.path {
name = "nixos_circlejerk.png";
path = ../data/nixos_circlejerk.png;
};
in ''
image_source="${image}"
image_backend="kitty"
'';
xdg.enable = true;
xdg.userDirs.enable = true;