From 0c8fa3a2a270747f3dbb54fe8792f3f0aec997e3 Mon Sep 17 00:00:00 2001 From: Ryan Schanzenbacher Date: Mon, 3 Aug 2026 01:22:44 -0400 Subject: Initial commit: combined darwin + guix-linux home-manager flake Supersedes nix-dotfiles (darwin) and guix-dotfiles' ad-hoc nix-home-manager flake (linux). See README.md/MIGRATION.md. --- users/ryan/linux/alacritty/alacritty.yml | 15 + users/ryan/linux/firefox-nightly/default.nix | 193 ++++++++++++ users/ryan/linux/firefox-nightly/policies.nix | 130 ++++++++ users/ryan/linux/foot/foot.ini | 7 + users/ryan/linux/hypr/family_guy.mp4 | Bin 0 -> 20881473 bytes users/ryan/linux/hypr/hypridle.conf | 16 + users/ryan/linux/hypr/hyprland.conf | 336 +++++++++++++++++++++ users/ryan/linux/hypr/hyprlock.conf | 57 ++++ users/ryan/linux/hypr/kanshi.conf | 22 ++ users/ryan/linux/hypr/monitors.conf | 2 + users/ryan/linux/hypr/pyprland.toml | 5 + users/ryan/linux/hypr/scripts/autostart.sh | 40 +++ users/ryan/linux/hypr/scripts/perf_mode.sh | 14 + users/ryan/linux/hypr/subwaysurfer.webm | Bin 0 -> 77979199 bytes users/ryan/linux/mailvelope/gpgmejson.json | 7 + users/ryan/linux/mailvelope/start.sh | 4 + users/ryan/linux/mpv/scripts/easycrop.lua | 254 ++++++++++++++++ users/ryan/linux/pulseaudio/client.conf | 1 + users/ryan/linux/spotify-player/app.toml | 34 +++ users/ryan/linux/tridactyl/native_main | Bin 0 -> 514233 bytes users/ryan/linux/tridactyl/tridactyl.json | 7 + users/ryan/linux/waybar/config | 167 ++++++++++ users/ryan/linux/waybar/modules/check-for-music.sh | 7 + users/ryan/linux/waybar/modules/spotify.sh | 19 ++ users/ryan/linux/waybar/modules/storage.sh | 25 ++ users/ryan/linux/waybar/modules/weather.sh | 77 +++++ users/ryan/linux/waybar/style.css | 77 +++++ users/ryan/linux/wpaperd/config.toml | 4 + 28 files changed, 1520 insertions(+) create mode 100644 users/ryan/linux/alacritty/alacritty.yml create mode 100644 users/ryan/linux/firefox-nightly/default.nix create mode 100644 users/ryan/linux/firefox-nightly/policies.nix create mode 100644 users/ryan/linux/foot/foot.ini create mode 100644 users/ryan/linux/hypr/family_guy.mp4 create mode 100644 users/ryan/linux/hypr/hypridle.conf create mode 100644 users/ryan/linux/hypr/hyprland.conf create mode 100644 users/ryan/linux/hypr/hyprlock.conf create mode 100644 users/ryan/linux/hypr/kanshi.conf create mode 100644 users/ryan/linux/hypr/monitors.conf create mode 100644 users/ryan/linux/hypr/pyprland.toml create mode 100755 users/ryan/linux/hypr/scripts/autostart.sh create mode 100755 users/ryan/linux/hypr/scripts/perf_mode.sh create mode 100644 users/ryan/linux/hypr/subwaysurfer.webm create mode 100644 users/ryan/linux/mailvelope/gpgmejson.json create mode 100755 users/ryan/linux/mailvelope/start.sh create mode 100644 users/ryan/linux/mpv/scripts/easycrop.lua create mode 100644 users/ryan/linux/pulseaudio/client.conf create mode 100644 users/ryan/linux/spotify-player/app.toml create mode 100755 users/ryan/linux/tridactyl/native_main create mode 100644 users/ryan/linux/tridactyl/tridactyl.json create mode 100644 users/ryan/linux/waybar/config create mode 100755 users/ryan/linux/waybar/modules/check-for-music.sh create mode 100755 users/ryan/linux/waybar/modules/spotify.sh create mode 100755 users/ryan/linux/waybar/modules/storage.sh create mode 100755 users/ryan/linux/waybar/modules/weather.sh create mode 100644 users/ryan/linux/waybar/style.css create mode 100644 users/ryan/linux/wpaperd/config.toml (limited to 'users/ryan/linux') diff --git a/users/ryan/linux/alacritty/alacritty.yml b/users/ryan/linux/alacritty/alacritty.yml new file mode 100644 index 0000000..4fbd991 --- /dev/null +++ b/users/ryan/linux/alacritty/alacritty.yml @@ -0,0 +1,15 @@ +window: + opacity: 0.70 +font: + size: 15 + normal: + family: "Monofur Nerd Font Mono" + style: Regular + + bold: + family: "Monofur Nerd Font Mono" + style: Bold + + italic: + family: "Monofur Nerd Font Mono" + style: Italic diff --git a/users/ryan/linux/firefox-nightly/default.nix b/users/ryan/linux/firefox-nightly/default.nix new file mode 100644 index 0000000..5c3fce7 --- /dev/null +++ b/users/ryan/linux/firefox-nightly/default.nix @@ -0,0 +1,193 @@ +{ config, pkgs, ... }: + +{ + programs.firefox = { + enable = true; + policies = import ./policies.nix; + #package = zen-browser.packages.${pkgs.system}.default.unwrapped; + + profiles.${config.home.username} = { + name = "${config.home.username}"; + isDefault = true; + containersForce = true; + containers = { + rit = { + name = "RIT"; + color = "orange"; + icon = "dollar"; + id = 1; + }; + ritwork = { + name = "RIT Work"; + color = "green"; + icon = "briefcase"; + id = 2; + }; + other = { + name = "Other"; + color = "blue"; + icon = "fingerprint"; + id = 3; + }; + }; + search = { + force = true; + default = "ddg"; + order = ["ddg" "google"]; + engines = { + "Nix Packages" = { + urls = [ + { + template = "https://search.nixos.org/packages"; + params = [ + { + name = "type"; + value = "packages"; + } + { + name = "channel"; + value = "unstable"; + } + { + name = "query"; + value = "{searchTerms}"; + } + ]; + } + ]; + icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; + definedAliases = ["@np"]; + }; + }; + }; + userChrome = " +#main-window .toolbar-items { +overflow: hidden; +transition: height 0.3s 0.3s !important; +} +/* Default state: Set initial height to enable animation */ +#main-window .toolbar-items { height: 3em !important; } +#main-window .titlebar-button { height: 3em !important; } +#main-window[uidensity=\"touch\"] .toolbar-items { height: 3.35em !important; } +#main-window[uidensity=\"compact\"] .toolbar-items { height: 2.7em !important; } +/* Hidden state: Hide native tabs strip */ +#main-window[titlepreface*=\"\"] .toolbar-items { height: 0 !important; } +#main-window[titlepreface*=\"\"] .titlebar-button { height: 0 !important; } +/* Hidden state: Fix z-index of active pinned tabs */ +#main-window[titlepreface*=\"\"] #tabbrowser-tabs { z-index: 0 !important; } + +/* Sidebery expand on mouse-over and hide otherwise */ + +/* Source file https://github.com/MrOtherGuy/firefox-csshacks/tree/master/chrome/autohide_sidebar.css made available under Mozilla Public License v. 2.0 +See the above repository for updates as well as full license text. */ + +/* Show sidebar only when the cursor is over it */ +/* The border controlling sidebar width will be removed so you'll need to modify these values to change width */ + +#sidebar-box{ +--uc-sidebar-width: 60px; +--uc-sidebar-hover-width: 230px; +--uc-autohide-sidebar-delay: 200ms; /* Wait 0.2s before hiding sidebar */ +--uc-autohide-transition-duration: 115ms; +--uc-autohide-transition-type: linear; +--browser-area-z-index-sidebar: 3; +position: relative; + min-width: var(--uc-sidebar-width) !important; +width: var(--uc-sidebar-width) !important; + max-width: var(--uc-sidebar-width) !important; + z-index: var(--browser-area-z-index-sidebar,3); +} +#sidebar-box[positionend]{ direction: rtl } +#sidebar-box[positionend] > *{ direction: ltr } + +#sidebar-box[positionend]:-moz-locale-dir(rtl){ direction: ltr } +#sidebar-box[positionend]:-moz-locale-dir(rtl) > *{ direction: rtl } + +#main-window[sizemode=\"fullscreen\"] #sidebar-box{ --uc-sidebar-width: 1px; } + +#sidebar-splitter{ display: none } + +#sidebar-header{ +overflow: hidden; +color: var(--chrome-color, inherit) !important; + padding-inline: 0 !important; +} + +#sidebar-header::before, +#sidebar-header::after{ +content: \"\"; +display: flex; + padding-left: 8px; +} + +#sidebar-header, +#sidebar{ +transition: min-width var(--uc-autohide-transition-duration) var(--uc-autohide-transition-type) var(--uc-autohide-sidebar-delay) !important; + min-width: var(--uc-sidebar-width) !important; + will-change: min-width; +} +#sidebar-box:hover > #sidebar-header, +#sidebar-box:hover > #sidebar{ +min-width: var(--uc-sidebar-hover-width) !important; +transition-delay: 0ms !important; +} + +.sidebar-panel{ +background-color: transparent !important; +color: var(--newtab-text-primary-color) !important; +} + +.sidebar-panel #search-box{ +-moz-appearance: none !important; +background-color: rgba(249,249,250,0.1) !important; +color: inherit !important; +} + +/* Add sidebar divider and give it background */ + +#sidebar, +#sidebar-header{ +background-color: inherit !important; +border-inline: 1px solid rgb(80,80,80); +border-inline-width: 0px 1px; +} + +#sidebar-box:not([positionend]) > :-moz-locale-dir(rtl), +#sidebar-box[positionend] > *{ +border-inline-width: 1px 0px; +} + +/* Move statuspanel to the other side when sidebar is hovered so it doesn't get covered by sidebar */ + +#sidebar-box:not([positionend]):hover ~ #appcontent #statuspanel{ +inset-inline: auto 0px !important; +} +#sidebar-box:not([positionend]):hover ~ #appcontent #statuspanel-label{ +margin-inline: 0px !important; +border-left-style: solid !important; +} + +/* Remove the tabs label and move the Sidebary icon to the center of the box */ +#sidebar-box:hover [id=\"sidebar-icon\"] { +transform: translateX(0px) !important; + transition-delay: 0ms !important; +} + +#sidebar-box [id=\"sidebar-icon\"] { +transform: translateX(9px); +transition: transform var(--uc-autohide-transition-duration) var(--uc-autohide-transition-type) var(--uc-autohide-sidebar-delay) !important; +} + +#sidebar-box [id=\"sidebar-title\"] { +visibility: hidden !important; +transition: visibility var(--uc-autohide-transition-duration) var(--uc-autohide-transition-type) var(--uc-autohide-sidebar-delay) !important; +} + +#sidebar-box:hover [id=\"sidebar-title\"] { +visibility: visible !important; + transition-delay: 0ms !important; +} +"; +}; +}; +} diff --git a/users/ryan/linux/firefox-nightly/policies.nix b/users/ryan/linux/firefox-nightly/policies.nix new file mode 100644 index 0000000..136b8b9 --- /dev/null +++ b/users/ryan/linux/firefox-nightly/policies.nix @@ -0,0 +1,130 @@ +let + lock-false = { + Value = false; + Status = "locked"; + }; + lock-true = { + Value = true; + Status = "locked"; + }; +in +{ + +EnableTrackingProtection = { + Value = true; + Locked = true; + Cryptomining = true; + Fingerprinting = true; + EmailTracking = true; +}; +UserMessaging = { + WhatsNew = false; + ExtensionRecommendations = false; + FeatureRecommendations = false; + UrlbarInterventions = false; + SkipOnboarding = true; + MoreFromMozilla = false; + Labs = false; + Locked = true; +}; +DisableAppUpdate = true; +DisableAccounts = true; +DisableFirefoxAccounts = true; +DisableFirefoxStudies = true; +DisablePocket = true; +DisableTelemetry = true; +AutofillAddressEnabled = false; +AutofillCreditCardEnabled = false; +DisableMasterPasswordCreation = true; +PasswordManagerEnabled = false; +PrimaryPassword = false; +OfferToSaveLogins = false; +NoDefaultBookmarks = true; +OverrideFirstRunPage = ""; +OverridePostUpdatePage = ""; +FirefoxHome = { + Search = true; + TopSites = true; + SponsoredTopSites = false; + Highlights = false; + Pocket = false; + SponsoredPocket = false; + Snippets = false; + Locked = true; +}; +SearchSuggestEnabled = true; +FirefoxSuggest = { + WebSuggestions = true; + SponsoredSuggestions = false; + ImproveSuggest = false; + Locked = true; +}; +PictureInPicture = lock-true; +HardwareAcceleration = true; +Certificates = { + ImportEnterpriseRoots = true; +}; +ExtensionSettings = { +#"*".installation_mode = "blocked"; +# uBlock Origin + "uBlock0@raymondhill.net" = { + install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi"; + installation_mode = "force_installed"; + }; +# Bitwarden + "{446900e4-71c2-419f-a6a7-df9c091e268b}" = { + install_url = "https://addons.mozilla.org/firefox/downloads/latest/bitwarden-password-manager/latest.xpi"; + installation_mode = "normal_installed"; + }; +# SponsorBlock + "sponsorBlocker@ajay.app" = { + install_url = "https://addons.mozilla.org/firefox/downloads/latest/sponsorblock/latest.xpi"; + installation_mode = "force_installed"; + }; +# DeArrow + "deArrow@ajay.app" = { + install_url = "https://addons.mozilla.org/firefox/downloads/latest/dearrow/latest.xpi"; + installation_mode = "force_installed"; + }; +# Return Youtube Dislike + "{762f9885-5a13-4abd-9c77-433dcd38b8fd}" = { + install_url = "https://addons.mozilla.org/firefox/downloads/latest/return-youtube-dislikes/latest.xpi"; + installation_mode = "force_installed"; + }; +# Youtube Nonstop + "{0d7cafdd-501c-49ca-8ebb-e3341caaa55e}" = { + install_url = "https://addons.mozilla.org/firefox/downloads/latest/youtube-nonstop/latest.xpi"; + installation_mode = "force_installed"; + }; +# Sidebery + "{3c078156-979c-498b-8990-85f7987dd929}" = { + install_url = "https://addons.mozilla.org/firefox/downloads/latest/sidebery/latest.xpi"; + installation_mode = "normal_installed"; + }; +# TamperMonkey + "firefox@tampermonkey.net" = { + install_url = "https://addons.mozilla.org/firefox/downloads/latest/tampermonkey/latest.xpi"; + installation_mode = "force_installed"; + }; +# Floccus + "floccus@handmadeideas.org" = { + install_url = "https://addons.mozilla.org/firefox/downloads/latest/floccus/latest.xpi"; + installation_mode = "force_installed"; + }; +}; +Preferences = { + "browser.startup.homepage" = "https://d.in.rschanz.org"; + "extensions.activeThemeID" = { + Value = "firefox-compact-dark@mozilla.org"; + Status = "locked"; + }; + "toolkit.legacyUserProfileCustomizations.stylesheets" = lock-true; + "xpinstall.whitelist.required" = lock-true; + "dom.webgpu.enabled" = lock-true; + "media.eme.enabled" = lock-true; + "general.autoScroll" = lock-true; + "general.smoothScroll" = lock-true; + "browser.crashReports.unsubmittedCheck.autoSubmit2" = lock-false; + "browser.aboutConfig.showWarning" = lock-false; +}; +} diff --git a/users/ryan/linux/foot/foot.ini b/users/ryan/linux/foot/foot.ini new file mode 100644 index 0000000..50cb3fa --- /dev/null +++ b/users/ryan/linux/foot/foot.ini @@ -0,0 +1,7 @@ +font=Lilex Nerd Font Mono:size=14,FiraCode Nerd Font Mono:size=14 + +[desktop-notifications] +command=notify-send -a ${app-id} -i ${app-id} ${title} ${body} + +[colors-dark] +alpha=0.75 diff --git a/users/ryan/linux/hypr/family_guy.mp4 b/users/ryan/linux/hypr/family_guy.mp4 new file mode 100644 index 0000000..077fe49 Binary files /dev/null and b/users/ryan/linux/hypr/family_guy.mp4 differ diff --git a/users/ryan/linux/hypr/hypridle.conf b/users/ryan/linux/hypr/hypridle.conf new file mode 100644 index 0000000..72688da --- /dev/null +++ b/users/ryan/linux/hypr/hypridle.conf @@ -0,0 +1,16 @@ +general { + lock_cmd = pidof hyprlock || hyprlock + before_sleep_cmd = loginctl lock-session + after_sleep_cmd = hyprctl dispatch dpms on +} + +listener { + timeout = 300 + on-timeout = loginctl lock-session +} + +listener { + timeout = 600 + on-timeout = hyprctl dispatch dpms off + on-resume = hyprctl dispatch dpms on +} diff --git a/users/ryan/linux/hypr/hyprland.conf b/users/ryan/linux/hypr/hyprland.conf new file mode 100644 index 0000000..e51b54c --- /dev/null +++ b/users/ryan/linux/hypr/hyprland.conf @@ -0,0 +1,336 @@ +exec-once = dbus-update-activation-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP=Hyprland + +# +# Please note not all available settings / options are set here. +# For a full list, see the wiki +# + +# See https://wiki.hyprland.org/Configuring/Monitors/ +monitor=,preferred,auto,1 + +# Cursor theme is set via home.pointerCursor in linux.nix (pkgs.bibata-cursors, +# theme "Bibata-Modern-Classic"). The old vendored theme used +# hyprcursor/daed9-versioned names that only existed in the manually-packaged +# asset; nixpkgs' build uses the plain name below for both HYPRCURSOR_THEME +# and XCURSOR_THEME. +env = HYPRCURSOR_THEME,Bibata-Modern-Classic +env = HYPRCURSOR_SIZE,24 +env = XCURSOR_THEME,Bibata-Modern-Classic +env = XCURSOR_SIZE,24 + +env = AQ_NO_MODIFIERS,1 + +render { + expand_undersized_textures = false +} + +ecosystem { + no_update_news = true +} + + +# See https://wiki.hyprland.org/Configuring/Keywords/ for more + +# Execute your favorite apps at launch +# exec-once = waybar & hyprpaper & firefox + +# Source a file (multi-file configs) +source = ~/.config/hypr/monitors.conf + +# Some default env vars. +env = XCURSOR_SIZE,24 + +debug { + disable_logs = false + enable_stdout_logs = true +} + +# For all categories, see https://wiki.hyprland.org/Configuring/Variables/ +input { + kb_layout = us + kb_variant = + kb_model = + kb_options = + kb_rules = + numlock_by_default = true + + follow_mouse = 1 + + touchpad { + natural_scroll = no + middle_button_emulation = true + clickfinger_behavior = true + } + + sensitivity = 0 # -1.0 - 1.0, 0 means no modification. +} + +general { + # See https://wiki.hyprland.org/Configuring/Variables/ for more + + gaps_in = 5 + gaps_out = 10 + border_size = 2 + col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg + col.inactive_border = rgba(595959aa) + + layout = dwindle +} + +decoration { + # See https://wiki.hyprland.org/Configuring/Variables/ for more + + rounding = 5 + blur { + enabled = yes + size = 3 + passes = 1 + new_optimizations = on + } + + shadow { + enabled = true + range = 4 + render_power = 3 + color = rgba(1a1a1aee) + } +} + +animations { + enabled = yes + + # Some default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more + + bezier = myBezier, 0.05, 0.9, 0.1, 1.05 + + animation = windows, 1, 7, myBezier + animation = windowsOut, 1, 7, default, popin 80% + animation = border, 1, 10, default + animation = borderangle, 1, 8, default + animation = fade, 1, 7, default + animation = workspaces, 1, 6, default +} + +dwindle { + # See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more + pseudotile = yes # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below + preserve_split = yes # you probably want this +} + +#master { +# # See https://wiki.hyprland.org/Configuring/Master-Layout/ for more +# new_is_master = true +#} + +# Example per-device config +# See https://wiki.hyprland.org/Configuring/Keywords/#executing for more +device { + name = epic-mouse-v1 + sensitivity = -0.5 +} + +# Example windowrule v1 +# windowrule = float, ^(kitty)$ +# Example windowrule v2 +# windowrulev2 = float,class:^(kitty)$,title:^(kitty)$ +# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more + + +# See https://wiki.hyprland.org/Configuring/Keywords/ for more +$mainMod = SUPER + +# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more +bind = $mainMod, Return, exec, foot +bind = $mainMod CTRL, Return, exec, foot -a float-foot +bind = $mainMod SHIFT, Q, killactive +bind = $mainMod SHIFT, E, exit +bind = $mainMod SHIFT, Space, togglefloating +bind = $mainMod SHIFT, Return, pin, active +bind = $mainMod, D, exec, fuzzel --width=35 --font='Hack:weight=bold:size=12' --background-color='282a36fa' --selection-color='3d4460fa' --line-height=20 --border-radius=20 +bind = $mainMod, P, pseudo, # dwindle +bind = $mainMod, J, togglesplit, # dwindle +bind = $mainMod, F, fullscreen, 1 +bind = $mainMod SHIFT, F, fullscreen +bind = ,XF86MonBrightnessUp, exec, light -A 10 +bind = ,XF86MonBrightnessDown, exec, light -U 10 +bind = ,XF86AudioRaiseVolume, exec, pamixer -i 5 +bind = ,XF86AudioLowerVolume, exec, pamixer -d 5 +bind = ,XF86AudioMute, exec, pamixer -t +bind = ,XF86AudioPlay, exec, playerctl play-pause +bind = ,XF86AudioPause, exec, playerctl play-pause +bind = ,XF86AudioNext, exec, playerctl next +bind = ,XF86AudioPrev, exec, playerctl previous +bind = ,XF86AudioStop, exec, playerctl stop + +# "Auto-connect headphones" +bind = $mainMod, H, exec, bluetoothctl connect AC:80:0A:1C:D6:C7 + +# Move workspace between monitors +bind = $mainMod CTRL SHIFT, left, movecurrentworkspacetomonitor, l +bind = $mainMod CTRL SHIFT, right, movecurrentworkspacetomonitor, r +bind = $mainMod CTRL SHIFT, up, movecurrentworkspacetomonitor, u +bind = $mainMod CTRL SHIFT, down, movecurrentworkspacetomonitor, d + +# Move focus with mainMod + arrow keys +bind = $mainMod, left, movefocus, l +bind = $mainMod, right, movefocus, r +bind = $mainMod, up, movefocus, u +bind = $mainMod, down, movefocus, d + +# Move window with mainMod + SHIFT + arrow keys +bind = $mainMod SHIFT, left, movewindow, l +bind = $mainMod SHIFT, right, movewindow, r +bind = $mainMod SHIFT, up, movewindow, u +bind = $mainMod SHIFT, down, movewindow, d + +# Switch workspaces with mainMod + [0-9] +bind = $mainMod, 1, workspace, 1 +bind = $mainMod, 2, workspace, 2 +bind = $mainMod, 3, workspace, 3 +bind = $mainMod, 4, workspace, 4 +bind = $mainMod, 5, workspace, 5 +bind = $mainMod, 6, workspace, 6 +bind = $mainMod, 7, workspace, 7 +bind = $mainMod, 8, workspace, 8 +bind = $mainMod, 9, workspace, 9 +bind = $mainMod, 0, workspace, 10 + +# Move active window to a workspace with mainMod + SHIFT + [0-9] +bind = $mainMod SHIFT, 1, movetoworkspace, 1 +bind = $mainMod SHIFT, 2, movetoworkspace, 2 +bind = $mainMod SHIFT, 3, movetoworkspace, 3 +bind = $mainMod SHIFT, 4, movetoworkspace, 4 +bind = $mainMod SHIFT, 5, movetoworkspace, 5 +bind = $mainMod SHIFT, 6, movetoworkspace, 6 +bind = $mainMod SHIFT, 7, movetoworkspace, 7 +bind = $mainMod SHIFT, 8, movetoworkspace, 8 +bind = $mainMod SHIFT, 9, movetoworkspace, 9 +bind = $mainMod SHIFT, 0, movetoworkspace, 10 + +# Scroll through existing workspaces with mainMod + scroll +bind = $mainMod, mouse_down, workspace, e+1 +bind = $mainMod, mouse_up, workspace, e-1 + +# Move/resize windows with mainMod + LMB/RMB and dragging +bindm = $mainMod, mouse:272, movewindow +bindm = $mainMod, mouse:273, resizewindow + +# Bind mainMod + L to screenlocker +bind = $mainMod, L, exec, hyprlock +bind = $mainMod SHIFT, L, exec, loginctl suspend + +# Keybind to toggle "performance mode" (toggles GPU intensive things) +bind = $mainMod, F1, exec, ~/.config/hypr/scripts/perf_mode.sh + +bind = $mainMod SHIFT, Z, exec, pypr zoom + +# Keybind for screenshot (satty) +bind = $mainMod SHIFT, S, exec, grimblast save output - | satty --fullscreen --copy-command 'wl-copy' --filename - +bind = $mainMod, S, exec, grimblast copy area +bind = $mainMod, Print, exec, export TEMP=$(mktemp) && grimblast copy area && wl-paste > $TEMP && imv $TEMP && rm $TEMP + +# Keybind for screenshot (old) +# bind = $mainMod SHIFT, S, exec, grimblast copy area +# bind = $mainMod SHIFT, Print, exec, grimblast edit area +# bind = $mainMod, S, exec, imv <(grimblast save area -) + +# Keybind for screenshot (flameshot) +#bind = $mainMod SHIFT, S, exec, flameshot gui --raw | wl-copy +#bind = $mainMod SHIFT CTRL, S, exec, flameshot gui --raw -d $(( 1000 * $(fuzzel -l0 --dmenu -p"Delay> ") )) | wl-copy +#bind = $mainMod, S, exec, flameshot gui + +# Notifications keybinds +bind = $mainMod, N, exec, makoctl dismiss +bind = $mainMod SHIFT, N, exec, makoctl dismiss -a + +# Color picker +bind = $mainMod SHIFT, C, exec, hyprpicker -a + +# LinkedIn Joke (very serious) +bind = $mainMod SHIFT CTRL ALT, L, exec, xdg-open https://linkedin.com + +# Window Rules + +# Firefox PiP +windowrulev2 = float, class:^(zen-beta)$, title:^(Picture-in-Picture)$ +windowrulev2 = pin, class:^(zen-beta)$, title:^(Picture-in-Picture)$ +windowrulev2 = size 22% 22%, class:^(zen-beta)$, title:^(Picture-in-Picture)$ +windowrulev2 = move 76% 8%, class:^(zen-beta)$, title:^(Picture-in-Picture)$ + +# Firefox Sharing Indicator +windowrulev2 = float, class:^(firefox)$, title:^(Firefox — Sharing Indicator)$ +windowrulev2 = size 56 31, class:^(firefox)$, title:^(Firefox — Sharing Indicator)$ +windowrulev2 = move 50% 0, class:^(firefox)$, title:^(Firefox — Sharing Indicator)$ +windowrulev2 = suppressevent fullscreen maximize, class:^(firefox)$, title:^(Firefox — Sharing Indicator)$ + +# Weather +windowrulev2 = float,class:^(ala-wttr)$ +windowrulev2 = size 822 1026, class:^(ala-wttr)$ + +# Floating terminal +windowrulev2 = float,class:^(float-foot)$ +windowrulev2 = size 930 680,class:^(float-foot)$ +windowrulev2 = center,class:^(float-foot)$ + +# Change color of pinned windows +windowrulev2 = bordercolor rgba(bf0000ee) rgba(ab00adee) 45deg,pinned:1 + +# Fun Keybinds +# Subway surfer +bind = $mainMod CTRL SHIFT, S, exec, mpv ~/.config/hypr/subwaysurfer.webm +windowrulev2 = float,class:^(mpv)$, title:^(subwaysurfer.webm - mpv)$ +windowrulev2 = size 310 554,class:^(mpv)$, title:^(subwaysurfer.webm - mpv)$ +windowrulev2 = move 81% 46% ,class:^(mpv)$, title:^(subwaysurfer.webm - mpv)$ +windowrulev2 = pin,class:^(mpv)$, title:^(subwaysurfer.webm - mpv)$ + +# Family guy funny moments +bind = $mainMod CTRL SHIFT, F, exec, mpv ~/.config/hypr/family_guy.mp4 +windowrulev2 = float,class:^(mpv)$, title:^(family_guy.mp4 - mpv)$ +windowrulev2 = size 595 336,class:^(mpv)$, title:^(family_guy.mp4 - mpv)$ +windowrulev2 = move 67% 5% ,class:^(mpv)$, title:^(family_guy.mp4 - mpv)$ +windowrulev2 = pin,class:^(mpv)$, title:^(family_guy.mp4 - mpv)$ + +# Satty windowrules +windowrulev2 = fullscreen,class:^(com.gabm.satty)$ + +exec-once = ~/.config/hypr/scripts/autostart.sh + +misc { + disable_hyprland_logo = true + force_default_wallpaper = 0 +} + +# Cursors! +plugin:dynamic-cursors { + enabled = true + mode = tilt + threshold = 2 + tilt { + limit = 5000 + function = negative_quadratic + } + + shake { + enabled = true + nearest = true + threshold = 6.0 + base = 4.0 + speed = 4.0 + influence = 0.0 + + limit = 0.0 + + timeout = 2000 + + effects = true + + ipc = false + } + + hyprcursor { + nearest = true + enabled = true + resolution = -1 + fallback = clientside + } +} diff --git a/users/ryan/linux/hypr/hyprlock.conf b/users/ryan/linux/hypr/hyprlock.conf new file mode 100644 index 0000000..5c63fad --- /dev/null +++ b/users/ryan/linux/hypr/hyprlock.conf @@ -0,0 +1,57 @@ +background { + monitor = + #path = /home/ryan/.config/hypr/Wallpapers/static/autumn1.png + path = screenshot + + # all these options are taken from hyprland, see https://wiki.hyprland.org/Configuring/Variables/#blur for explanations + blur_passes = 2 # 0 disables blurring + blur_size = 7 + noise = 0.2 + contrast = 0.8916 + brightness = 0.8172 + vibrancy = 0.1696 + vibrancy_darkness = 0.0 +} + +input-field { + monitor = + size = 200, 50 + outline_thickness = 3 + dots_size = 0.33 # Scale of input-field height, 0.2 - 0.8 + dots_spacing = 0.15 # Scale of dots' absolute size, 0.0 - 1.0 + dots_center = false + dots_rounding = -1 # -1 default circle, -2 follow input-field rounding + outer_color = rgb(151515) + inner_color = rgb(200, 200, 200) + font_color = rgb(10, 10, 10) + fade_on_empty = true + fade_timeout = 1000 # Milliseconds before fade_on_empty is triggered. + placeholder_text = Input Password... # Text rendered in the input box when it's empty. + hide_input = false + rounding = -1 # -1 means complete rounding (circle/oval) + check_color = rgb(204, 136, 34) + fail_color = rgb(204, 34, 34) # if authentication failed, changes outer_color and fail message color + fail_text = $FAIL ($ATTEMPTS) # can be set to empty + fail_timeout = 2000 # milliseconds before fail_text and fail_color disappears + fail_transition = 300 # transition time in ms between normal outer_color and fail_color + capslock_color = -1 + numlock_color = -1 + bothlock_color = -1 # when both locks are active. -1 means don't change outer color (same for above) + invert_numlock = false # change color if numlock is off + swap_font_color = false # see below + + position = 0, -20 + halign = center + valign = center +} + +label { + monitor = + text = cmd[update:1000] echo "$(date +"%-H:%M:%S")" + #color = rgba(255, 255, 255, 0.6) + font_size = 80 + position = 0, 300 + halign = center + valign = center + font_family = Lilex Nerd Font +} diff --git a/users/ryan/linux/hypr/kanshi.conf b/users/ryan/linux/hypr/kanshi.conf new file mode 100644 index 0000000..52c3c0f --- /dev/null +++ b/users/ryan/linux/hypr/kanshi.conf @@ -0,0 +1,22 @@ +profile { + output "AU Optronics 0x103D Unknown" enable +} + +profile emilydesk { + output "AU Optronics 0x103D Unknown" disable + output "Dell Inc. DELL U2422H JN4SF83" position 0,0 mode 1920x1080 + output "Dell Inc. DELL U2414H R9F1P5C59WDL" position 1920,0 mode 1920x1080 + output "Dell Inc. DELL U2422H 5S9SF83" position 3840,0 mode 1920x1080 +} + +profile justindesk { + output "AU Optronics 0x103D Unknown" position 0,0 mode 1920x1080 + output "Dell Inc. DELL U2417H XVNNT7CDC80L" position 1920,0 mode 1920x1080 + output "Dell Inc. DELL U2417H XVNNT82M978L" position 3840,0 mode 1920x1080 +} + +profile homedesk { + output "AU Optronics 0x103D Unknown" disable + output "Samsung Electric Company C27F390 H1AK500000" position 0,0 mode 1920x1080 + output "Samsung Electric Company S22R35x H4TNA01683" position 1920,0 mode 1920x1080 +} diff --git a/users/ryan/linux/hypr/monitors.conf b/users/ryan/linux/hypr/monitors.conf new file mode 100644 index 0000000..7b3b503 --- /dev/null +++ b/users/ryan/linux/hypr/monitors.conf @@ -0,0 +1,2 @@ +monitor=eDP-1,1920x1080, 0x0, 1 +monitor=HDMI-A-1,1920x1080, 1920x0, 1 diff --git a/users/ryan/linux/hypr/pyprland.toml b/users/ryan/linux/hypr/pyprland.toml new file mode 100644 index 0000000..cd081fe --- /dev/null +++ b/users/ryan/linux/hypr/pyprland.toml @@ -0,0 +1,5 @@ +[pyprland] +plugins = ["magnify"] + +[magnify] +factor = 2.5 diff --git a/users/ryan/linux/hypr/scripts/autostart.sh b/users/ryan/linux/hypr/scripts/autostart.sh new file mode 100755 index 0000000..706f82f --- /dev/null +++ b/users/ryan/linux/hypr/scripts/autostart.sh @@ -0,0 +1,40 @@ +#!/usr/bin/env bash + +waybar & + +mako & + +#swaybg -i ~/.config/hypr/Wallpapers/above-clouds.jpg & + +nice -n13 swww init & + +#~/.config/hypr/wallpaper-daemon.sh & +wpaperd -d & + +pypr & + +#swayidle -w timeout 300 'swaylock --screenshots --clock --indicator --grace 3 --fade-in 1 --effect-blur 7x5 --effect-greyscale' timeout 600 'hyprctl dispatch dpms off' resume 'hyprctl dispatch dpms on' before-sleep 'swaylock -f -c 000000' & + +hypridle & + +syncthing serve --no-browser & + +# Kill any orphans of this +killall wl-clip-persist +wl-clip-persist -c regular --reconnect-tries 5 & + +kanshi -c ~/.config/hypr/kanshi.conf & + +# Start the portals + +sleep 0.5 +killall -e xdg-desktop-portal-hyprland +killall xdg-desktop-portal-gtk +killall xdk-desktop-portal + +~/.nix-profile/libexec/xdg-desktop-portal-hyprland & +~/.nix-profile/libexec/xdg-desktop-portal-gtk & +sleep 2 +XDG_DESKTOP_PORTAL_DIR="/home/ryan/.nix-profile/share/xdg-desktop-portal/portals" ~/.nix-profile/libexec/xdg-desktop-portal & + +#flameshot & diff --git a/users/ryan/linux/hypr/scripts/perf_mode.sh b/users/ryan/linux/hypr/scripts/perf_mode.sh new file mode 100755 index 0000000..c195688 --- /dev/null +++ b/users/ryan/linux/hypr/scripts/perf_mode.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash +HYPRGAMEMODE=$(hyprctl getoption animations:enabled | awk 'NR==1{print $2}') +if [ "$HYPRGAMEMODE" = 1 ] ; then + hyprctl --batch "\ + keyword animations:enabled 0;\ + keyword decoration:drop_shadow 0;\ + keyword decoration:blur:enabled 0;\ + keyword general:gaps_in 0;\ + keyword general:gaps_out 0;\ + keyword general:border_size 1;\ + keyword decoration:rounding 0" + exit +fi +hyprctl reload diff --git a/users/ryan/linux/hypr/subwaysurfer.webm b/users/ryan/linux/hypr/subwaysurfer.webm new file mode 100644 index 0000000..594e1c0 Binary files /dev/null and b/users/ryan/linux/hypr/subwaysurfer.webm differ diff --git a/users/ryan/linux/mailvelope/gpgmejson.json b/users/ryan/linux/mailvelope/gpgmejson.json new file mode 100644 index 0000000..7ad8586 --- /dev/null +++ b/users/ryan/linux/mailvelope/gpgmejson.json @@ -0,0 +1,7 @@ +{ + "name": "gpgmejson", + "description": "JavaScript binding for GnuPG", + "path": "/home/ryan/.local/share/mailvelope/start.sh", + "type": "stdio", + "allowed_extensions": ["jid1-AQqSMBYb0a8ADg@jetpack"] +} diff --git a/users/ryan/linux/mailvelope/start.sh b/users/ryan/linux/mailvelope/start.sh new file mode 100755 index 0000000..01b3ee2 --- /dev/null +++ b/users/ryan/linux/mailvelope/start.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +# Wrap for gpgme-json so firefox can use it +exec gpgme-json $@ diff --git a/users/ryan/linux/mpv/scripts/easycrop.lua b/users/ryan/linux/mpv/scripts/easycrop.lua new file mode 100644 index 0000000..415fce5 --- /dev/null +++ b/users/ryan/linux/mpv/scripts/easycrop.lua @@ -0,0 +1,254 @@ +local msg = require('mp.msg') +local assdraw = require('mp.assdraw') + +local script_name = "easycrop" + +-- Number of crop points currently chosen (0 to 2) +local points = {} +-- True if in cropping selection mode +local cropping = false +-- Original value of osc property +local osc_prop = false + +-- Helper that converts two points to top-left and bottom-right +local swizzle_points = function (p1, p2) + if p1.x > p2.x then p1.x, p2.x = p2.x, p1.x end + if p1.y > p2.y then p1.y, p2.y = p2.y, p1.y end +end + +local clamp = function (val, min, max) + assert(min <= max) + if val < min then return min end + if val > max then return max end + return val +end + +local video_space_from_screen_space = function (ssp) + -- Video native dimensions and screen size + local vid_w = mp.get_property("width") + local vid_h = mp.get_property("height") + local osd_w = mp.get_property("osd-width") + local osd_h = mp.get_property("osd-height") + + -- Factor by which the video is scaled to fit the screen + local scale = math.min(osd_w/vid_w, osd_h/vid_h) + + -- Size video takes up in screen + local vid_sw, vid_sh = scale*vid_w, scale*vid_h + + -- Video offset within screen + local off_x = math.floor((osd_w - vid_sw)/2) + local off_y = math.floor((osd_h - vid_sh)/2) + + local vsp = {} + + -- Move the point to within the video + vsp.x = clamp(ssp.x, off_x, off_x + vid_sw) + vsp.y = clamp(ssp.y, off_y, off_y + vid_sh) + + -- Convert screen-space to video-space + vsp.x = math.floor((vsp.x - off_x) / scale) + vsp.y = math.floor((vsp.y - off_y) / scale) + + return vsp +end + +local screen_space_from_video_space = function (vsp) + -- Video native dimensions and screen size + local vid_w = mp.get_property("width") + local vid_h = mp.get_property("height") + local osd_w = mp.get_property("osd-width") + local osd_h = mp.get_property("osd-height") + + -- Factor by which the video is scaled to fit the screen + local scale = math.min(osd_w/vid_w, osd_h/vid_h) + + -- Size video takes up in screen + local vid_sw, vid_sh = scale*vid_w, scale*vid_h + + -- Video offset within screen + local off_x = math.floor((osd_w - vid_sw)/2) + local off_y = math.floor((osd_h - vid_sh)/2) + + local ssp = {} + ssp.x = vsp.x * scale + off_x + ssp.y = vsp.y * scale + off_y + return ssp +end + +-- Wrapper that converts RRGGBB / RRGGBBAA to ASS format +local ass_set_color = function (idx, color) + assert(color:len() == 8 or color:len() == 6) + local ass = "" + + -- Set alpha value (if present) + if color:len() == 8 then + local alpha = 0xff - tonumber(color:sub(7, 8), 16) + ass = ass .. string.format("\\%da&H%X&", idx, alpha) + end + + -- Swizzle RGB to BGR and build ASS string + color = color:sub(5, 6) .. color:sub(3, 4) .. color:sub(1, 2) + return "{" .. ass .. string.format("\\%dc&H%s&", idx, color) .. "}" +end + +local draw_rect = function (p1, p2) + local osd_w, osd_h = mp.get_property("osd-width"), mp.get_property("osd-height") + + ass = assdraw.ass_new() + + -- Draw overlay over surrounding unselected region + + ass:draw_start() + ass:pos(0, 0) + + ass:append(ass_set_color(1, "000000aa")) + ass:append(ass_set_color(3, "00000000")) + + local l = math.min(p1.x, p2.x) + local r = math.max(p1.x, p2.x) + local u = math.min(p1.y, p2.y) + local d = math.max(p1.y, p2.y) + + ass:rect_cw(0, 0, l, osd_h) + ass:rect_cw(r, 0, osd_w, osd_h) + ass:rect_cw(l, 0, r, u) + ass:rect_cw(l, d, r, osd_h) + + ass:draw_stop() + + -- Draw border around selected region + + ass:new_event() + ass:draw_start() + ass:pos(0, 0) + + ass:append(ass_set_color(1, "00000000")) + ass:append(ass_set_color(3, "000000ff")) + ass:append("{\\bord2}") + + ass:rect_cw(p1.x, p1.y, p2.x, p2.y) + + ass:draw_stop() + + mp.set_osd_ass(osd_w, osd_h, ass.text) +end + +local draw_fill = function () + local osd_w, osd_h = mp.get_property("osd-width"), mp.get_property("osd-height") + + ass = assdraw.ass_new() + ass:draw_start() + ass:pos(0, 0) + + ass:append(ass_set_color(1, "000000aa")) + ass:append(ass_set_color(3, "00000000")) + ass:rect_cw(0, 0, osd_w, osd_h) + + ass:draw_stop() + mp.set_osd_ass(osd_w, osd_h, ass.text) +end + +local draw_clear = function () + local osd_w, osd_h = mp.get_property("osd-width"), mp.get_property("osd-height") + mp.set_osd_ass(osd_w, osd_h, "") +end + +local draw_cropper = function () + if #points == 1 then + local p1 = screen_space_from_video_space(points[1]) + local p2 = {} + p2.x, p2.y = mp.get_mouse_pos() + draw_rect(p1, p2) + end +end + +local uncrop = function () + mp.command("no-osd vf del @" .. script_name .. ":crop") +end + +local crop = function(p1, p2) + swizzle_points(p1, p2) + + local w = p2.x - p1.x + local h = p2.y - p1.y + local ok, err = mp.command(string.format( + "no-osd vf add @%s:crop=%s:%s:%s:%s", script_name, w, h, p1.x, p1.y)) + + if not ok then + mp.osd_message("Cropping failed") + points = {} + end +end + +local easycrop_stop = function () + mp.set_property("osc", osc_prop) + cropping = false + mp.remove_key_binding("easycrop_mouse_btn0") + draw_clear() +end + +local mouse_btn0_cb = function () + if not cropping then + return + end + + local mx, my = mp.get_mouse_pos() + table.insert(points, video_space_from_screen_space({ x = mx, y = my })) + + if #points == 2 then + crop(points[1], points[2]) + easycrop_stop() + end +end + +local easycrop_start = function () + -- Cropping requires swdec or hwdec with copy-back + local hwdec = mp.get_property("hwdec-current") + if hwdec == nil then + return mp.msg.error("Cannot determine current hardware decoder mode") + end + -- Check whitelist of ok values + local valid_hwdec = { + ["no"] = true, -- software decoding + -- Taken from mpv manual + ["videotoolbox-co"] = true, + ["vaapi-copy"] = true, + ["dxva2-copy"] = true, + ["d3d11va-copy"] = true, + ["mediacodec"] = true + } + if not valid_hwdec[hwdec] then + return mp.osd_message("Cropping requires swdec or hwdec with copy-back (see mpv manual)") + end + + -- Just clear the current crop and return, if there is one + if #points ~= 0 then + uncrop() + points = {} + return + end + + -- Hide OSC + osc_prop = mp.get_property("osc") + mp.set_property("osc", "no") + + cropping = true + mp.add_forced_key_binding("mouse_btn0", "easycrop_mouse_btn0", mouse_btn0_cb) + draw_fill() +end + +local easycrop_activate = function () + if cropping then + easycrop_stop() + else + easycrop_start() + end +end + +mp.add_key_binding("mouse_move", draw_cropper) +mp.observe_property("osd-width", "native", draw_cropper) +mp.observe_property("osd-height", "native", draw_cropper) + +mp.add_key_binding("c", "easy_crop", easycrop_activate) + diff --git a/users/ryan/linux/pulseaudio/client.conf b/users/ryan/linux/pulseaudio/client.conf new file mode 100644 index 0000000..207e152 --- /dev/null +++ b/users/ryan/linux/pulseaudio/client.conf @@ -0,0 +1 @@ +autospawn = no diff --git a/users/ryan/linux/spotify-player/app.toml b/users/ryan/linux/spotify-player/app.toml new file mode 100644 index 0000000..4eac5e4 --- /dev/null +++ b/users/ryan/linux/spotify-player/app.toml @@ -0,0 +1,34 @@ +theme = "dracula" +client_id = "4b1219bdc29945bc8ca914f80a8a6a47" +client_port = 8888 +playback_format = """ +{track} • {artists} +{album} +{metadata}""" +tracks_playback_limit = 50 +app_refresh_duration_in_ms = 32 +playback_refresh_duration_in_ms = 0 +cover_image_refresh_duration_in_ms = 2000 +page_size_in_rows = 20 +play_icon = "▶" +pause_icon = "▌▌" +liked_icon = "♥" +border_type = "Plain" +progress_bar_type = "Rectangle" +playback_window_position = "Top" +cover_img_length = 9 +cover_img_width = 5 +cover_img_scale = 1.0 +playback_window_width = 6 +enable_media_control = true +enable_streaming = "DaemonOnly" +enable_cover_image_cache = true +default_device = "RyanThinkpad" + +[copy_command] +command = "wlcopy" +args = [] + +[notify_format] +summary = "{track} • {artists}" +body = "{album}" diff --git a/users/ryan/linux/tridactyl/native_main b/users/ryan/linux/tridactyl/native_main new file mode 100755 index 0000000..2104875 Binary files /dev/null and b/users/ryan/linux/tridactyl/native_main differ diff --git a/users/ryan/linux/tridactyl/tridactyl.json b/users/ryan/linux/tridactyl/tridactyl.json new file mode 100644 index 0000000..0764f98 --- /dev/null +++ b/users/ryan/linux/tridactyl/tridactyl.json @@ -0,0 +1,7 @@ +{ + "name": "tridactyl", + "description": "Tridactyl native command handler", + "path": "/home/ryan/.local/share/tridactyl/native_main", + "type": "stdio", + "allowed_extensions": [ "tridactyl.vim@cmcaine.co.uk","tridactyl.vim.betas@cmcaine.co.uk", "tridactyl.vim.betas.nonewtab@cmcaine.co.uk" ] +} diff --git a/users/ryan/linux/waybar/config b/users/ryan/linux/waybar/config new file mode 100644 index 0000000..62e6b20 --- /dev/null +++ b/users/ryan/linux/waybar/config @@ -0,0 +1,167 @@ +{ + "layer": "top", + "position": "top", + "height": 30, + + "modules-left": ["hyprland/workspaces", "hyprland/submap"], + "modules-center": ["hyprland/window"], + "modules-right": ["tray", "custom/spotify", "privacy", "custom/weather", "custom/mail", "custom/storage", "backlight", "bluetooth", "pulseaudio", "network", "idle_inhibitor", "battery", "battery#num2", "clock"], + "hyprland/submap": { + "format": " {}" + }, + "hyprland/workspaces": { + "format": "{id}", + "all-outputs": false, + "disable-scroll": true + }, + "hyprland/window": { + "max-length": 80, + "tooltip": false, + "separate-outputs": true + }, + "clock": { + "format": "{:%a %d %b %H:%M}", + "tooltip": false + }, + "battery": { + "format": "{capacity}% {icon}", + "format-alt": "{time} {icon}", + "format-icons": ["", "", "", "", ""], + "format-charging": "{capacity}% ", + "interval": 30, + "states": { + "warning": 25, + "critical": 10 + }, + "tooltip": false, + "bat":"BAT0" + }, + "battery#num2": { + "format": "{capacity}% {icon}", + "format-alt": "{time} {icon}", + "format-icons": ["", "", "", "", ""], + "format-charging": "{capacity}% ", + "interval": 30, + "states": { + "warning": 25, + "critical": 10 + }, + "tooltip": false, + "bat":"BAT1" + }, + "bluetooth": { + "format": "󰂯", + "format-disabled": "󰂲", + "format-connected": "󰂯", + "format-connected-battery": "󰂱 {device_battery_percentage}%", + "on-click": "foot bluetui", + "tooltip-format": "{controller_alias}\t{controller_address}\n\n{num_connections} connected", + "tooltip-format-connected": "{controller_alias}\t{controller_address}\n\n{num_connections} connected\n\n{device_enumerate}", + "tooltip-format-enumerate-connected": "{device_alias}\t{device_address}", + "tooltip-format-enumerate-connected-battery": "{device_alias}\t{device_address}\t{device_battery_percentage}%" + }, + "network": { + "format-alt": "{ipaddr}/{cidr} {icon} {bandwidthTotalBytes}󰹹", + "format": "{ipaddr}/{cidr} {icon}", + "format-alt-click": "click-right", + "format-icons": { + "wifi": ["󰤟", "󰤢" ,"󰤥", "󰤨"], + "ethernet": [""], + "disconnected": ["󰤭"] + }, + "on-click": "foot -t alacritty doas nmtui", + "tooltip": false + }, + "privacy": { + "icon-spacing":4, + "icon-size":18, + "transition-duration":250, + "modules": [ + { + "type":"screenshare", + "tooltip":true, + "tooltip-icon-size":24 + }, + { + "type":"audio-in", + "tooltip":true, + "tooltip-icon-size":24 + } + ] + }, + "pulseaudio": { + "format-alt": "{icon}", + "format": "{volume} {icon}", + "format-alt-click": "click-right", + "format-muted": "", + "format-icons": { + "phone": [" ", " ", " ", " "], + "default": ["", "", "", ""] + }, + "scroll-step": 1, + "on-click": "pavucontrol", + "tooltip": false + }, + "custom/spotify": { + "interval": 2, + "return-type": "json", + "exec": "~/.config/waybar/modules/spotify.sh", + "exec-if": "~/.config/waybar/modules/check-for-music.sh", + "escape": true, + "on-click": "playerctl play-pause" + }, + "custom/storage": { + "format-alt": "{} ", + "format": "{percentage}% ", + "format-alt-click": "click-right", + "return-type": "json", + "interval": 60, + "exec": "~/.config/waybar/modules/storage.sh" + }, + "backlight": { + "format-alt": "{icon}", + "format": "{percent}% {icon}", + "format-alt-click": "click-right", + "format-icons": ["", ""], + "on-scroll-up": "light -A 1", + "on-scroll-down": "light -U 1" + }, + "custom/weather_OLD": { + "format-alt": "{}", + "format": "{alt}: {}", + "format-alt-click": "click-right", + "interval": 1800, + "return-type": "json", + "on-click": "foot -a ala-wttr -H curl https://v2.wttr.in", + "exec": "~/.config/waybar/modules/weather.sh", + "exec-if": "ping wttr.in -c1" + }, + "custom/weather": { + "format": "{} °F", + "tooltip": true, + "interval": 3600, + "exec": "exit=101; while [ $exit = 101 ]; do wttrbar --main-indicator temp_F --fahrenheit; exit=$(echo $?); sleep 1; done", + "on-click": "foot -a ala-wttr -H curl https://v2.wttr.in", + "return-type": "json" + }, + "idle_inhibitor": { + "format": "{icon}", + "format-icons": { + "activated": "", + "deactivated": "" + }, + "tooltip": false + }, + "custom/mail": { + "format": "", + "format-alt": "{alt} ", + "format-alt-click": "click-right", + "interval": 60, + "return-type": "json", + "exec": "~/.config/waybar/modules/mail.py", + "tooltip": false + }, + "tray": { + "icon-size": 18 + } +} diff --git a/users/ryan/linux/waybar/modules/check-for-music.sh b/users/ryan/linux/waybar/modules/check-for-music.sh new file mode 100755 index 0000000..3b735a2 --- /dev/null +++ b/users/ryan/linux/waybar/modules/check-for-music.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +if [[ $(playerctl metadata --format '{{lc(status)}}' | grep playing) -eq 0 ]]; then + exit 0 +else + exit 1 +fi diff --git a/users/ryan/linux/waybar/modules/spotify.sh b/users/ryan/linux/waybar/modules/spotify.sh new file mode 100755 index 0000000..fc732a1 --- /dev/null +++ b/users/ryan/linux/waybar/modules/spotify.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +class=$(playerctl metadata --format '{{lc(status)}}') +icon="󰎆" + +if [[ $class == "playing" ]]; then + info=$(playerctl metadata --format '{{artist}} - {{title}}') + if [[ ${#info} > 40 ]]; then + info=$(playerctl metadata --format '{{title}}' | cut -c1-40)"..." + fi + text=$info" "$icon +elif [[ $class == "paused" ]]; then + text=$icon +elif [[ $class == "stopped" ]]; then + text="" +fi + +echo -e "{\"text\":\""$text"\", \"class\":\""$class"\"}" + diff --git a/users/ryan/linux/waybar/modules/storage.sh b/users/ryan/linux/waybar/modules/storage.sh new file mode 100755 index 0000000..90cc3dc --- /dev/null +++ b/users/ryan/linux/waybar/modules/storage.sh @@ -0,0 +1,25 @@ +#!/bin/sh + +mount="/" +warning=20 +critical=10 + +df -h -P -l "$mount" | awk -v warning=$warning -v critical=$critical ' +/\/.*/ { + text=$4 + tooltip="Filesystem: "$1"\rSize: "$2"\rUsed: "$3"\rAvail: "$4"\rUse%: "$5"\rMounted on: "$6 + use=$5 + exit 0 +} +END { + class="" + gsub(/%$/,"",use) + if ((100 - use) < critical) { + class="critical" + } else if ((100 - use) < warning) { + class="warning" + } + print "{\"text\":\""text"\", \"percentage\":"use",\"tooltip\":\""tooltip"\", \"class\":\""class"\"}" +} +' + diff --git a/users/ryan/linux/waybar/modules/weather.sh b/users/ryan/linux/waybar/modules/weather.sh new file mode 100755 index 0000000..01faffc --- /dev/null +++ b/users/ryan/linux/waybar/modules/weather.sh @@ -0,0 +1,77 @@ +cachedir=~/.cache/rbn +cachefile=${0##*/}-$1 + +if [ ! -d $cachedir ]; then + mkdir -p $cachedir +fi + +if [ ! -f $cachedir/$cachefile ]; then + touch $cachedir/$cachefile +fi + +# Save current IFS +SAVEIFS=$IFS +# Change IFS to new line. +IFS=$'\n' + +cacheage=$(($(date +%s) - $(stat -c '%Y' "$cachedir/$cachefile"))) +if [ $cacheage -gt 1740 ] || [ ! -s $cachedir/$cachefile ]; then + data=($(curl -s https://en.wttr.in/$1\?0qnT 2>&1)) + echo ${data[0]} | cut -f1 -d, > $cachedir/$cachefile + echo ${data[1]} | sed -E 's/^.{15}//' >> $cachedir/$cachefile + echo ${data[2]} | sed -E 's/^.{15}//' >> $cachedir/$cachefile +fi + +weather=($(cat $cachedir/$cachefile)) + +# Restore IFSClear +IFS=$SAVEIFS + +temperature=$(echo ${weather[2]} | sed -E 's/([[:digit:]]+)\.\./\1 to /g') + +#echo ${weather[1]##*,} + +# https://fontawesome.com/icons?s=solid&c=weather +case $(echo ${weather[1]##*,} | tr '[:upper:]' '[:lower:]') in +"clear" | "sunny") + condition="" + ;; +"partly cloudy") + condition="" + ;; +"cloudy") + condition="" + ;; +"overcast") + condition="" + ;; +"mist" | "fog" | "freezing fog") + condition="敖" + ;; +"patchy rain possible" | "patchy light drizzle" | "light drizzle" | "patchy light rain" | "light rain" | "light rain shower" | "rain") + condition="殺" + ;; +"moderate rain at times" | "moderate rain" | "heavy rain at times" | "heavy rain" | "moderate or heavy rain shower" | "torrential rain shower" | "rain shower") + condition="" + ;; +"patchy snow possible" | "patchy sleet possible" | "patchy freezing drizzle possible" | "freezing drizzle" | "heavy freezing drizzle" | "light freezing rain" | "moderate or heavy freezing rain" | "light sleet" | "ice pellets" | "light sleet showers" | "moderate or heavy sleet showers") + condition="流" + ;; +"blowing snow" | "moderate or heavy sleet" | "patchy light snow" | "light snow" | "light snow showers") + condition="ﰕ" + ;; +"blizzard" | "patchy moderate snow" | "moderate snow" | "patchy heavy snow" | "heavy snow" | "moderate or heavy snow with thunder" | "moderate or heavy snow showers") + condition="" + ;; +"thundery outbreaks possible" | "patchy light rain with thunder" | "moderate or heavy rain with thunder" | "patchy light snow with thunder") + condition="" + ;; +*) + condition="" + echo -e "{\"text\":\""$condition"\", \"alt\":\""${weather[0]}"\", \"tooltip\":\""${weather[0]}: $temperature ${weather[1]}"\"}" + ;; +esac + +#echo $temp $condition + +echo -e "{\"text\":\""$temperature $condition"\", \"alt\":\""${weather[0]}"\", \"tooltip\":\""${weather[0]}: $temperature ${weather[1]}"\"}" diff --git a/users/ryan/linux/waybar/style.css b/users/ryan/linux/waybar/style.css new file mode 100644 index 0000000..682a14e --- /dev/null +++ b/users/ryan/linux/waybar/style.css @@ -0,0 +1,77 @@ +* { + border: none; + border-radius: 0; + font-family: AnonymicePro Nerd Font; + font-size: 15px; + box-shadow: none; + text-shadow: none; + transition-duration: 0s; + color: white; +} + +#waybar { + background-color:rgba(0,0,0,0.25); + color: white; +} + +window { + color: rgba(217, 216, 216, 1); + background: rgba(35, 31, 32, 0.00); +} + +window#waybar.solo { + color: rgba(217, 216, 216, 1); + background: rgba(35, 31, 32, 0.85); +} + +#workspaces { + margin: 0 5px; +} + +#workspaces button { + padding: 0 5px; + color: rgba(217, 216, 216, 0.4); +} + +#workspaces button.visible { + color: rgba(217, 216, 216, 1); +} + +#workspaces button.active { + border-top: 3px solid rgba(217, 216, 216, 1); + border-bottom: 3px solid rgba(217, 216, 216, 0); +} + +#workspaces button.urgent { + color: rgba(238, 46, 36, 1); +} + +#mode, #battery, #cpu, #memory, #network, #bluetooth, #pulseaudio, #idle_inhibitor, #backlight, #custom-storage, #custom-spotify, #custom-weather, #custom-mail { + margin: 0px 6px 0px 10px; + min-width: 25px; +} + +#clock { + margin: 0px 16px 0px 10px; + min-width: 140px; +} + +#battery.warning #battery.num2.warning { + color: rgba(255, 210, 4, 1); +} + +#battery.critical #battery.bat2.critical { + color: rgba(238, 46, 36, 1); +} + +#battery.charging #battery.bat2.charging { + color: rgba(217, 216, 216, 1); +} + +#custom-storage.warning { + color: rgba(255, 210, 4, 1); +} + +#custom-storage.critical { + color: rgba(238, 46, 36, 1); +} diff --git a/users/ryan/linux/wpaperd/config.toml b/users/ryan/linux/wpaperd/config.toml new file mode 100644 index 0000000..9947370 --- /dev/null +++ b/users/ryan/linux/wpaperd/config.toml @@ -0,0 +1,4 @@ +[default] +duration = "30m" +path = "~/.config/hypr/Wallpapers/static/" +transition-time = 2000 -- cgit v1.3.1