diff --git a/flake-modules/rice.nix b/flake-modules/rice.nix index ebecd75..0503d59 100644 --- a/flake-modules/rice.nix +++ b/flake-modules/rice.nix @@ -43,14 +43,12 @@ pkgs: rec { code = { name = "JetBrainsMono Nerd Font"; package = pkgs.nerd-fonts.jetbrains-mono; - # name = "CascadiaCove-NF"; - # package = (pkgs.nerdfonts.override { fonts = [ "CascadiaCode" ]; }); }; base = { # name = "NewComputerModern08"; # package = pkgs.newcomputermodern; name = "Atkinson Hyperlegible"; - package = pkgs.atkinson-hyperlegible; + package = pkgs.atkinson-hyperlegible-next; }; }; cursor = { diff --git a/git-crypt/secrets.nix b/git-crypt/secrets.nix index f356638..ef17bb3 100644 Binary files a/git-crypt/secrets.nix and b/git-crypt/secrets.nix differ diff --git a/home-modules/bar.nix b/home-modules/bar.nix new file mode 100644 index 0000000..f8632bd --- /dev/null +++ b/home-modules/bar.nix @@ -0,0 +1,807 @@ +{ pkgs, hyper, ... }@all: with all; let + sep = " "; +in { + sops.secrets = { + "nx2site/radicale/password" = { }; + }; + home.packages = [ + (pkgs.writeShellApplication { name = "submap_indicator"; text = /*bash*/ '' + print_help() { + echo "Usage: submap_indicator {set |unset}" + } + if [ $# -lt 1 ]; then + print_help; exit 1; + fi + case "$1" in + set) + # Check if there is a second argument for the 'set' operation + if [ $# -eq 2 ]; then + echo "$2" > /tmp/submap-indictor + pkill -RTMIN+8 waybar + pkill -RTMIN+8 hyprpanel + else + echo "Error: 'set' operation requires exactly one string argument." + print_help + exit 1 + fi + ;; + unset) + echo "" > /tmp/submap-indictor + pkill -RTMIN+8 waybar + pkill -RTMIN+8 hyprpanel + ;; + *) + echo "Error: Unknown command '$1'" + print_help + exit 1 + ;; + esac + exit 0 + '';}) + (pkgs.writeShellApplication { name = "cclock"; text = /*bash*/ '' + ord=$(date +"%e" | awk '{printf("%d%s\n", $1, ($1==11||$1==12||$1==13)?"th":((($1%10)==1)?"st":((($1%10)==2)?"nd":((($1%10)==3)?"rd":"th"))))}') + if [ $# -eq 0 ]; then + echo "󰃮${sep}$(date +'%A the')" "$ord" "of" "$(date +'%B')" " ${sep}$(date +'%R')" + elif [ "$1" = "--no-icons" ]; then + echo "$(date +'%A the')" "$ord" "of" "$(date +'%B')" "$(date +'%R')" + fi + '';}) + + (pkgs.writers.writePython3Bin "caldav_event" { + libraries = with pkgs.python3Packages; [ caldav ics pytz ]; + flakeIgnore = [ "E302" "E305" "E501" "E261" ]; + } /* python */ '' +import os +import json +from caldav import DAVClient +from datetime import datetime, timezone +from ics import Calendar +from pytz import UTC + +def get_password(password_file): + with open(password_file, "r") as file: + return file.read().strip() + +def datetime_converter(obj): + if isinstance(obj, datetime): + return obj.isoformat() + return obj + +def datetime_parser(dct): + for key, value in dct.items(): + if isinstance(value, str): + try: + dct[key] = datetime.fromisoformat(value) + except ValueError: + pass + return dct + +def load_cache(cache_file): + if os.path.exists(cache_file): + with open(cache_file, "r") as file: + return json.load(file, object_hook=datetime_parser) + return None + +def save_cache(cache_file, data): + with open(cache_file, "w") as file: + json.dump(data, file, default=datetime_converter, indent=4) + + +def get_ongoing_or_next_event(url, username, password): + now = datetime.now(timezone.utc) + + try: + client = DAVClient(url, username=username, password=password) + principal = client.principal() + calendars = principal.calendars() + + next_event_dict = { + 'event_name': "fake", + 'event_begin': datetime(9000, 1, 1, tzinfo=UTC), # in the year 9000 + 'event_end': datetime(9000, 1, 1, 8, tzinfo=UTC), + } + + for calendar in calendars: + for event in calendar.search(start=now): + calendar_parsed = Calendar(event.data) + for ics_event in calendar_parsed.events: + event_dict = {} + event_dict['event_name'] = ics_event.name or "(No Title)" + event_dict['event_begin'] = ics_event.begin.astimezone(timezone.utc) + event_dict['event_end'] = ics_event.end.astimezone(timezone.utc) + + if event_dict['event_begin'] <= now and now <= event_dict['event_end']: + return event_dict + elif event_dict['event_begin'] >= now and next_event_dict['event_begin'] > event_dict['event_begin']: + next_event_dict = event_dict + return next_event_dict + + except Exception as e: + print(f"Error accessing {url}: {e}") + return None + +def is_expired(event_dict: dict): + now = datetime.now(timezone.utc).timestamp() + event_end = event_dict['event_end'].timestamp() + return not (now <= event_end) + +if __name__ == "__main__": + password_file = "${config.sops.secrets."nx2site/radicale/password".path}" # Path to password file + cache_file = "/tmp/caldav_event_cache.json" # Path to cache file + url = "https://dav.${hyper.domain}/" + username = "nx2" + password = get_password(password_file) + now = datetime.now(timezone.utc).timestamp() + + event_dict = load_cache(cache_file) + + if (event_dict is None) or (is_expired(event_dict)): + event_dict = get_ongoing_or_next_event(url, username, password) + save_cache(cache_file, event_dict) + + if event_dict is None: # none were found + print("* zen *") + exit(0) + + event_start = event_dict['event_begin'].timestamp() + event_end = event_dict['event_end'].timestamp() + + if event_start <= now <= event_end: # is currently ongoing + action_string = "ends" + t = event_end - now # time_remaining + else: # is in the future + action_string = "starts" + t = event_start - now # time_remaining + + hours, rem = divmod(int(t), 3600) + minutes, _ = divmod(rem, 60) + hour_string = f"{hours} hour{'s ' if hours != 1 else ' '}" if hours > 0 else "" + minu_string = f"{minutes} minute{'s ' if minutes != 1 else ' '}" if minutes > 0 else "" + if hour_string == "" and minu_string == "": + time_string = "now" + elif hour_string == "" or minu_string == "": + time_string = "in " + hour_string + minu_string + else: + time_string = "in " + hour_string + "and " + minu_string + + print(f"{event_dict['event_name']} {action_string} {time_string}") +'') + ]; + programs = { + waybar = { + enable = false; + package = pkgs.waybar; + settings = { + bar = { + # height = 20; + layer = "top"; + position = "bottom"; + margin-top = 0; + # margin-left = rice.gap-size; + # margin-bottom = rice.gap-size; + # margin-right = rice.gap-size; + margin-left = 0; + margin-bottom = 0; + margin-right = 0; + spacing = 10; + fixed-center = true; + modules-left = [ + # "cpu" + # "memory" + "wireplumber" + "backlight" + "battery" + "network" + "hyprland/window" + ]; + modules-center = [ + "hyprland/workspaces" + ]; + modules-right = [ + "custom/mode" + "custom/caldav_event" + "custom/cclock" + "tray" + ]; + "hyprland/workspaces" = { + on-click = "activate"; + format = "{name}"; + all-outputs = false; + active-only = false; + }; + "hyprland/window" = { + # format = "${sep}{}"; + format = "{}"; + separate-outputs = true; + }; + "custom/cclock" = { + exec = "cclock"; + restart-interval = 60; + }; + "custom/caldav_event" = { + format = "󰃰${sep}{}"; + exec = "caldav_event"; + restart-interval = 60; + max-width = 60; + }; + "custom/mode" = { + exec = "cat /tmp/submap-indictor"; + interval = "once"; + signal = 8; + }; + + cpu = { + interval = 1; + format = "󰍛${sep}{}%"; + max-length = 10; + }; + memory = { + interval = 5; + format = "${sep}{avail:.0f}G free"; + }; + battery = { + interval = 60; + tooltip = false; + format = "{icon}${sep}{capacity}%"; + states = { + warning = 15; + critical = 5; + }; + format-icons = [ " " " " " " " " " " ]; + format-charging = "{icon}${sep}+{capacity}%"; + format-plugged = "{icon}${sep}P{capacity}%"; + format-full = "{icon}${sep}F{capacity}%"; + }; + backlight = { + device = "eDP-1"; + format = "{icon}${sep}{percent}%"; + format-icons = [ "" "" "" "" "" "" "" "" "" ]; + }; + network = { + format-wifi = "${sep}{essid}"; + format-ethernet = "󰈀${sep}Wired"; + format-disconnected = "󰌙${sep}Disconnected"; + }; + wireplumber = { + format = "󰕾${sep}{volume}%"; + format-muted = "󰝟${sep}--%"; + }; + }; + }; + style = with rice.color; let f = rice.lib.hex-to-rgb-comma-string; in /* css */ '' + * { + font-family: ${rice.font.code.name}; + font-size: 1em; + min-height: 0px; + margin: 0px; + padding: 0px; + } + + window#waybar { + background: rgba(${f background},${builtins.toString rice.transparency}); + } + + #clock, + #custom-cclock, + #custom-mode, + #custom-caldav-event, + #battery, + #cpu, + #tray, + #disk, + #backlight, + #network, + #wireplumber, + #memory, + #window, + #workspaces { + padding: 0px 3px; + margin-top: 0.3em; + border-radius: ${builtins.toString rice.rounding}px; + color: rgb(${f accent.bright}); + } + + #workspaces button { + color: rgb(${f accent.base}); + padding-left: 15px; + padding-right: 15px; + border-radius: ${builtins.toString rice.rounding}px; + } + #workspaces button.active { color: rgb(${f background}); background-color: rgb(${f accent.base}); } + #workspaces button:hover { color: rgb(${f tertiary.bright}); } + #workspaces button.urgent { background-color: rgba(${f magenta.base},${builtins.toString rice.transparency}); } + + #window, #custom-caldav_event { + font-family: ${rice.font.base.name}, ${rice.font.code.name}; + color: rgb(${f tertiary.bright}); + } + + #wireplumber.muted { color: rgb(${f tertiary.bright}); } + #wireplumber { padding-left: 10px; } + + #battery.warning:not(.charging) { color: rgb(${f green.base});; } + #battery.charging { color: rgb(${f green.base}); } + #battery.critical { + background: rgb(${f negative.base}); + color: rgb(${f foreground}); + } + + #custom-mode { color: rgb(${f red.base}); } + ''; + }; + hyprpanel = { + enable = true; + package = pkgs.unstable.hyprpanel; + settings = with rice.color; let + t = builtins.toString (builtins.ceil (rice.transparency * 100)); + in { + "bar.layouts" = { + "*" = { + "left" = [ + "volume" + # "microphone" + # "cpu" + # "cputemp" + # "ram" + "battery" + # "bluetooth" + "network" + "windowtitle" + ]; + "middle" = [ "workspaces" ]; + "right" = [ + "submap" + "custom/caldav_event" + "media" + "custom/cclock" + "notifications" + "systray" + ]; + }; + }; + + "bar.bluetooth.label" = true; + + "bar.customModules.submap.enabledIcon" = "[󰧹]"; + "bar.customModules.submap.showSubmapName" = false; + "bar.customModules.submap.label" = false; + "bar.customModules.submap.icon" = true; + "bar.customModules.submap.disabledIcon" = ""; + + "bar.workspaces.applicationIconOncePerWorkspace" = false; + "bar.workspaces.numbered_active_indicator" = "underline"; + "bar.workspaces.scroll_speed" = 1; + "bar.workspaces.showAllActive" = false; + "bar.workspaces.showApplicationIcons" = true; + "bar.workspaces.show_icons" = false; + "bar.workspaces.show_numbered" = false; + "bar.workspaces.showWsIcons" = true; + "bar.workspaces.spacing" = 1; + "bar.workspaces.workspaceMask" = true; + "bar.workspaces.workspaces" = 5; + + "theme.bar.background" = background; + "theme.bar.border.color" = accent.base; + "theme.bar.border_radius" = "0.2em"; + + "theme.bar.buttons.background" = background; + "theme.bar.buttons.background_opacity" = 0; + "theme.bar.buttons.spacing" = "0em"; + "theme.bar.buttons.padding_x" = "0.5rem"; + + "theme.bar.buttons.battery.background" = background; + "theme.bar.buttons.battery.border" = accent.base; + "theme.bar.buttons.battery.icon_background" = background; + "theme.bar.buttons.battery.icon" = accent.base; + "theme.bar.buttons.battery.text" = accent.base; + + "theme.bar.buttons.bluetooth.background" = background; + "theme.bar.buttons.bluetooth.border" = accent.base; + "theme.bar.buttons.bluetooth.icon_background" = background; + "theme.bar.buttons.bluetooth.icon" = accent.base; + "theme.bar.buttons.bluetooth.text" = accent.base; + + "theme.bar.buttons.borderColor" = accent.base; + + "theme.bar.buttons.clock.background" = background; + "theme.bar.buttons.clock.border" = accent.base; + "theme.bar.buttons.clock.icon_background" = background; + "theme.bar.buttons.clock.icon" = accent.base; + "theme.bar.buttons.clock.text" = accent.base; + + "theme.bar.buttons.dashboard.background" = background; + "theme.bar.buttons.dashboard.border" = accent.base; + "theme.bar.buttons.dashboard.icon" = accent.base; + "theme.bar.buttons.icon_background" = background; + + "theme.bar.buttons.icon" = accent.base; + + "theme.bar.buttons.media.background" = background; + "theme.bar.buttons.media.border" = accent.base; + "theme.bar.buttons.media.icon_background" = background; + "theme.bar.buttons.media.icon" = accent.base; + "theme.bar.buttons.media.text" = accent.base; + + "theme.bar.buttons.modules.cava.background" = background; + "theme.bar.buttons.modules.cava.border" = accent.base; + "theme.bar.buttons.modules.cava.icon_background" = background; + "theme.bar.buttons.modules.cava.icon" = accent.base; + "theme.bar.buttons.modules.cava.text" = accent.base; + + "theme.bar.buttons.modules.cpu.background" = background; + "theme.bar.buttons.modules.cpu.border" = accent.base; + "theme.bar.buttons.modules.cpu.icon_background" = background; + "theme.bar.buttons.modules.cpu.icon" = accent.base; + "theme.bar.buttons.modules.cpu.text" = accent.base; + + "theme.bar.buttons.modules.cpuTemp.background" = background; + "theme.bar.buttons.modules.cpuTemp.border" = accent.base; + "theme.bar.buttons.modules.cpuTemp.icon_background" = background; + "theme.bar.buttons.modules.cpuTemp.icon" = accent.base; + "theme.bar.buttons.modules.cpuTemp.text" = accent.base; + + "theme.bar.buttons.modules.hypridle.background" = background; + "theme.bar.buttons.modules.hypridle.border" = accent.base; + "theme.bar.buttons.modules.hypridle.icon_background" = background; + "theme.bar.buttons.modules.hypridle.icon" = accent.base; + "theme.bar.buttons.modules.hypridle.text" = accent.base; + + "theme.bar.buttons.modules.hyprsunset.background" = background; + "theme.bar.buttons.modules.hyprsunset.border" = accent.base; + "theme.bar.buttons.modules.hyprsunset.icon_background" = background; + "theme.bar.buttons.modules.hyprsunset.icon" = accent.base; + "theme.bar.buttons.modules.hyprsunset.text" = accent.base; + + "theme.bar.buttons.modules.kbLayout.background" = background; + "theme.bar.buttons.modules.kbLayout.border" = accent.base; + "theme.bar.buttons.modules.kbLayout.icon_background" = background; + "theme.bar.buttons.modules.kbLayout.icon" = accent.base; + "theme.bar.buttons.modules.kbLayout.text" = accent.base; + + "theme.bar.buttons.modules.microphone.background" = background; + "theme.bar.buttons.modules.microphone.border" = accent.base; + "theme.bar.buttons.modules.microphone.icon_background" = background; + "theme.bar.buttons.modules.microphone.icon" = accent.base; + "theme.bar.buttons.modules.microphone.text" = accent.base; + + "theme.bar.buttons.modules.netstat.background" = background; + "theme.bar.buttons.modules.netstat.border" = accent.base; + "theme.bar.buttons.modules.netstat.icon_background" = background; + "theme.bar.buttons.modules.netstat.icon" = accent.base; + "theme.bar.buttons.modules.netstat.text" = accent.base; + + "theme.bar.buttons.modules.power.background" = background; + "theme.bar.buttons.modules.power.border" = accent.base; + "theme.bar.buttons.modules.power.icon_background" = background; + "theme.bar.buttons.modules.power.icon" = accent.base; + + "theme.bar.buttons.modules.ram.background" = background; + "theme.bar.buttons.modules.ram.border" = accent.base; + "theme.bar.buttons.modules.ram.icon_background" = background; + "theme.bar.buttons.modules.ram.icon" = accent.base; + "theme.bar.buttons.modules.ram.text" = accent.base; + + "theme.bar.buttons.modules.storage.background" = background; + "theme.bar.buttons.modules.storage.border" = accent.base; + "theme.bar.buttons.modules.storage.icon_background" = background; + "theme.bar.buttons.modules.storage.icon" = accent.base; + "theme.bar.buttons.modules.storage.text" = accent.base; + + "theme.bar.buttons.modules.submap.background" = background; + "theme.bar.buttons.modules.submap.border" = accent.base; + "theme.bar.buttons.modules.submap.icon_background" = background; + "theme.bar.buttons.modules.submap.icon" = accent.base; + "theme.bar.buttons.modules.submap.text" = special.base; + + "theme.bar.buttons.modules.updates.background" = background; + "theme.bar.buttons.modules.updates.border" = accent.base; + "theme.bar.buttons.modules.updates.icon_background" = background; + "theme.bar.buttons.modules.updates.icon" = accent.base; + "theme.bar.buttons.modules.updates.text" = accent.base; + + "theme.bar.buttons.modules.weather.background" = background; + "theme.bar.buttons.modules.weather.border" = accent.base; + "theme.bar.buttons.modules.weather.icon_background" = background; + "theme.bar.buttons.modules.weather.icon" = accent.base; + "theme.bar.buttons.modules.weather.text" = accent.base; + + "theme.bar.buttons.modules.worldclock.background" = background; + "theme.bar.buttons.modules.worldclock.border" = accent.base; + "theme.bar.buttons.modules.worldclock.icon_background" = background; + "theme.bar.buttons.modules.worldclock.icon" = accent.base; + "theme.bar.buttons.modules.worldclock.text" = accent.base; + "theme.bar.buttons.monochrome" = false; + + "theme.bar.buttons.network.background" = background; + "theme.bar.buttons.network.border" = accent.base; + "theme.bar.buttons.network.icon_background" = background; + "theme.bar.buttons.network.icon" = accent.base; + "theme.bar.buttons.network.text" = accent.base; + + "theme.bar.buttons.notifications.background" = background; + "theme.bar.buttons.notifications.border" = accent.base; + "theme.bar.buttons.notifications.icon_background" = background; + "theme.bar.buttons.notifications.icon" = accent.base; + "theme.bar.buttons.notifications.total" = accent.base; + + "theme.bar.buttons.opacity" = t; + + "theme.bar.buttons.separator.color" = accent.base; + + "theme.bar.buttons.style" = "default"; + + "theme.bar.buttons.systray.background" = background; + "theme.bar.buttons.systray.border" = accent.base; + "theme.bar.buttons.systray.customIcon" = accent.base; + + "theme.bar.buttons.text" = accent.base; + + "theme.bar.buttons.volume.background" = background; + "theme.bar.buttons.volume.border" = accent.base; + "theme.bar.buttons.volume.icon_background" = background; + "theme.bar.buttons.volume.icon" = accent.base; + "theme.bar.buttons.volume.text" = accent.base; + + "theme.bar.buttons.windowtitle.background" = background; + "theme.bar.buttons.windowtitle.border" = secondary.base; + "theme.bar.buttons.windowtitle.icon_background" = background; + "theme.bar.buttons.windowtitle.icon" = secondary.base; + "theme.bar.buttons.windowtitle.text" = secondary.base; + + "theme.bar.buttons.workspaces.active" = accent.bright; + "theme.bar.buttons.workspaces.available" = accent.base; + "theme.bar.buttons.workspaces.background" = background; + "theme.bar.buttons.workspaces.border" = accent.base; + "theme.bar.buttons.workspaces.hover" = foreground; + "theme.bar.buttons.workspaces.numbered_active_highlighted_text_color" = accent.base; + "theme.bar.buttons.workspaces.numbered_active_highlight_padding" = "0.2em"; + "theme.bar.buttons.workspaces.numbered_active_underline_color" = accent.bright; + "theme.bar.buttons.workspaces.numbered_inactive_padding" = "0.2em"; + "theme.bar.buttons.workspaces.occupied" = secondary.base; + "theme.bar.buttons.workspaces.pill.width" = "4em"; + "theme.bar.buttons.workspaces.smartHighlight" = true; + "theme.bar.buttons.y_margins" = "0em"; + + "theme.bar.location" = "bottom"; + + "theme.bar.menus.menu.battery.background.color" = background; + "theme.bar.menus.menu.battery.border.color" = accent.base; + "theme.bar.menus.menu.battery.card.color" = accent.dark; + "theme.bar.menus.menu.battery.icons.active" = accent.base; + "theme.bar.menus.menu.battery.icons.passive" = accent.base; + "theme.bar.menus.menu.battery.label.color" = accent.base; + "theme.bar.menus.menu.battery.listitems.active" = accent.base; + "theme.bar.menus.menu.battery.listitems.passive" = accent.base; + "theme.bar.menus.menu.battery.slider.background" = background; + "theme.bar.menus.menu.battery.slider.backgroundhover" = background; + "theme.bar.menus.menu.battery.slider.primary" = accent.base; + "theme.bar.menus.menu.battery.slider.puck" = accent.base; + "theme.bar.menus.menu.battery.text" = foreground; + + "theme.bar.menus.menu.bluetooth.background.color" = background; + "theme.bar.menus.menu.bluetooth.border.color" = accent.base; + "theme.bar.menus.menu.bluetooth.card.color" = accent.dark; + "theme.bar.menus.menu.bluetooth.iconbutton.active" = accent.base; + "theme.bar.menus.menu.bluetooth.iconbutton.passive" = accent.base; + "theme.bar.menus.menu.bluetooth.icons.active" = accent.base; + "theme.bar.menus.menu.bluetooth.icons.passive" = accent.base; + "theme.bar.menus.menu.bluetooth.label.color" = accent.base; + "theme.bar.menus.menu.bluetooth.listitems.active" = accent.base; + "theme.bar.menus.menu.bluetooth.listitems.passive" = accent.base; + "theme.bar.menus.menu.bluetooth.scroller.color" = accent.base; + "theme.bar.menus.menu.bluetooth.status" = accent.base; + "theme.bar.menus.menu.bluetooth.switch.disabled" = accent.base; + "theme.bar.menus.menu.bluetooth.switch_divider" = accent.base; + "theme.bar.menus.menu.bluetooth.switch.enabled" = accent.base; + "theme.bar.menus.menu.bluetooth.switch.puck" = accent.base; + "theme.bar.menus.menu.bluetooth.text" = foreground; + + "theme.bar.menus.menu.clock.background.color" = background; + "theme.bar.menus.menu.clock.border.color" = accent.base; + "theme.bar.menus.menu.clock.calendar.contextdays" = foreground; + "theme.bar.menus.menu.clock.calendar.currentday" = accent.base; + "theme.bar.menus.menu.clock.calendar.days" = accent.base; + "theme.bar.menus.menu.clock.calendar.paginator" = accent.base; + "theme.bar.menus.menu.clock.calendar.weekdays" = accent.base; + "theme.bar.menus.menu.clock.calendar.yearmonth" = accent.base; + "theme.bar.menus.menu.clock.card.color" = accent.dark; + "theme.bar.menus.menu.clock.text" = foreground; + "theme.bar.menus.menu.clock.time.time" = accent.base; + "theme.bar.menus.menu.clock.time.timeperiod" = accent.base; + "theme.bar.menus.menu.clock.weather.hourly.icon" = accent.base; + "theme.bar.menus.menu.clock.weather.hourly.temperature" = accent.base; + "theme.bar.menus.menu.clock.weather.hourly.time" = accent.base; + "theme.bar.menus.menu.clock.weather.icon" = accent.base; + "theme.bar.menus.menu.clock.weather.stats" = accent.base; + "theme.bar.menus.menu.clock.weather.status" = accent.base; + "theme.bar.menus.menu.clock.weather.temperature" = accent.base; + "theme.bar.menus.menu.clock.weather.thermometer.cold" = accent.base; + "theme.bar.menus.menu.clock.weather.thermometer.extremelycold" = accent.base; + "theme.bar.menus.menu.clock.weather.thermometer.extremelyhot" = accent.base; + "theme.bar.menus.menu.clock.weather.thermometer.hot" = accent.base; + "theme.bar.menus.menu.clock.weather.thermometer.moderate" = accent.base; + + "theme.bar.menus.menu.dashboard.background.color" = background; + "theme.bar.menus.menu.dashboard.border.color" = accent.base; + "theme.bar.menus.menu.dashboard.card.color" = accent.dark; + + "theme.bar.menus.menu.dashboard.controls.bluetooth.background" = background; + "theme.bar.menus.menu.dashboard.controls.bluetooth.text" = foreground; + "theme.bar.menus.menu.dashboard.controls.disabled" = accent.base; + "theme.bar.menus.menu.dashboard.controls.input.background" = background; + "theme.bar.menus.menu.dashboard.controls.input.text" = foreground; + "theme.bar.menus.menu.dashboard.controls.notifications.background" = background; + "theme.bar.menus.menu.dashboard.controls.notifications.text" = foreground; + "theme.bar.menus.menu.dashboard.controls.volume.background" = background; + "theme.bar.menus.menu.dashboard.controls.volume.text" = foreground; + "theme.bar.menus.menu.dashboard.controls.wifi.background" = background; + "theme.bar.menus.menu.dashboard.controls.wifi.text" = foreground; + + "theme.bar.menus.menu.dashboard.directories.left.bottom.color" = accent.base; + "theme.bar.menus.menu.dashboard.directories.left.middle.color" = accent.base; + "theme.bar.menus.menu.dashboard.directories.left.top.color" = accent.base; + "theme.bar.menus.menu.dashboard.directories.right.bottom.color" = accent.base; + "theme.bar.menus.menu.dashboard.directories.right.middle.color" = accent.base; + "theme.bar.menus.menu.dashboard.directories.right.top.color" = accent.base; + + "theme.bar.menus.menu.dashboard.monitors.bar_background" = background; + "theme.bar.menus.menu.dashboard.monitors.cpu.bar" = accent.base; + "theme.bar.menus.menu.dashboard.monitors.cpu.icon" = accent.base; + "theme.bar.menus.menu.dashboard.monitors.cpu.label" = accent.base; + "theme.bar.menus.menu.dashboard.monitors.disk.bar" = accent.base; + "theme.bar.menus.menu.dashboard.monitors.disk.icon" = accent.base; + "theme.bar.menus.menu.dashboard.monitors.disk.label" = accent.base; + "theme.bar.menus.menu.dashboard.monitors.gpu.bar" = accent.base; + "theme.bar.menus.menu.dashboard.monitors.gpu.icon" = accent.base; + "theme.bar.menus.menu.dashboard.monitors.gpu.label" = accent.base; + "theme.bar.menus.menu.dashboard.monitors.ram.bar" = accent.base; + "theme.bar.menus.menu.dashboard.monitors.ram.icon" = accent.base; + "theme.bar.menus.menu.dashboard.monitors.ram.label" = accent.base; + + "theme.bar.menus.menu.dashboard.powermenu.confirmation.background" = background; + "theme.bar.menus.menu.dashboard.powermenu.confirmation.body" = accent.base; + "theme.bar.menus.menu.dashboard.powermenu.confirmation.border" = accent.base; + "theme.bar.menus.menu.dashboard.powermenu.confirmation.button_text" = foreground; + "theme.bar.menus.menu.dashboard.powermenu.confirmation.card" = accent.dark; + "theme.bar.menus.menu.dashboard.powermenu.confirmation.confirm" = accent.base; + "theme.bar.menus.menu.dashboard.powermenu.confirmation.deny" = accent.base; + "theme.bar.menus.menu.dashboard.powermenu.confirmation.label" = accent.base; + "theme.bar.menus.menu.dashboard.powermenu.logout" = accent.base; + "theme.bar.menus.menu.dashboard.powermenu.restart" = accent.base; + "theme.bar.menus.menu.dashboard.powermenu.shutdown" = accent.base; + "theme.bar.menus.menu.dashboard.powermenu.sleep" = accent.base; + "theme.bar.menus.menu.dashboard.profile.name" = accent.base; + "theme.bar.menus.menu.dashboard.shortcuts.background" = background; + "theme.bar.menus.menu.dashboard.shortcuts.recording" = accent.base; + "theme.bar.menus.menu.dashboard.shortcuts.text" = foreground; + + "theme.bar.menus.menu.media.album" = accent.base; + "theme.bar.menus.menu.media.artist" = accent.base; + "theme.bar.menus.menu.media.background.color" = "#000000"; + "theme.bar.menus.menu.media.border.color" = accent.base; + "theme.bar.menus.menu.media.buttons.background" = background; + "theme.bar.menus.menu.media.buttons.enabled" = accent.base; + "theme.bar.menus.menu.media.buttons.inactive" = accent.base; + "theme.bar.menus.menu.media.buttons.text" = foreground; + "theme.bar.menus.menu.media.card.color" = accent.dark; + "theme.bar.menus.menu.media.card.tint" = accent.dark; + "theme.bar.menus.menu.media.slider.background" = accent.dark; + "theme.bar.menus.menu.media.slider.backgroundhover" = secondary.dark; + "theme.bar.menus.menu.media.slider.primary" = accent.base; + "theme.bar.menus.menu.media.slider.puck" = accent.bright; + "theme.bar.menus.menu.media.song" = accent.base; + "theme.bar.menus.menu.media.timestamp" = accent.base; + + "theme.bar.menus.menu.network.background.color" = background; + "theme.bar.menus.menu.network.border.color" = accent.base; + "theme.bar.menus.menu.network.card.color" = accent.dark; + "theme.bar.menus.menu.network.iconbuttons.active" = accent.base; + "theme.bar.menus.menu.network.iconbuttons.passive" = accent.base; + "theme.bar.menus.menu.network.icons.active" = accent.base; + "theme.bar.menus.menu.network.icons.passive" = accent.base; + "theme.bar.menus.menu.network.label.color" = accent.base; + "theme.bar.menus.menu.network.listitems.active" = accent.base; + "theme.bar.menus.menu.network.listitems.passive" = accent.base; + "theme.bar.menus.menu.network.scroller.color" = accent.base; + "theme.bar.menus.menu.network.status.color" = accent.base; + "theme.bar.menus.menu.network.switch.disabled" = accent.base; + "theme.bar.menus.menu.network.switch.enabled" = accent.base; + "theme.bar.menus.menu.network.switch.puck" = accent.base; + "theme.bar.menus.menu.network.text" = foreground; + + "theme.bar.menus.menu.notifications.background" = background; + "theme.bar.menus.menu.notifications.border" = accent.base; + "theme.bar.menus.menu.notifications.card" = accent.dark; + "theme.bar.menus.menu.notifications.clear" = accent.base; + "theme.bar.menus.menu.notifications.label" = accent.base; + "theme.bar.menus.menu.notifications.no_notifications_label" = accent.base; + "theme.bar.menus.menu.notifications.pager.background" = background; + "theme.bar.menus.menu.notifications.pager.button" = accent.dark; + "theme.bar.menus.menu.notifications.pager.label" = accent.base; + "theme.bar.menus.menu.notifications.scrollbar.color" = accent.base; + "theme.bar.menus.menu.notifications.switch.disabled" = accent.base; + "theme.bar.menus.menu.notifications.switch_divider" = accent.base; + "theme.bar.menus.menu.notifications.switch.enabled" = accent.base; + "theme.bar.menus.menu.notifications.switch.puck" = accent.base; + + + "theme.bar.menus.menu.power.background.color" = background; + "theme.bar.menus.menu.power.border.color" = accent.base; + + "theme.bar.menus.menu.power.buttons.logout.background" = background; + "theme.bar.menus.menu.power.buttons.logout.icon_background" = background; + "theme.bar.menus.menu.power.buttons.logout.icon" = accent.base; + "theme.bar.menus.menu.power.buttons.logout.text" = foreground; + + "theme.bar.menus.menu.power.buttons.restart.background" = background; + "theme.bar.menus.menu.power.buttons.restart.icon_background" = background; + "theme.bar.menus.menu.power.buttons.restart.icon" = accent.base; + "theme.bar.menus.menu.power.buttons.restart.text" = foreground; + + "theme.bar.menus.menu.power.buttons.shutdown.background" = background; + "theme.bar.menus.menu.power.buttons.shutdown.icon_background" = background; + "theme.bar.menus.menu.power.buttons.shutdown.icon" = accent.base; + "theme.bar.menus.menu.power.buttons.shutdown.text" = foreground; + + "theme.bar.menus.menu.power.buttons.sleep.background" = background; + "theme.bar.menus.menu.power.buttons.sleep.icon_background" = background; + "theme.bar.menus.menu.power.buttons.sleep.icon" = accent.base; + "theme.bar.menus.menu.power.buttons.sleep.text" = foreground; + + + "theme.bar.menus.menu.systray.dropdownmenu.background" = background; + "theme.bar.menus.menu.systray.dropdownmenu.divider" = accent.base; + "theme.bar.menus.menu.systray.dropdownmenu.text" = foreground; + + "theme.bar.menus.menu.volume.audio_slider.background" = background; + "theme.bar.menus.menu.volume.audio_slider.backgroundhover" = background; + "theme.bar.menus.menu.volume.audio_slider.primary" = accent.base; + "theme.bar.menus.menu.volume.audio_slider.puck" = accent.base; + "theme.bar.menus.menu.volume.background.color" = background; + "theme.bar.menus.menu.volume.border.color" = accent.base; + "theme.bar.menus.menu.volume.card.color" = accent.dark; + "theme.bar.menus.menu.volume.iconbutton.active" = accent.base; + "theme.bar.menus.menu.volume.iconbutton.passive" = accent.base; + "theme.bar.menus.menu.volume.input_slider.background" = background; + "theme.bar.menus.menu.volume.input_slider.backgroundhover" = background; + "theme.bar.menus.menu.volume.input_slider.primary" = accent.base; + "theme.bar.menus.menu.volume.input_slider.puck" = accent.base; + "theme.bar.menus.menu.volume.label.color" = accent.base; + "theme.bar.menus.menu.volume.listitems.active" = accent.base; + "theme.bar.menus.menu.volume.listitems.passive" = accent.base; + "theme.bar.menus.menu.volume.text" = foreground; + + "theme.bar.menus.monochrome" = false; + + "theme.bar.opacity" = t; + "theme.bar.outer_spacing" = "0em"; + "theme.bar.transparent" = false; + + "theme.font.name" = rice.font.code.name; + "theme.font.size" = "12px"; + + "theme.notification.actions.background" = background; + "theme.notification.actions.text" = foreground; + "theme.notification.background" = background; + "theme.notification.border" = accent.base; + "theme.notification.close_button.background" = accent.dark; + "theme.notification.close_button.label" = accent.base; + "theme.notification.label" = accent.base; + "theme.notification.labelicon" = accent.base; + "theme.notification.opacity" = 1.0; + "theme.notification.text" = foreground; + "theme.notification.time" = accent.base; + + "theme.osd.bar_color" = accent.base; + "theme.osd.bar_container" = accent.dark; + "theme.osd.bar_empty_color" = accent.dark; + "theme.osd.bar_overflow_color" = accent.base; + "theme.osd.border.color" = border; + "theme.osd.icon_container" = secondary.dark; + "theme.osd.icon" = secondary.bright; + "theme.osd.label" = accent.bright; + "theme.osd.opacity" = t; + }; + }; + }; +} diff --git a/home-modules/calendar.nix b/home-modules/calendar.nix index c39131d..0ae3cd7 100644 --- a/home-modules/calendar.nix +++ b/home-modules/calendar.nix @@ -47,13 +47,6 @@ read-only = true; type = "ics"; } - { - name = "MSI"; - url = "https://zlypher.github.io/lol-events/cal/league-of-legends-mid-invitational.ical"; - color = "#dd6000"; - read-only = true; - type = "ics"; - } { name = "Feiertage Hessen"; url = "https://ics.tools/Feiertage/hessen.ics"; diff --git a/home-modules/chatterino.nix b/home-modules/chatterino.nix index 7a01b1c..e0a8915 100644 --- a/home-modules/chatterino.nix +++ b/home-modules/chatterino.nix @@ -7,6 +7,9 @@ let # "Caedrel" # "EintrachtSpandau" "GamesDoneQuick" + "Odoamne" + "iwdominate" + "imls" "gdolphn" "GRONKH" "handofblood" @@ -74,18 +77,27 @@ in { "separateMessages": true, "showTimestamps": false, "timestampFormat": "h =mm", - "usernameDisplayMode": 1 + "usernameDisplayMode": 1, + "findAllUsernames": true }, + "showReplyButton": false, + "showTabCloseButton": false, + "showTabLiveButton": false, "splitheader": { "showGame": true, "showTitle": true, "showUptime": true, "showViewerCount": true }, + "tabStyle": "compact", "tabVisibility": 0, "theme": { "name": "nxtheme.json" } }, "behaviour": { + "autocopletion": { + "ShowUsernameCompeltionMenu": false, + "userCompletinOnlyWithAt": true + }, "pauseOnHoverDuration": 5.0, "showJoins": false, "usernameRightClickBehavior": 0, @@ -100,13 +112,13 @@ in { { "alert": false, "color": "#7f7f3f49", "displayName": "Broadcaster", "name": "broadcaster", "showInMentions": false, "sound": false, "soundUrl": "" }, { "alert": false, "color": "#7f7f3f49", "displayName": "Admin", "name": "admin", "showInMentions": false, "sound": false, "soundUrl": "" }, { "alert": false, "color": "#7f7f3f49", "displayName": "Staff", "name": "staff", "showInMentions": false, "sound": false, "soundUrl": "" }, - { "alert": false, "displayName": "Moderator", "name": "moderator", "showInMentions": false, "sound": false, "soundUrl": "" }, + { "alert": false, "color": "#7f7f3f49", "displayName": "Moderator", "name": "moderator", "showInMentions": false, "sound": false, "soundUrl": "" }, { "alert": false, "color": "#7f7f3578", "displayName": "VIP", "name": "vip", "showInMentions": false, "sound": false, "soundUrl": "" } ], "selfMessageHighlight": { "color": "#73008cff", "enabled": true } }, "hotkeys": { - "addedDefaults": [ "change channel", "close popup window", "create clip", "delete", "emote picker", "focus down", "focus left", "focus right", "focus up", "go to end of input", "go to end of input with selection", "go to start of input", "go to start of input with selection", "new popup window", "new popup window from tab", "new split", "new tab", "next message", "open debug popup", "open quick switcher", "open settings", "popup accept", "popup focus search box", "popup reject", "popup scroll down", "popup scroll up", "popup select last tab", "popup select next tab", "popup select previous tab", "popup select tab #1", "popup select tab #2", "popup select tab #3", "popup select tab #4", "popup select tab #5", "popup select tab #6", "popup select tab #7", "popup select tab #8", "previous message", "reconnect", "reload emotes", "remove tab", "reopen split", "scroll page down", "scroll page up", "scroll to bottom", "scroll to top", "select last tab", "select next tab", "select previous tab", "select tab #1", "select tab #2", "select tab #3", "select tab #4", "select tab #5", "select tab #6", "select tab #7", "select tab #8", "send message", "send message and keep text", "show global search", "show search", "toggle live tabs only", "toggle local r9k", "toggle tab visibility", "zoom in", "zoom out", "zoom reset" ], + "addedDefaults": [ "change channel", "close popup window", "create clip", "delete", "emote picker", "focus down", "focus left", "focus right", "focus up", "go to end of input", "go to end of input with selection", "go to start of input", "go to start of input with selection", "new popup window", "new popup window from tab", "new split", "new tab", "next message", "open debug popup", "open overlay", "open quick switcher", "open settings", "popup accept", "popup focus search box", "popup reject", "popup scroll down", "popup scroll up", "popup select last tab", "popup select next tab", "popup select previous tab", "popup select tab #1", "popup select tab #2", "popup select tab #3", "popup select tab #4", "popup select tab #5", "popup select tab #6", "popup select tab #7", "popup select tab #8", "previous message", "reconnect", "reload emotes", "remove tab", "reopen split", "scroll page down", "scroll page up", "scroll to bottom", "scroll to top", "select last tab", "select next tab", "select previous tab", "select tab #1", "select tab #2", "select tab #3", "select tab #4", "select tab #5", "select tab #6", "select tab #7", "select tab #8", "send message", "send message and keep text", "show global search", "show search", "toggle live tabs only", "toggle local r9k", "toggle overlay click-through", "toggle tab visibility", "zoom in", "zoom out", "zoom reset" ], "change channel": { "action": "changeChannel", "arguments": [], "category": "split", "keySequence": "Ctrl+R" }, "close popup window": { "action": "delete", "arguments": [], "category": "popupWindow", "keySequence": "Esc" }, @@ -127,6 +139,7 @@ in { "new tab": { "action": "newTab", "arguments": [], "category": "window", "keySequence": "Ctrl+Shift+T" }, "next message": { "action": "nextMessage", "arguments": [], "category": "splitInput", "keySequence": "Down" }, "open debug popup": { "action": "debug", "arguments": [], "category": "split", "keySequence": "F10" }, + "open overlay": { "action": "popupOverlay", "arguments": [], "category": "split", "keySequence": "Ctrl+Alt+N" }, "open quick switcher": { "action": "openQuickSwitcher", "arguments": [], "category": "window", "keySequence": "Ctrl+K" }, "open settings": { "action": "openSettings", "arguments": [], "category": "window", "keySequence": "Ctrl+P" }, "popup accept": { "action": "accept", "arguments": [], "category": "popupWindow", "keySequence": "Return" }, @@ -169,14 +182,15 @@ in { "send message and keep text": { "action": "sendMessage", "arguments": [ "keepInput" ], "category": "splitInput", "keySequence": "Ctrl+Return" }, "show global search": { "action": "showGlobalSearch", "arguments": [], "category": "split", "keySequence": "Ctrl+Shift+F" }, "show search": { "action": "showSearch", "arguments": [], "category": "split", "keySequence": "Ctrl+F" }, - "toggle live tabs only": { "action": "setTabVisibility", "arguments": [ "toggleLiveOnly" ], "category": "window", "keySequence": "Ctrl+Shift+L" }, "toggle local r9k": { "action": "toggleLocalR9K", "arguments": [], "category": "window", "keySequence": "Ctrl+H" }, + "toggle overlay click-through": { "action": "toggleOverlayInertia", "arguments": [ "all" ], "category": "split", "keySequence": "Ctrl+Shift+U" }, "toggle tab visibility": { "action": "setTabVisibility", "arguments": [ "toggle" ], "category": "window", "keySequence": "Ctrl+U" }, "zoom in": { "action": "zoom", "arguments": [ "in" ], "category": "window", "keySequence": "Ctrl++" }, "zoom out": { "action": "zoom", "arguments": [ "out" ], "category": "window", "keySequence": "Ctrl+-" }, "zoom reset": { "action": "zoom", "arguments": [ "reset" ], "category": "window", "keySequence": "Ctrl+0" } }, "misc": { + "askOnTabVisibilityToggle": false, "currentVersion": "2.5.3", "lockNotebookLayout": false }, @@ -193,7 +207,7 @@ in { "external": { "streamlink": { "quality": "", - "options": "--config ${hyper.home}/.config/streamlink/config" + "options": "--config ${hyper.home}.config/streamlink/config" } } } @@ -315,10 +329,9 @@ in { ] } ''; - ".config/streamlink/config".text = '' - twitch-api-header=Authorization=OAuth='$(cat ${config.sops.secrets."streamlink/twitch-oauth".path})' + ".config/streamlink/config".text = /* ini */ '' + twitch-api-header=Authorization=OAuth ${secrets.streamlink.twitch-oauth} player=mpv - player-args='--no-terminal' twitch-low-latency default-stream=best ''; diff --git a/home-modules/discord.nix b/home-modules/discord.nix index a7a98b9..22b66b0 100644 --- a/home-modules/discord.nix +++ b/home-modules/discord.nix @@ -3,8 +3,8 @@ lib.mkIf (hyper.host != "NxACE") { home = { packages = with pkgs; [ - # vesktop - discord + vesktop + # discord ]; # file.".config/vesktop/settings/settings.json".text = let diff --git a/home-modules/email.nix b/home-modules/email.nix index edc8737..a5e2b71 100644 --- a/home-modules/email.nix +++ b/home-modules/email.nix @@ -137,37 +137,37 @@ lib.mkIf (hyper.host != "NxACE") }; }; - hsmw = with secrets.email.hsmw; { - address = "${un}@hs-mittweida.de"; - userName = "${un}@hs-mittweida.de"; - realName = "Lennart J. Kurzweg"; - imap = { - port = 993; - host = "xc.hs-mittweida.de"; - }; - smtp = { - port = 587; - host = "xc.hs-mittweida.de"; - tls.useStartTls = true; - }; - signature = { - text = '' - MatNr: ${mnr} - SemGr: ${semgr} - About Me: https://nx2.site/about-me - Contact: https://nx2.site/contact - GPG: https://nx2.site/gpg - ''; - showSignature = "append"; - }; - thunderbird = { - enable = true; - profiles = [ "nx2" ]; - settings = id: { - "mail.server.server_${id}.fcc_folder" = "imap://${un}%40hs-mittweida.de@xc.hs-mittweida.de/Sent"; - }; - }; - }; + # hsmw = with secrets.email.hsmw; { + # address = "${un}@hs-mittweida.de"; + # userName = "${un}@hs-mittweida.de"; + # realName = "Lennart J. Kurzweg"; + # imap = { + # port = 993; + # host = "xc.hs-mittweida.de"; + # }; + # smtp = { + # port = 587; + # host = "xc.hs-mittweida.de"; + # tls.useStartTls = true; + # }; + # signature = { + # text = '' + # MatNr: ${mnr} + # SemGr: ${semgr} + # About Me: https://nx2.site/about-me + # Contact: https://nx2.site/contact + # GPG: https://nx2.site/gpg + # ''; + # showSignature = "append"; + # }; + # thunderbird = { + # enable = true; + # profiles = [ "nx2" ]; + # settings = id: { + # "mail.server.server_${id}.fcc_folder" = "imap://${un}%40hs-mittweida.de@xc.hs-mittweida.de/Sent"; + # }; + # }; + # }; tuda = with secrets.email.tuda; { address = "${un}@stud.tu-darmstadt.de"; userName = tuid; diff --git a/home-modules/firefox.nix b/home-modules/firefox.nix index bfe0ca2..4b89bd2 100644 --- a/home-modules/firefox.nix +++ b/home-modules/firefox.nix @@ -2,6 +2,9 @@ # browser.tabs.allow_transparent_browser # https://www.reddit.com/r/FirefoxCSS/comments/1dqws4b/firefox_128_will_allow_the_main_browser_content/ { + programs.firefox.profiles."{hyper.user}".settings = { + "widget.use-xdg-desktop-portal.file-picker" = 1; + }; home = { packages = with pkgs; [ firefox @@ -246,17 +249,17 @@ } } - @-moz-document domain(chatgpt.com) { - body, html , .bg-token-sidebar-surface-primary { - background-color: transparent !important; - } - .bg-token-main-surface-primary { - background-color: rgba(0,0,0,1) !important; - backdrop-filter: blur(100px) !important; - border-radius: ${builtins.toString rice.rounding}px !important; - } - } ''; + # @-moz-document domain(chatgpt.com) { + # body, html , .bg-token-sidebar-surface-primary { + # background-color: transparent !important; + # } + # .bg-token-main-surface-primary { + # background-color: rgba(0,0,0,1) !important; + # backdrop-filter: blur(100px) !important; + # border-radius: ${builtins.toString rice.rounding}px !important; + # } + # } }; }; } diff --git a/home-modules/fish.nix b/home-modules/fish.nix index 266c45c..afbf122 100644 --- a/home-modules/fish.nix +++ b/home-modules/fish.nix @@ -80,6 +80,7 @@ gsw = "git switch"; gft = "git fetch"; ns = "nix-shell"; + nd = "nix develop -c fish"; lzd = "lazydocker"; d = "docker"; dcmp = "docker compose"; @@ -101,6 +102,7 @@ rm -f -- "$tmp" end nxfetch + set -e SESSION_FROM_DE end ''; functions = { diff --git a/home-modules/git.nix b/home-modules/git.nix index 1f96907..eda9977 100644 --- a/home-modules/git.nix +++ b/home-modules/git.nix @@ -25,6 +25,7 @@ "https://git.da.dicos.de".password = lib.mkIf (hyper.host =="NxWSL") "Test"; }; url."ssh://git@git.da.dicos.de/".insteadOf = lib.mkIf (hyper.host =="NxWSL") "https://git.da.dicos.de/"; + url."ssh://git@github.com/".insteadOf = "https://github.com/"; pull.rebase = false; # true }; }; diff --git a/home-modules/helix.nix b/home-modules/helix.nix index 7fe001a..a7fbd30 100644 --- a/home-modules/helix.nix +++ b/home-modules/helix.nix @@ -7,10 +7,7 @@ # nixd # specified in nixd.nix gopls delve - python311Packages.python-lsp-server jdt-language-server - ruff - pyright lldb # debugger for llvm stuff yaml-language-server # yaml marksman # markdown @@ -184,7 +181,7 @@ supersede-menu = false; }; inline-diagnostics = { - cursor-line = "hint"; + cursor-line = "warning"; other-lines = "disable"; prefix-len = 1; # max-wrap = set above diff --git a/home-modules/hyprland.nix b/home-modules/hyprland.nix index 3dd6023..d123118 100644 --- a/home-modules/hyprland.nix +++ b/home-modules/hyprland.nix @@ -4,82 +4,31 @@ let transparency = builtins.toString rice.transparency; terminal = "ghostty"; terminal-exec = "ghostty --command="; - monitors = let - docked = false; - in { + monitors = { xps = { - main = if docked then { - name = "DP-5"; - resolution = "1920x1080"; - position = "1920x0"; - scale = "1.0"; - } else { - name = "eDP-1"; - resolution = "1920x1200"; - position = "0x1080"; - scale = "1.0"; - }; - second = if docked then { - name = "DP-6"; - resolution = "1920x1080"; - position = "0x0"; - scale = "1.0"; - } else { - name = "DP-3"; - resolution = "1920x1080"; - position = "0x0"; - scale = "1.0"; - }; + main = { name = "eDP-1"; resolution = "1920x1200"; position = "0x1080"; scale = "1.0"; }; + second = { name = "desc:Sony SONY TV 0x01010101"; resolution = "1920x1080"; position = "0x0"; scale = "1.0"; }; }; north = { - main = { - name = "DP-1"; - # name = "DP-4"; - resolution = "2560x1440"; - position = "1920x150"; - scale = "1.0"; - }; - left = { - # name = "HDMI-A-2"; - name = "HDMI-A-1"; - resolution = "1920x1080"; - position = "0x0"; - scale = "1.0"; - }; - # right = { - # name = "HDMI-A-2"; - # resolution = "1920x1080"; - # position = "4480x360"; - # scale = "1.0"; - # }; + main = { name = "desc:Iiyama North America PL3270Q na"; resolution = "2560x1440"; position = "1920x150"; scale = "1.0"; }; + left = { name = "desc:Philips Consumer Electronics Company 273PLPH AU11423002132"; resolution = "1920x1080"; position = "0x0"; scale = "1.0"; }; + # right = { name = "HDMI-A-2"; resolution = "1920x1080"; position = "4480x360"; scale = "1.0"; }; }; ace = { - main = { - name = "HDMI-A-1"; - resolution = "3840x2160"; - position = "0x0"; - scale = "2.0"; - }; + main = { name = "HDMI-A-1"; resolution = "3840x2160"; position = "0x0"; scale = "2.0"; }; }; }; in { - home.packages = (with pkgs; [ - # hyprland itself is a system package + home.packages = with pkgs; [ hyprland-protocols hyprlock hypridle hyprshot hyprpicker hyprcursor - grim slurp - - # ]) ++ (with pkgs-unstable; [ - - # ]) ++ (with inputs; [ - # hyprswitch.packages.x86_64-linux.default - ]); + ]; wayland.windowManager.hyprland = { @@ -268,7 +217,6 @@ in { "/usr/lib/polkit-kde-authentication-agent-1 " "dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP" "syncthing -no-browser" - "mako" "fcitx5" # "ibus engine xkb:de::deu" "libinput-gestures" @@ -312,7 +260,7 @@ in { # "opacity ${transparency}, class:^(Element)$" "opacity ${transparency}, class:^(lutris)$" "opacity ${transparency}, class:^(neovide)$" - "opacity ${transparency}, class:^(obsidian)$" + # "opacity ${transparency}, class:^(obsidian)$" "opacity ${transparency}, class:^(vesktop)$" "opacity ${transparency}, class:^(VSCodium)$" "opacity ${transparency}, title:^(wlogout)$" @@ -324,11 +272,21 @@ in { "tile, class:^(sent)$" "workspace 100, class:^(gamescope)$" + + "float, title:^(terminal-file-picker)$" + "dimaround, title:^(terminal-file-picker)$" + "center, title:^(terminal-file-picker)$" + "size 80% 80%, title:^(terminal-file-picker)$" ]; layerrule = [ "blur,waybar" + "blur,bar-0" # hyprpanel + "blur,bar-1" + "blur,bar-2" + "blur,bar-3" + "blur,bar-4" "dimaround,rofi" "blur,rofi" "xray,rofi" @@ -349,13 +307,13 @@ in { "SUPER SHIFT, F1, movetoworkspace, 100" # "SUPER, F2," # "SUPER, F3, toggleopaque" - "SUPER, F4, exec, rm /tmp/caldav_event_cache.json && notify-send 'Cleared Saved Event!' ''" - "SUPER, F5, exec, nx_gcal_event force-lookup" - "SUPER SHIFT, F5, exec, nx_gcal_event reauthenticate" + "SUPER, F4, exec, rm /tmp/caldav_event_cache.json && notify-send 'NxCaldavEvent' 'Cleared saved event cache!' ''" + # "SUPER, F5, exec, nx_gcal_event force-lookup" + # "SUPER SHIFT, F5, exec, nx_gcal_event reauthenticate" "SUPER, F6, exec, ${terminal-exec}'htop'" "SUPER, F7, exec, ${terminal-exec}'nmtui'" ''SUPER, F8, exec, find ~/Pictures/wallpapers/* -type f -not -path "~/Pictures/wallpapers/.git/*" | sort -R | head -n 1 | xargs -d '\n' swww img --transition-type wipe --transition-angle 60 --transition-step 120 --transition-fps 120 --transition-duration 2'' - "SUPER, F9, execr, waybar_mode set '󰸉 '" + "SUPER, F9, execr, submap_indicator set '󰸉 '" "SUPER, F9, submap, color" # "SUPER, F10, hyprload,update" "SUPER, F11, exec, waybar" @@ -401,7 +359,7 @@ in { "ALT, TAB, focuscurrentorlast" # "SUPER, TAB, exec, hyprswitch --daemon" "SUPER, Q, killactive" - "SUPER, W, exec, waybar_mode set '󰈹 '" + "SUPER, W, exec, submap_indicator set '󰈹 '" "SUPER, W, submap, browserSM " "SUPER, E, exec, element-desktop" "SUPER, R, exec, rofi -show drun" @@ -424,11 +382,11 @@ in { ########################################################################### ## ROW 3: - "SUPER, A, execr, waybar_mode set ' 󰹑 '" + "SUPER, A, execr, submap_indicator set ' 󰹑 '" "SUPER, A, submap, scrL" "SUPER, S, exec, spotify" - # "SUPER, D, exec, vesktop --disable-gpu-compositing" - "SUPER, D, exec, discord" + "SUPER, D, exec, vesktop" + # "SUPER, D, exec, discord" "SUPER, F, fullscreen" # "SUPER, G," "SUPER, H, movefocus, l" @@ -443,7 +401,7 @@ in { ## ROW 4: # "SUPER, <, overview:toggle" - "SUPER, Y, execr, waybar_mode set '󰹑 '" + "SUPER, Y, execr, submap_indicator set '󰹑 '" "SUPER, Y, submap, scrR" "SUPER, X, exec, pkill wlogout || wlogout --protocol layer-shell -b 3" # "SUPER, C, exec, /home/nx2/scripts/quickconfig/quickconfig.sh " @@ -462,7 +420,7 @@ in { # bindr = SUPER, Ctrl, exec, # ?? # bindr = SUPERALT, Alt_L, exec, - "SUPER, Space, cyclenext" + # "SUPER, Space, cyclenext" "SUPER SHIFT, Space, swapnext" # "SUPER, , " # "SUPER, , " @@ -482,7 +440,7 @@ in { ########################################################################### ## MEGA KEYS: - ", Print, execr, waybar_mode set '󰄀 '" + ", Print, execr, submap_indicator set '󰄀 '" ", Print, submap, screenshot" # "SUPER, Next, resizeactive, 5% 5%" # binde @@ -566,18 +524,18 @@ in { # '8888Y' 'Y8888P' Y8888P' YP YP 88 YP YP '8888Y' extraConfig = let action_simple = { mods ? "", key, cmd }: '' - bind=${mods},${key},execr,waybar_mode unset + bind=${mods},${key},execr,submap_indicator unset bind=${mods},${key},${cmd} bind=${mods},${key},submap,reset ''; extra_workspace = { key, wsnumber }: '' - bind=,${key},execr,waybar_mode unset + bind=,${key},execr,submap_indicator unset bind=,${key},workspace,${wsnumber} bind=,${key},submap,reset - bind=SUPER,${key},execr,waybar_mode unset + bind=SUPER,${key},execr,submap_indicator unset bind=SUPER,${key},workspace,${wsnumber} bind=SUPER,${key},submap,reset - bind=SUPER SHIFT,${key},execr, waybar_mode unset + bind=SUPER SHIFT,${key},execr, submap_indicator unset bind=SUPER SHIFT,${key},movetoworkspace,${wsnumber} bind=SUPER SHIFT,${key},submap,reset ''; @@ -600,35 +558,35 @@ in { ${action_simple { key = "Y"; cmd = "exec,firefox https://youtube.com";}} ${action_simple { key = "P"; cmd = "exec,firefox https://pw.nx2.site";}} ${action_simple { key = "P"; cmd = "exec,firefox https://pw.nx2.site";}} - bind=,Z,exec,waybar_mode set ' ' + bind=,Z,exec,submap_indicator set ' ' bind=,Z,submap,tuda bind=,Z,submap,reset - bind=,Escape,exec,waybar_mode unset + bind=,Escape,exec,submap_indicator unset bind=,Escape,submap,reset submap = reset submap = scrL ${builtins.concatStringsSep "\n" (builtins.map (num: extra_workspace { key = builtins.toString num; wsnumber = "2" + builtins.toString num;}) [1 2 3 4 5 6 7 8 9 0])} - bind = , A, execr, waybar_mode unset + bind = , A, execr, submap_indicator unset bind = , A, submap, reset - bind = , Escape, execr, waybar_mode unset + bind = , Escape, execr, submap_indicator unset bind = , Escape, submap, reset submap = reset submap = scrR ${builtins.concatStringsSep "\n" (builtins.map (num: extra_workspace { key = builtins.toString num; wsnumber = "3" + builtins.toString num;}) [1 2 3 4 5 6 7 8 9 0])} - bind = , Y, execr, waybar_mode unset + bind = , Y, execr, submap_indicator unset bind = , Y, submap, reset - bind = , Escape, execr, waybar_mode unset + bind = , Escape, execr, submap_indicator unset bind = , Escape, submap, reset submap = reset submap = color - ${action_simple { key = "W"; cmd = ''exec,swww query | sed -n 1p | sed -E 's-.*image: (.*)-"\1"-g' | xargs change_colors_json img && notify-send 'change_colors_json img successfull' ''; }} - ${action_simple { key = "M"; cmd = ''exec,change_colors_json manual && notify-send 'change_colors_json manual successfull' ''; }} + ${action_simple { key = "W"; cmd = ''exec,swww query | sed -n 1p | sed -E 's-.*image: (.*)-"\1"-g' | xargs change_colors_json img && notify-send 'NxTheme' 'change_colors_json img successfull' ''; }} + ${action_simple { key = "M"; cmd = ''exec,change_colors_json manual && notify-send 'NxTheme' 'change_colors_json manual successfull' ''; }} ${action_simple { key = "D"; cmd = ''exec,firefox ${hyper.home}/.config/color-pallete.html''; }} - bind = , Escape, execr, waybar_mode unset + bind = , Escape, execr, submap_indicator unset bind = , Escape, submap, reset submap = reset @@ -636,7 +594,7 @@ in { ${action_simple { key = "T"; cmd = ''exec,firefox https://www.tucan.tu-darmstadt.de/''; }} ${action_simple { key = "M"; cmd = ''exec,firefox https://moodle.tu-darmstadt.de/''; }} ${action_simple { key = "I"; cmd = ''exec,firefox https://moodle.informatik.tu-darmstadt.de/''; }} - bind = , Escape, execr, waybar_mode unset + bind = , Escape, execr, submap_indicator unset bind = , Escape, submap, reset submap = reset @@ -644,7 +602,7 @@ in { ${action_simple { key = "W"; cmd = ''exec,hyprshot -m window''; }} ${action_simple { key = "M"; cmd = ''exec,hyprshot -m output''; }} ${action_simple { key = "R"; cmd = ''exec,hyprshot -m region''; }} - bind = , Escape, execr, waybar_mode unset + bind = , Escape, execr, submap_indicator unset bind = , Escape, submap, reset submap = reset @@ -724,7 +682,7 @@ in { valign = bottom } ''; - }; + }; } diff --git a/home-modules/mako.nix b/home-modules/mako.nix index f7eb6d0..6ead07d 100644 --- a/home-modules/mako.nix +++ b/home-modules/mako.nix @@ -1,16 +1,16 @@ -{ pkgs, ... }@all: with all; +{ config, pkgs, ... }@all: with all; { home.packages = with pkgs; [ libnotify ]; services.mako = with rice; { - enable = true; + enable = if config.programs.hyprpanel.enable then false else true; settings = { - defaultTimeout = 10000; # in ms - backgroundColor = color.background; - textColor = color.foreground; - borderColor = color.border; - borderSize = border-width; + default-timeout = 5000; # in ms + background-color = color.background; + text-color = color.foreground; font = font.code.name; - borderRadius = rounding; + border-size = border-width; + border-radius = rounding; + border-color = color.border; anchor = "top-right"; margin = builtins.toString (gap-size * 2) ; }; diff --git a/home-modules/opencode.nix b/home-modules/opencode.nix new file mode 100644 index 0000000..3a57c32 --- /dev/null +++ b/home-modules/opencode.nix @@ -0,0 +1,30 @@ +{ pkgs, ... }@all: with all; { + home = { + packages = with pkgs; [ + latest.opencode + ]; + file.".config/opencode/opencode.json".text = let + model = "qwen2.5-coder:7b"; + in builtins.toJSON { + "$schema" = "https://opencode.ai/config.json"; + model = "ollama/${model}"; + theme = "matrix"; + provider = { + ollama = { + apiKey = "KEY"; + disabled = false; + npm = "@ai-sdk/openai-compatible"; + options = { + baseURL = "http://localhost:11434/v1"; + }; + models = { + "${model}" = { + tools = true; + }; + }; + }; + }; + }; + }; +} + diff --git a/home-modules/pkgs-list/shell.nix b/home-modules/pkgs-list/shell.nix index 2e3bb5b..90a8f6b 100644 --- a/home-modules/pkgs-list/shell.nix +++ b/home-modules/pkgs-list/shell.nix @@ -10,6 +10,7 @@ ffmpeg figlet fzf + gh glib glow gnumake @@ -21,6 +22,7 @@ mediainfo mpv neofetch + pastel pdfgrep pipes pv diff --git a/home-modules/programming/python.nix b/home-modules/programming/python.nix index 0254d79..0fd3677 100644 --- a/home-modules/programming/python.nix +++ b/home-modules/programming/python.nix @@ -3,16 +3,18 @@ home = let python-with-packages = pkgs.python3.withPackages (pp: with pp; [ ipython - pipdeptree requests - google google-api-python-client google-auth-httplib2 google-auth-oauthlib debugpy black ]); in { packages = [ python-with-packages - ]; + ] ++ (with pkgs; [ + python311Packages.python-lsp-server + ruff + pyright + ]); sessionVariables = { PYTHONPATH = "${python-with-packages}/${python-with-packages.sitePackages}"; }; diff --git a/home-modules/typst.nix b/home-modules/typst.nix new file mode 100644 index 0000000..dd13a65 --- /dev/null +++ b/home-modules/typst.nix @@ -0,0 +1,8 @@ +{ pkgs, ... }@all: with all; +lib.mkIf (hyper.host != "NxACE") +{ + home.packages = with pkgs; [ + typst + tinymist + ]; +} diff --git a/home-modules/waybar.nix b/home-modules/waybar.nix deleted file mode 100644 index 6b95b1d..0000000 --- a/home-modules/waybar.nix +++ /dev/null @@ -1,371 +0,0 @@ -{ pkgs, hyper, ... }@all: with all; let - sep = " "; -in { - sops.secrets = { - "nx2site/radicale/password" = { }; - }; - home.packages = with pkgs; [ - (writeShellApplication { name = "waybar_mode"; text = /*bash*/ '' - print_help() { - echo "Usage: waybar_mode {set |unset}" - } - if [ $# -lt 1 ]; then - print_help; exit 1; - fi - case "$1" in - set) - # Check if there is a second argument for the 'set' operation - if [ $# -eq 2 ]; then - echo "$2" > /tmp/waybar-mode - pkill -RTMIN+8 waybar - else - echo "Error: 'set' operation requires exactly one string argument." - print_help - exit 1 - fi - ;; - unset) - echo "" > /tmp/waybar-mode - pkill -RTMIN+8 waybar - ;; - *) - echo "Error: Unknown command '$1'" - print_help - exit 1 - ;; - esac - exit 0 - '';}) - (writeShellApplication { name = "cclock"; text = /*bash*/ '' - ord=$(date +"%e" | awk '{printf("%d%s\n", $1, ($1==11||$1==12||$1==13)?"th":((($1%10)==1)?"st":((($1%10)==2)?"nd":((($1%10)==3)?"rd":"th"))))}') - if [ $# -eq 0 ]; then - echo "󰃮${sep}$(date +'%A the')" "$ord" "of" "$(date +'%B')" " ${sep}$(date +'%R')" - elif [ "$1" = "--no-icons" ]; then - echo "$(date +'%A the')" "$ord" "of" "$(date +'%B')" "$(date +'%R')" - fi - '';}) - (writers.writePython3Bin "caldav_event" { - libraries = with pkgs.python3Packages; [ caldav ics pytz ]; - flakeIgnore = [ "E302" "E305""E501" "E261" ]; - } /* python */ '' -import os -import json -from caldav import DAVClient -from datetime import datetime, timezone -from ics import Calendar -from pytz import UTC - -def get_password(password_file): - with open(password_file, "r") as file: - return file.read().strip() - -def datetime_converter(obj): - if isinstance(obj, datetime): - return obj.isoformat() - return obj - -def datetime_parser(dct): - for key, value in dct.items(): - if isinstance(value, str): - try: - dct[key] = datetime.fromisoformat(value) - except ValueError: - pass - return dct - -def load_cache(cache_file): - if os.path.exists(cache_file): - with open(cache_file, "r") as file: - return json.load(file, object_hook=datetime_parser) - return None - -def save_cache(cache_file, data): - with open(cache_file, "w") as file: - json.dump(data, file, default=datetime_converter) - - -def get_ongoing_or_next_event(url, username, password): - now = datetime.now(timezone.utc) - - try: - client = DAVClient(url, username=username, password=password) - principal = client.principal() - calendars = principal.calendars() - - next_event_dict = { - 'event_name': "fake", - 'event_begin': datetime(9000, 1, 1, tzinfo=UTC), # in the year 9000 - 'event_end': datetime(9000, 1, 1, 8, tzinfo=UTC), - } - - for calendar in calendars: - for event in calendar.events(): - calendar_parsed = Calendar(event.data) - for ics_event in calendar_parsed.events: - event_dict = {} - event_dict['event_name'] = ics_event.name or "(No Title)" - event_dict['event_begin'] = ics_event.begin.astimezone(timezone.utc) - event_dict['event_end'] = ics_event.end.astimezone(timezone.utc) - - if event_dict['event_begin'] <= now and now <= event_dict['event_end']: - return event_dict - elif event_dict['event_begin'] >= now and next_event_dict['event_begin'] > event_dict['event_begin']: - next_event_dict = event_dict - return next_event_dict - - except Exception as e: - print(f"Error accessing {url}: {e}") - return None - -if __name__ == "__main__": - password_file = "/home/nx2/.config/sops-nix/secrets/nx2site/radicale/password" # Path to password file - cache_file = "/tmp/caldav_event_cache.json" # Path to cache file - url = "https://dav.${hyper.domain}/" - username = "${hyper.user}" - password = get_password(password_file) - - event_dict = load_cache(cache_file) - now = datetime.now(timezone.utc).timestamp() - - if event_dict is None or event_dict['event_begin'].timestamp() <= now and now < event_dict['event_end'].timestamp(): - event_dict = get_ongoing_or_next_event(url, username, password) - if event_dict is None: - print("No upcoming events found.") - exit(0) - cache_data = { - "event_name": event_dict['event_name'] if event_dict is not None else None, - "event_begin": event_dict['event_begin'] if event_dict is not None else None, - "event_end": event_dict['event_end'] if event_dict is not None else None - } - save_cache(cache_file, cache_data) - - if event_dict: - event_start = event_dict['event_begin'].timestamp() - event_end = event_dict['event_end'].timestamp() - - if event_start <= now <= event_end: - time_remaining = event_end - now - hours, rem = divmod(int(time_remaining), 3600) - minutes, _ = divmod(rem, 60) - print(f"{event_dict['event_name']} ends in {hours} hour{'s ' if hours != 1 else ' '}and {minutes} minute{'s ' if minutes != 1 else ' '}") - else: - time_until_start = event_start - now - hours, rem = divmod(int(time_until_start), 3600) - minutes, _ = divmod(rem, 60) - print(f"{event_dict['event_name']} starts in {hours} hour{'s ' if hours != 1 else ' '}and {minutes} minute{'s ' if minutes != 1 else ' '}") - else: - print("No upcoming events found.") -'') - ]; - - programs.waybar = { - enable = true; - package = pkgs.waybar; - settings = { - bar = { - # height = 20; - layer = "top"; - position = "bottom"; - margin-top = 0; - # margin-left = rice.gap-size; - # margin-bottom = rice.gap-size; - # margin-right = rice.gap-size; - margin-left = 0; - margin-bottom = 0; - margin-right = 0; - spacing = 10; - fixed-center = true; - modules-left = [ - # "cpu" - # "memory" - "wireplumber" - "backlight" - "battery" - "network" - "hyprland/window" - ]; - modules-center = [ - "hyprland/workspaces" - ]; - modules-right = [ - "custom/mode" - # "custom/caldav_event" - "custom/cclock" - "tray" - ]; - "hyprland/workspaces" = { - on-click = "activate"; - format = "{name}"; - all-outputs = false; - active-only = false; - }; - "hyprland/window" = { - # format = "${sep}{}"; - format = "{}"; - separate-outputs = true; - }; - "custom/cclock" = { - exec = "cclock"; - restart-interval = 60; - }; - "custom/caldav_event" = { - format = "󰃰${sep}{}"; - exec = "caldav_event"; - restart-interval = 60; - max-width = 60; - }; - "custom/mode" = { - exec = "cat /tmp/waybar-mode"; - interval = "once"; - signal = 8; - }; - - cpu = { - interval = 1; - format = "󰍛${sep}{}%"; - max-length = 10; - }; - memory = { - interval = 5; - format = "${sep}{avail:.0f}G free"; - }; - battery = { - interval = 60; - tooltip = false; - format = "{icon}${sep}{capacity}%"; - states = { - warning = 15; - critical = 5; - }; - format-icons = [ - " " - " " - " " - " " - " " - ]; - format-charging = "{icon}${sep}+{capacity}%"; - format-plugged = "{icon}${sep}P{capacity}%"; - format-full = "{icon}${sep}F{capacity}%"; - }; - backlight = { - device = "eDP-1"; - format = "{icon}${sep}{percent}%"; - format-icons = [ - "" - "" - "" - "" - "" - "" - "" - "" - "" - ]; - }; - network = { - format-wifi = "${sep}{essid}"; - format-ethernet = "󰈀${sep}Wired"; - format-disconnected = "󰌙${sep}Disconnected"; - }; - wireplumber = { - format = "󰕾${sep}{volume}%"; - format-muted = "󰝟${sep}--%"; - }; - }; - }; - style = with rice.color; let f = rice.lib.hex-to-rgb-comma-string; in '' - * { - font-family: ${rice.font.code.name}; - font-size: 1em; - min-height: 0px; - margin: 0px; - padding: 0px; - } - - window#waybar { - background-color: rgba(${f background},${builtins.toString rice.transparency}); - transition-duration: 5s; - transition-property: background-color; - /* border: ${builtins.toString rice.border-width}px solid rgb(${f border}); */ - /* margin: ${builtins.toString rice.gap-size}px; */ - /* border-radius: ${builtins.toString rice.rounding}px; */ - } - - #clock, - #custom-cclock, - #custom-mode, - #custom-caldav-event, - #battery, - #cpu, - #tray, - #disk, - #backlight, - #network, - #wireplumber, - #memory, - #window, - #workspaces { - padding: 0px 3px; - margin-top: 0.3em; - border-radius: ${builtins.toString rice.rounding}px; - color: rgb(${f accent.bright}); - } - - #workspaces { - font-family: ${rice.font.code.name}; - } - - #workspaces button { - color: rgb(${f accent.base}); - padding-left: 15px; - padding-right: 15px; - border-radius: ${builtins.toString rice.rounding}px; - } - - #workspaces button.active { - color: rgb(${f background}); - background-color: rgb(${f accent.base}); - } - - #workspaces button:hover { - color: rgb(${f tertiary.bright}); - } - - #workspaces button.urgent { - background-color: rgba(${f magenta.base},${builtins.toString rice.transparency}); - } - - #custom-mode { - color: rgb(${f red.base}); - } - - #window, #custom-caldav_event { - font-family: ${rice.font.base.name}, ${rice.font.code.name}; - color: rgb(${f tertiary.bright}); - } - - #wireplumber.muted { - color: rgb(${f tertiary.bright}); - } - #wireplumber { - padding-left: 10px; - } - - #battery.warning:not(.charging) { - color: rgb(${f green.base});; - } - - #battery.charging { - color: rgb(${f green.base}); - } - - #battery.critical { - background: rgb(${f negative.base}); - color: rgb(${f foreground}); - } - ''; - - #battery.critical:not(.charging) { - }; -} diff --git a/home-modules/yazi.nix b/home-modules/yazi.nix index ffd8872..74af1fa 100644 --- a/home-modules/yazi.nix +++ b/home-modules/yazi.nix @@ -10,7 +10,27 @@ package = inputs.yazi.packages.${hyper.system}.default; enableFishIntegration = true; shellWrapperName = "ya"; - # plugins = with inputs.yazi-plugins.packages.${hyper.system}; { }; + initLua = /* lua */ '' + require("zoxide"):setup { + update_db = true, + } + Status:children_add(function() + local h = cx.active.current.hovered + if not h or ya.target_family() ~= "unix" then + return "" + end + + return ui.Line { + ui.Span(ya.user_name(h.cha.uid) or tostring(h.cha.uid)):fg("magenta"), + ":", + ui.Span(ya.group_name(h.cha.gid) or tostring(h.cha.gid)):fg("magenta"), + " ", + } + end, 500, Status.RIGHT) + ''; + plugins = with pkgs; { + inherit glow git; + }; # initLua = /* lua */ '' ''; keymap = { mgr.keymap = [ @@ -30,8 +50,8 @@ { on = ""; run = "arrow 100%"; desc = "Move cursor down one page"; } { on = ""; run = "arrow -100%"; desc = "Move cursor up one page"; } { on = ""; run = "arrow 100%"; desc = "Move cursor down one page"; } - { on = [ "g" "g" ]; run = "arrow down"; desc = "Move cursor to the top"; } - { on = [ "g" "e" ]; run = "arrow up"; desc = "Move cursor to the end"; } + { on = [ "g" "g" ]; run = "arrow top"; desc = "Move cursor to the top"; } + { on = [ "g" "e" ]; run = "arrow bot"; desc = "Move cursor to the end"; } { on = [ "g" "h" ]; run = "cd ~"; desc = "Go to the home directory"; } { on = [ "g" "n" ]; run = "cd ~/nix-dots"; desc = "Go to the Nix-Dotfiles directory"; } (pkgs.lib.mkIf (hyper.host == "NxACE") { on = [ "g" "s" ]; run = "cd /var/lib/hugo/nx2site"; desc = "Go to the Hugo Nx2.Site directory"; }) @@ -45,6 +65,7 @@ { on = [ "g" "d" ]; run = "cd ~/Downloads"; desc = "Go to the downloads directory"; } { on = [ "g" "D" ]; run = "cd ~/Documents"; desc = "Go to the Documents directory"; } { on = [ "g" "r" ]; run = "cd /"; desc = "Go to the root (/) directory"; } + { on = [ "g" "p" ]; run = "cd ~/projects"; desc = "Go to the projects directory"; } { on = [ "g" "/" ]; run = "cd /"; desc = "Go to the root (/) directory"; } { on = [ "g" "" ]; run = "cd --interactive"; desc = "Go to a directory interactively"; } # Navigation @@ -69,6 +90,8 @@ { on = "O"; run = "open --interactive"; desc = "Open selected files interactively"; } { on = ""; run = "open"; desc = "Open selected files"; } { on = ""; run = "open --interactive"; desc = "Open selected files interactively"; } + { on = "y"; run = [ ''shell -- for path in "$@"; do echo "file://$path"; done | wl-copy -t text/uri-list'' + "yank" ]; desc = "Yank selected files (copy)"; } { on = "y"; run = "yank"; desc = "Yank selected files (copy)"; } { on = "x"; run = "yank --cut"; desc = "Yank selected files (cut)"; } { on = "p"; run = "paste"; desc = "Paste yanked "; } @@ -373,4 +396,74 @@ }; }; }; + xdg = { + # # https://github.com/hunkyburrito/xdg-desktop-portal-termfilechooser/pull/44 + configFile = let + wrapper = pkgs.writeShellApplication { name = "yazi-wrapper.sh"; text = /*bash*/ '' + set -ex + + multiple="$1" + directory="$2" + save="$3" + path="$4" + out="$5" + + cmd="yazi" + termcmd="''${TERMCMD:-kitty --title 'termfilechooser'}" + + if [ "$save" = "1" ]; then + # save a file + set -- --chooser-file="$out" "$path" + elif [ "$directory" = "1" ]; then + # upload files from a directory + set -- --chooser-file="$out" --cwd-file="$out" "$path" + elif [ "$multiple" = "1" ]; then + # upload multiple files + set -- --chooser-file="$out" "$path" + else + # upload only 1 file + set -- --chooser-file="$out" "$path" + fi + + command="$termcmd $cmd" + for arg in "$@"; do + # escape double quotes + escaped=$(printf "%s" "$arg" | sed -E 's/[\"\(\)\{\}\|]//g') + # escape spaces + command="$command \"$escaped\"" + done + + sh -c "$command" + '';}; + in { + "xdg-desktop-portal-termfilechooser/config".text = '' + [filechooser] + cmd=${wrapper}/bin/yazi-wrapper.sh + env=TERMCMD=ghostty --title="terminal-file-picker -e" + default_dir=$HOME + open_mode=suggested + save_mode=last + ''; + # "xdg-desktop-portal-termfilechooser/config".text = '' + # [filechooser] + # cmd=${pkgs.latest.xdg-desktop-portal-termfilechooser}/share/xdg-desktop-portal-termfilechooser/yazi-wrapper.sh + # env=TERMCMD=ghostty --title="terminal-file-picker -e" + # default_dir=$HOME + # open_mode=suggested + # save_mode=last + # ''; + }; + portal = { + enable = true; + extraPortals = [ pkgs.latest.xdg-desktop-portal-termfilechooser ]; + config = { + common = { + "org.freedesktop.impl.portal.FileChooser" = "termfilechooser"; + }; + }; + }; + }; + home.sessionVariables = { + GTK_USE_PORTAL = "1"; + }; } diff --git a/home.nix b/home.nix index aabcd9c..708878c 100644 --- a/home.nix +++ b/home.nix @@ -1,6 +1,7 @@ { pkgs, ... }@all: with all; { imports = [ ./home-modules/auto-mount.nix + ./home-modules/bar.nix ./home-modules/bash.nix ./home-modules/bitwarden.nix ./home-modules/calendar.nix @@ -10,8 +11,8 @@ ./home-modules/direnv.nix ./home-modules/discord.nix ./home-modules/email.nix - ./home-modules/firefox.nix ./home-modules/figlet.nix + ./home-modules/firefox.nix ./home-modules/fish.nix ./home-modules/games.nix ./home-modules/gestures.nix @@ -34,6 +35,7 @@ ./home-modules/obs.nix ./home-modules/office.nix ./home-modules/ollama.nix + ./home-modules/opencode.nix ./home-modules/pandoc.nix ./home-modules/pkgs-list/desktop.nix ./home-modules/pkgs-list/programs.nix @@ -53,11 +55,11 @@ ./home-modules/ssh.nix ./home-modules/starship.nix ./home-modules/tts.nix + ./home-modules/typst.nix ./home-modules/vale.nix ./home-modules/virt-manager.nix ./home-modules/vscode.nix ./home-modules/wallpaper-to-colors.nix - ./home-modules/waybar.nix ./home-modules/wlogout.nix ./home-modules/xdg.nix ./home-modules/yazi.nix diff --git a/nixos-wsl.nix b/nixos-wsl.nix index b0a9ade..dc484cd 100644 --- a/nixos-wsl.nix +++ b/nixos-wsl.nix @@ -18,5 +18,18 @@ defaultUser = hyper.user; enable = true; }; - nix.settings.experimental-features = [ "nix-command" "flakes" ]; + nix = { + settings = { + experimental-features = [ "nix-command" "flakes" ]; + substitute = true; + substituters = [ + "https://yazi.cachix.org" + ]; + trusted-public-keys = [ + "yazi.cachix.org-1:Dcdz63NZKfvUCbDGngQDAZq6kOroIrFoyO064uvLh8k=" + ]; + }; + }; + + nixpkgs.hostPlatform = hyper.system; } diff --git a/system-modules/hardware-configuration.nix b/system-modules/hardware-configuration.nix index 57a9a4a..3772a32 100644 --- a/system-modules/hardware-configuration.nix +++ b/system-modules/hardware-configuration.nix @@ -49,4 +49,6 @@ libvdpau-va-gl intel-media-driver ] else []; + + services.upower.enable = true; } diff --git a/system-modules/health_reminder.nix b/system-modules/health_reminder.nix index 68772f4..a91228f 100644 --- a/system-modules/health_reminder.nix +++ b/system-modules/health_reminder.nix @@ -5,8 +5,8 @@ lib.mkIf (hyper.host != "NxACE") enable = true; wantedBy = [ "timers.target" ]; timerConfig = { - OnBootSec = "5m"; - OnUnitActiveSec = "5m"; + OnBootSec = "30m"; + OnUnitActiveSec = "10m"; Unit = "health_reminder.service"; }; }; @@ -34,11 +34,11 @@ lib.mkIf (hyper.host != "NxACE") return action actions = [ - Action(action="look away for %o Seconds!", likelihood=300, options=["10", "15"]), - Action(action="Posture Check!", likelihood=300), + Action(action="look away for %o Seconds!", likelihood=30, options=["10", "15"]), + Action(action="Posture Check!", likelihood=200), Action(action="Strech your upper body!", likelihood=20), Action(action="Strech your core!", likelihood=10), - Action(action="Strech your legs!", likelihood=10), + Action(action="Strech your legs!", likelihood=20), Action(action="Strech your arms/hands!", likelihood=10), Action(action="Make Tea!", likelihood=5), Action(action="说现在中文的时间!", likelihood=2),