2024-04-04 14:11:11 +02:00
|
|
|
|
{ config, lib, pkgs, ... }:
|
2023-07-05 06:36:38 +02:00
|
|
|
|
|
2024-04-03 00:01:13 +02:00
|
|
|
|
let
|
|
|
|
|
inherit (lib) singleton;
|
2024-04-05 19:28:23 +02:00
|
|
|
|
inherit (config.lib.stylix.colors) base00 base01 base04 base05 base09;
|
2024-04-08 12:28:25 +02:00
|
|
|
|
inherit (pkgs) ironbar inotify-tools;
|
2024-04-09 15:19:29 +02:00
|
|
|
|
inherit (builtins) toJSON;
|
2024-04-08 12:28:25 +02:00
|
|
|
|
|
|
|
|
|
mullvadScript = "ironbar/mullvad.fish";
|
2024-04-08 13:05:08 +02:00
|
|
|
|
mullvadNotification = "ironbar/mullvad-notification.fish";
|
2024-04-08 14:12:40 +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-04-05 19:28:23 +02:00
|
|
|
|
home.packages = [ ironbar ];
|
2024-04-04 14:11:11 +02:00
|
|
|
|
|
2024-04-04 23:55:46 +02:00
|
|
|
|
xdg.configFile."ironbar/config.json".text = toJSON {
|
2024-04-02 20:46:28 +02:00
|
|
|
|
name = "main";
|
|
|
|
|
icon_theme = "Fluent-dark";
|
|
|
|
|
position = "bottom";
|
|
|
|
|
anchor_to_edges = true;
|
2023-07-04 13:25:08 +02:00
|
|
|
|
|
2024-04-02 20:46:28 +02:00
|
|
|
|
start = [
|
|
|
|
|
{
|
|
|
|
|
name = "startMenu";
|
|
|
|
|
type = "label";
|
|
|
|
|
label = "❄";
|
|
|
|
|
on_mouse_enter = "rofi -show drun";
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
type = "script";
|
2024-04-08 13:05:08 +02:00
|
|
|
|
on_click_left = "~/.config/${mullvadNotification}";
|
2024-04-08 12:28:25 +02:00
|
|
|
|
cmd = "~/.config/${mullvadScript}";
|
|
|
|
|
mode = "watch";
|
2024-04-02 20:46:28 +02:00
|
|
|
|
}
|
|
|
|
|
];
|
2023-07-04 19:31:19 +02:00
|
|
|
|
|
2024-04-03 00:01:13 +02:00
|
|
|
|
center = singleton {
|
|
|
|
|
type = "launcher";
|
|
|
|
|
icon_size = 39;
|
|
|
|
|
favorites = [
|
|
|
|
|
"librewolf"
|
|
|
|
|
"kitty"
|
|
|
|
|
"thunar"
|
|
|
|
|
"org.qutebrowser.qutebrowser"
|
|
|
|
|
"anki"
|
|
|
|
|
];
|
|
|
|
|
};
|
2023-07-04 13:25:08 +02:00
|
|
|
|
|
2024-04-02 20:46:28 +02:00
|
|
|
|
end = [
|
|
|
|
|
{
|
|
|
|
|
type = "tray";
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
type = "script";
|
2024-04-08 14:12:40 +02:00
|
|
|
|
cmd = "~/.config/${volumeScript}";
|
2024-04-08 14:30:46 +02:00
|
|
|
|
on_click_left = "~/.config/hypr/raise-volume.fish";
|
|
|
|
|
on_click_right = "~/.config/hypr/lower-volume.fish";
|
2024-04-08 14:12:40 +02:00
|
|
|
|
mode = "watch";
|
2024-04-02 20:46:28 +02:00
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
type = "clock";
|
|
|
|
|
format = "%x(%a)%R";
|
|
|
|
|
}
|
|
|
|
|
];
|
|
|
|
|
};
|
2023-07-04 13:25:08 +02:00
|
|
|
|
|
2024-04-05 19:28:23 +02:00
|
|
|
|
xdg.configFile."ironbar/style.css".text = /* css */ ''
|
2023-07-04 13:25:08 +02:00
|
|
|
|
* {
|
|
|
|
|
font-family: "Noto Sans CJK JP", "Font Awesome 6 Free Solid";
|
|
|
|
|
font-size: 16px;
|
2023-07-16 01:00:56 +02:00
|
|
|
|
text-shadow: 2px 2px #${base00};
|
2023-07-04 13:25:08 +02:00
|
|
|
|
border: none;
|
|
|
|
|
border-radius: 0;
|
|
|
|
|
outline: none;
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
background: none;
|
2023-07-05 15:20:32 +02:00
|
|
|
|
color: #${base05};
|
2023-07-04 13:25:08 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.background {
|
2023-12-08 01:12:08 +01:00
|
|
|
|
background: alpha(#${base00}, 0.925);
|
2023-07-04 13:25:08 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
button:hover {
|
2023-07-05 15:20:32 +02:00
|
|
|
|
background: #${base01};
|
2023-07-04 13:25:08 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#bar {
|
2023-07-05 15:20:32 +02:00
|
|
|
|
border-top: 1px solid #${base01};
|
2023-07-04 13:25:08 +02:00
|
|
|
|
}
|
|
|
|
|
|
2024-01-31 00:09:09 +01:00
|
|
|
|
.label, .script, .tray {
|
|
|
|
|
padding-left: 0.5em;
|
|
|
|
|
padding-right: 0.5em;
|
2023-07-21 20:10:10 +02:00
|
|
|
|
}
|
|
|
|
|
|
2023-07-04 13:25:08 +02:00
|
|
|
|
.popup {
|
2023-07-05 15:20:32 +02:00
|
|
|
|
border: 1px solid #${base01};
|
2023-07-04 13:25:08 +02:00
|
|
|
|
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;
|
2023-07-05 15:20:32 +02:00
|
|
|
|
border-top: 1px solid #${base01};
|
2023-07-04 13:25:08 +02:00
|
|
|
|
font-size: 1.5em;
|
|
|
|
|
}
|
|
|
|
|
|
2023-07-18 04:07:10 +02:00
|
|
|
|
.popup-clock .calendar {
|
|
|
|
|
padding: 0.2em 0.4em;
|
|
|
|
|
}
|
|
|
|
|
|
2023-07-18 04:08:10 +02:00
|
|
|
|
.popup-clock .calendar:selected {
|
|
|
|
|
color: #${base09};
|
|
|
|
|
}
|
|
|
|
|
|
2023-07-04 13:25:08 +02:00
|
|
|
|
.launcher .item {
|
2023-07-04 18:04:41 +02:00
|
|
|
|
padding-left: 1em;
|
|
|
|
|
padding-right: 1em;
|
2023-07-04 13:25:08 +02:00
|
|
|
|
margin-right: 4px;
|
|
|
|
|
}
|
|
|
|
|
|
2023-07-21 20:11:19 +02:00
|
|
|
|
button:active {
|
2023-07-21 20:12:50 +02:00
|
|
|
|
background: #${base04};
|
2023-07-11 13:55:37 +02:00
|
|
|
|
}
|
|
|
|
|
|
2023-07-04 13:25:08 +02:00
|
|
|
|
.launcher .open {
|
2023-07-27 00:45:27 +02:00
|
|
|
|
box-shadow: inset 0 -2px #${base04};
|
2023-07-04 13:25:08 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.launcher .focused {
|
2023-07-05 15:20:32 +02:00
|
|
|
|
box-shadow: inset 0 -2px #${base09};
|
2023-07-16 00:13:13 +02:00
|
|
|
|
background: #${base01};
|
2023-07-04 13:25:08 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.popup-launcher {
|
|
|
|
|
padding: 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.popup-launcher .popup-item:not(:first-child) {
|
2023-07-05 15:20:32 +02:00
|
|
|
|
border-top: 1px solid #${base01};
|
2023-07-04 13:25:08 +02:00
|
|
|
|
}
|
2024-01-31 13:16:19 +01:00
|
|
|
|
|
|
|
|
|
#startMenu {
|
|
|
|
|
padding-left: 1em;
|
|
|
|
|
padding-right: 0.5em;
|
|
|
|
|
}
|
2023-07-04 13:25:08 +02:00
|
|
|
|
'';
|
2024-04-08 12:28:25 +02:00
|
|
|
|
|
2024-04-08 13:05:08 +02:00
|
|
|
|
xdg.configFile.${mullvadNotification} = {
|
|
|
|
|
executable = true;
|
|
|
|
|
text = /* fish */ ''
|
|
|
|
|
#!/usr/bin/env fish
|
|
|
|
|
|
|
|
|
|
mullvad relay set location any
|
|
|
|
|
mullvad relay set location us
|
|
|
|
|
|
|
|
|
|
sleep 0.2
|
|
|
|
|
|
|
|
|
|
notify-send -t 2000 "Mullvad" "$(mullvad status | choose 2)"
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
2024-04-08 12:28:25 +02:00
|
|
|
|
xdg.configFile.${mullvadScript} = {
|
|
|
|
|
executable = true;
|
|
|
|
|
text = /* fish */ ''
|
|
|
|
|
#!/usr/bin/env fish
|
|
|
|
|
|
|
|
|
|
function get_mullvad_status
|
|
|
|
|
if test -z "$inside"
|
|
|
|
|
set inside true
|
|
|
|
|
test -n "$initialized" && sleep 0.2
|
|
|
|
|
|
2024-04-23 04:18:48 +02:00
|
|
|
|
set MULLVAD (mullvad status | head -1)
|
2024-04-08 12:28:25 +02:00
|
|
|
|
|
|
|
|
|
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/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
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
get_mullvad_status
|
|
|
|
|
set initialized true
|
|
|
|
|
|
|
|
|
|
${inotify-tools}/bin/inotifywait -q -e close_write,moved_to,create -m /etc/mullvad-vpn |
|
|
|
|
|
while read directory events filename
|
|
|
|
|
get_mullvad_status
|
|
|
|
|
end
|
|
|
|
|
'';
|
|
|
|
|
};
|
2024-04-08 14:12:40 +02:00
|
|
|
|
|
|
|
|
|
xdg.configFile.${volumeScript} = {
|
|
|
|
|
executable = true;
|
|
|
|
|
text = /* fish */ ''
|
|
|
|
|
#!/usr/bin/env fish
|
|
|
|
|
|
|
|
|
|
function get_volume
|
|
|
|
|
set VOLUME (wpctl get-volume @DEFAULT_AUDIO_SINK@ | choose 1)
|
|
|
|
|
echo "音量:$(math "$VOLUME * 100")%"
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
~/.config/${volumeGet}
|
|
|
|
|
|
|
|
|
|
pactl subscribe | grep --line-buffered -e "シンク" | xargs -L 1 ~/.config/${volumeGet}
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
xdg.configFile.${volumeGet} = {
|
|
|
|
|
executable = true;
|
|
|
|
|
text = /* fish */ ''
|
|
|
|
|
#!/usr/bin/env fish
|
|
|
|
|
|
|
|
|
|
set VOLUME (wpctl get-volume @DEFAULT_AUDIO_SINK@ | choose 1)
|
|
|
|
|
echo "音量:$(math "$VOLUME * 100")%"
|
|
|
|
|
'';
|
|
|
|
|
};
|
2023-07-04 13:25:08 +02:00
|
|
|
|
}
|