2024-08-03 20:22:47 +02:00
|
|
|
|
{
|
2024-09-09 05:54:29 +02:00
|
|
|
|
nixosConfig,
|
2024-08-03 20:22:47 +02:00
|
|
|
|
config,
|
|
|
|
|
lib,
|
|
|
|
|
pkgs,
|
|
|
|
|
...
|
|
|
|
|
}:
|
2023-07-05 06:36:38 +02:00
|
|
|
|
|
2024-04-03 00:01:13 +02:00
|
|
|
|
let
|
2024-09-09 05:54:29 +02:00
|
|
|
|
inherit (nixosConfig._module.specialArgs) nix-config;
|
|
|
|
|
|
2024-04-03 00:01:13 +02:00
|
|
|
|
inherit (lib) singleton;
|
2024-04-09 15:19:29 +02:00
|
|
|
|
inherit (builtins) toJSON;
|
2024-09-06 16:49:22 +02:00
|
|
|
|
inherit (nix-config.packages.${pkgs.system}) dunst-scripts;
|
2024-04-08 12:28:25 +02:00
|
|
|
|
|
2024-08-03 20:22:47 +02:00
|
|
|
|
inherit (config.lib.stylix.colors.withHashtag)
|
|
|
|
|
base00
|
|
|
|
|
base01
|
|
|
|
|
base04
|
|
|
|
|
base05
|
|
|
|
|
base0D
|
|
|
|
|
;
|
|
|
|
|
|
2024-04-08 12:28:25 +02:00
|
|
|
|
mullvadScript = "ironbar/mullvad.fish";
|
2024-07-22 19:38:23 +02:00
|
|
|
|
volumeScript = "ironbar/volume.fish";
|
|
|
|
|
volumeGet = "ironbar/volume-get.fish";
|
2024-04-03 00:01:13 +02:00
|
|
|
|
in
|
2023-07-04 13:25:08 +02:00
|
|
|
|
{
|
2024-08-07 22:32:53 +02:00
|
|
|
|
home.packages = with pkgs; [ ironbar ];
|
2024-04-04 14:11:11 +02:00
|
|
|
|
|
2024-08-03 07:51:58 +02:00
|
|
|
|
xdg.configFile = {
|
|
|
|
|
"ironbar/config.json".text = toJSON {
|
|
|
|
|
name = "main";
|
|
|
|
|
icon_theme = "Fluent-dark";
|
|
|
|
|
position = "bottom";
|
|
|
|
|
anchor_to_edges = true;
|
|
|
|
|
|
|
|
|
|
start = [
|
|
|
|
|
{
|
|
|
|
|
name = "startMenu";
|
|
|
|
|
type = "label";
|
|
|
|
|
label = "❄";
|
2024-09-08 19:51:16 +02:00
|
|
|
|
on_mouse_enter = "rofi -show";
|
2024-08-03 07:51:58 +02:00
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
type = "script";
|
|
|
|
|
on_click_left = "mullvad relay set location any && mullvad relay set location us";
|
|
|
|
|
cmd = "~/.config/${mullvadScript}";
|
|
|
|
|
mode = "watch";
|
|
|
|
|
}
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
center = singleton {
|
|
|
|
|
type = "launcher";
|
|
|
|
|
icon_size = 39;
|
|
|
|
|
favorites = [
|
|
|
|
|
"librewolf"
|
|
|
|
|
"kitty"
|
|
|
|
|
"thunar"
|
2024-10-15 20:40:17 +02:00
|
|
|
|
"Chromium-browser"
|
2024-08-03 07:51:58 +02:00
|
|
|
|
"anki"
|
|
|
|
|
];
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
end = [
|
|
|
|
|
{
|
|
|
|
|
type = "script";
|
|
|
|
|
cmd = "~/.config/${volumeScript}";
|
2024-09-06 16:49:22 +02:00
|
|
|
|
on_click_left = "${dunst-scripts}/bin/mv-up";
|
|
|
|
|
on_click_right = "${dunst-scripts}/bin/mv-down";
|
2024-08-03 07:51:58 +02:00
|
|
|
|
mode = "watch";
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
type = "upower";
|
|
|
|
|
show_if = "upower -e | grep BAT";
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
type = "clock";
|
|
|
|
|
format = "%x(%a)%R";
|
|
|
|
|
}
|
2024-04-03 00:01:13 +02:00
|
|
|
|
];
|
|
|
|
|
};
|
2023-07-04 13:25:08 +02:00
|
|
|
|
|
2024-08-03 20:22:47 +02:00
|
|
|
|
"ironbar/style.css".text = # css
|
|
|
|
|
''
|
|
|
|
|
* {
|
|
|
|
|
font-family: "Noto Sans CJK JP", "Font Awesome 6 Free Solid";
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
text-shadow: 2px 2px ${base00};
|
|
|
|
|
border: none;
|
|
|
|
|
border-radius: 0;
|
|
|
|
|
outline: none;
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
background: none;
|
|
|
|
|
color: ${base05};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.background {
|
|
|
|
|
background: alpha(${base00}, 0.925);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
button:hover {
|
2024-10-27 15:53:17 +01:00
|
|
|
|
background: alpha(${base01}, 0.8);
|
2024-08-03 20:22:47 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#bar {
|
2024-10-27 15:51:38 +01:00
|
|
|
|
border-top: 1px solid alpha(${base01}, 0.925);
|
2024-08-03 20:22:47 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.label, .script, .tray {
|
|
|
|
|
padding-left: 0.5em;
|
|
|
|
|
padding-right: 0.5em;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.upower {
|
|
|
|
|
padding-left: 0.2em;
|
|
|
|
|
padding-right: 0.2em;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.upower .label {
|
|
|
|
|
padding-left: 0;
|
|
|
|
|
padding-right: 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.popup {
|
|
|
|
|
border: 1px solid ${base01};
|
|
|
|
|
padding: 1em;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.popup-clock .calendar-clock {
|
|
|
|
|
font-family: "Maple Mono";
|
|
|
|
|
font-size: 2.5em;
|
|
|
|
|
padding-bottom: 0.1em;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.popup-clock .calendar .header {
|
|
|
|
|
padding-top: 1em;
|
|
|
|
|
border-top: 1px solid ${base01};
|
|
|
|
|
font-size: 1.5em;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.popup-clock .calendar {
|
|
|
|
|
padding: 0.2em 0.4em;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.popup-clock .calendar:selected {
|
|
|
|
|
color: ${base0D};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.launcher .item {
|
|
|
|
|
padding-left: 1em;
|
|
|
|
|
padding-right: 1em;
|
|
|
|
|
margin-right: 4px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
button:active {
|
2024-10-27 15:53:17 +01:00
|
|
|
|
background: alpha(${base04}, 0.8);
|
2024-08-03 20:22:47 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.launcher .open {
|
2024-10-27 15:53:40 +01:00
|
|
|
|
box-shadow: inset 0 -2px alpha(${base04}, 0.8);
|
2024-08-03 20:22:47 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.launcher .focused {
|
2024-10-27 15:53:40 +01:00
|
|
|
|
box-shadow: inset 0 -2px alpha(${base0D}, 0.8);
|
|
|
|
|
background: alpha(${base01}, 0.8);
|
2024-08-03 20:22:47 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.popup-launcher {
|
|
|
|
|
padding: 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.popup-launcher .popup-item:not(:first-child) {
|
|
|
|
|
border-top: 1px solid ${base01};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#startMenu {
|
|
|
|
|
padding-left: 1em;
|
|
|
|
|
padding-right: 0.5em;
|
|
|
|
|
}
|
|
|
|
|
'';
|
2024-08-03 07:51:58 +02:00
|
|
|
|
|
|
|
|
|
${mullvadScript} = {
|
|
|
|
|
executable = true;
|
2024-08-03 20:22:47 +02:00
|
|
|
|
text = # fish
|
|
|
|
|
''
|
|
|
|
|
#!/usr/bin/env fish
|
|
|
|
|
|
|
|
|
|
sleep 2
|
|
|
|
|
|
|
|
|
|
function get_mullvad_status
|
|
|
|
|
if test -z "$inside"
|
|
|
|
|
set inside true
|
|
|
|
|
test -n "$initialized" && sleep 0.2
|
|
|
|
|
|
|
|
|
|
set MULLVAD (mullvad status | head -1)
|
|
|
|
|
|
|
|
|
|
set LOCATION (echo "$MULLVAD" | choose 4.. | sed \
|
|
|
|
|
-e 's/Ashburn.*/アッシュバーン/g' \
|
|
|
|
|
-e 's/Atlanta.*/アトランタ/g' \
|
|
|
|
|
-e 's/Boston.*/ボストン/g' \
|
|
|
|
|
-e 's/Charlotte.*/シャーロット/g' \
|
|
|
|
|
-e 's/Chicago.*/シカゴ/g' \
|
|
|
|
|
-e 's/Cleveland.*/クリーブランド/g' \
|
|
|
|
|
-e 's/Dallas.*/ダラス/g' \
|
|
|
|
|
-e 's/Detroit.*/デトロイト/g' \
|
|
|
|
|
-e 's/Denver.*/デンバー/g' \
|
|
|
|
|
-e 's/Honolulu.*/ホノルル/g' \
|
|
|
|
|
-e 's/Houston.*/ヒューストン/g' \
|
|
|
|
|
-e 's/Jackson.*/ジャクソン/g' \
|
|
|
|
|
-e 's/Los Angeles.*/ロサンゼルス/g' \
|
|
|
|
|
-e 's/Louisville.*/ルイビル/g' \
|
|
|
|
|
-e 's/McAllen.*/マッカレン/g' \
|
|
|
|
|
-e 's/Miami.*/マイアミ/g' \
|
|
|
|
|
-e 's/Milwaukee.*/ミルウォーキー/g' \
|
|
|
|
|
-e 's/Minneapolis.*/ミネアポリス/g' \
|
|
|
|
|
-e 's/New York.*/ニューヨーク/g' \
|
|
|
|
|
-e 's/Oklahoma.*/オクラホマシティ/g' \
|
|
|
|
|
-e 's/Philadelphia.*/フィラデルフィア/g' \
|
|
|
|
|
-e 's/Phoenix.*/フィニックス/g' \
|
|
|
|
|
-e 's/Piscataway.*/ピスカタウェイ/g' \
|
|
|
|
|
-e 's/Portland.*/ポートランド/g' \
|
|
|
|
|
-e 's/Raleigh.*/ローリー/g' \
|
|
|
|
|
-e 's/Richmond.*/リッチモンド/g' \
|
|
|
|
|
-e 's/Salt Lake.*/ソルトレイクシティ/g' \
|
|
|
|
|
-e 's/San Francisco.*/サンフランシスコ/g' \
|
|
|
|
|
-e 's/San Jose.*/サンノゼ/g' \
|
|
|
|
|
-e 's/Seattle.*/シアトル/g' \
|
|
|
|
|
-e 's/Secaucus.*/セコーカス/g' \
|
|
|
|
|
-e 's/Sioux Falls.*/スーフォールズ/g' \
|
|
|
|
|
-e 's/St. Louis.*/セントルイス/g' \
|
|
|
|
|
-e 's/Stamford.*/スタンフォード/g' \
|
|
|
|
|
-e 's/Washington.*/ワシントン/g'
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
echo "$LOCATION"
|
|
|
|
|
|
|
|
|
|
set -e inside
|
|
|
|
|
end
|
2024-08-03 07:51:58 +02:00
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
get_mullvad_status
|
2024-08-03 20:22:47 +02:00
|
|
|
|
set initialized true
|
|
|
|
|
|
2024-08-07 22:32:53 +02:00
|
|
|
|
${pkgs.inotify-tools}/bin/inotifywait -q -e close_write,moved_to,create -m /etc/mullvad-vpn |
|
2024-08-03 20:22:47 +02:00
|
|
|
|
while read directory events filename
|
|
|
|
|
get_mullvad_status
|
|
|
|
|
end
|
|
|
|
|
'';
|
2024-08-03 07:51:58 +02:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
${volumeScript} = {
|
|
|
|
|
executable = true;
|
2024-08-03 20:22:47 +02:00
|
|
|
|
text = # fish
|
|
|
|
|
''
|
|
|
|
|
#!/usr/bin/env fish
|
2024-08-03 07:51:58 +02:00
|
|
|
|
|
2024-08-04 01:50:28 +02:00
|
|
|
|
sleep 2
|
|
|
|
|
|
2024-08-03 20:22:47 +02:00
|
|
|
|
~/.config/${volumeGet}
|
2024-08-03 07:51:58 +02:00
|
|
|
|
|
2024-08-03 20:22:47 +02:00
|
|
|
|
pactl subscribe | grep --line-buffered -e "シンク" | xargs -L 1 ~/.config/${volumeGet}
|
|
|
|
|
'';
|
2024-08-03 07:51:58 +02:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
${volumeGet} = {
|
|
|
|
|
executable = true;
|
2024-08-03 20:22:47 +02:00
|
|
|
|
text = # fish
|
|
|
|
|
''
|
|
|
|
|
#!/usr/bin/env fish
|
2024-08-03 07:51:58 +02:00
|
|
|
|
|
2024-09-06 02:01:43 +02:00
|
|
|
|
set VOL $(wpctl get-volume @DEFAULT_AUDIO_SINK@)
|
|
|
|
|
set MUTE $(echo "$VOL" | awk '{print $3}' | sed -e 's/\[MUTED\]/(ミュート)/' | tr --delete '\n')
|
|
|
|
|
|
|
|
|
|
echo -n "$MUTE"
|
|
|
|
|
echo "音量:$(math "$(echo "$VOL" | choose 1) * 100")%"
|
2024-08-03 20:22:47 +02:00
|
|
|
|
'';
|
2024-08-03 07:51:58 +02:00
|
|
|
|
};
|
2024-07-22 19:38:23 +02:00
|
|
|
|
};
|
2023-07-04 13:25:08 +02:00
|
|
|
|
}
|