diff options
Diffstat (limited to 'home-manager')
50 files changed, 4496 insertions, 0 deletions
diff --git a/home-manager/alacritty/default.nix b/home-manager/alacritty/default.nix new file mode 100644 index 00000000..1bb6afac --- /dev/null +++ b/home-manager/alacritty/default.nix @@ -0,0 +1,583 @@ +{config, ...}: { + home-manager.users.soispha.programs.alacritty = { + enable = true; + settings = { + env = { + TERM = "alacritty"; + }; + window = { + dimensionns = { + columns = 0; + lines = 0; + }; + + positinon = { + #x = 0; + #y = 0; + }; + + padding = { + x = 5; + y = 5; + }; + + dynamic_padding = false; + decorations = "None"; + opacity = 0.9; + startup_mode = "Windowed"; + title = "Alacritty"; + dynamic_title = true; + class = { + instance = "Alacritty"; + general = "Alacritty"; + }; + docorations_theme_variant = "None"; + }; + + scrolling = { + history = 10000; + multiplier = 3; + }; + + font = { + normal = { + family = "Source Code Pro"; + style = "Regular"; + }; + bold = { + family = "Source Code Pro"; + style = "Bold"; + }; + italic = { + family = "Source Code Pro"; + style = "Italic"; + }; + bold_italic = { + family = "Source Code Pro"; + style = "Bold Italic"; + }; + size = 12.0; + offset = { + x = -1; + y = -1; + }; + glyph_offset = { + x = -1; + y = -1; + }; + builtin_box_drawing = true; + }; + + draw_bold_text_with_bright_colors = false; + + colors = { + primary = { + background = "#191919"; + foreground = "#d8dee9"; + #dim_foreground= "#828482"; + #bright_foreground= "#eaeaea"; + + cursor = { + text = "#191919"; + cursor = "#d8dee9"; + }; + vi_mode_cursor = { + text = "CellBackground"; + cursor = "CellForeground"; + }; + search = { + matches = { + foreground = "#000000"; + background = "#ffffff"; + }; + focused_match = { + foreground = "#ffffff"; + background = "#000000"; + }; + }; + + hints = { + start = { + foreground = "#1d1f21"; + background = "#e9ff5e"; + }; + + end = { + foreground = "#e9ff5e"; + background = "#1d1f21"; + }; + line_indicator = { + #foreground= "None"; + #background= "None"; + }; + + footer_bar = { + background = "#c5c8c6"; + foreground = "#1d1f21"; + }; + + selection = { + text = "#191919"; + background = "#d8dee9"; + }; + + normal = { + black = "#191919"; + red = "#b02626"; + green = "#40a62f"; + yellow = "#f2e635"; + blue = "#314ad0"; + magenta = "#b30ad0"; + cyan = "#32d0fc"; + white = "#acadb1"; + }; + bright = { + black = "#36393d"; + red = "#ce2727"; + green = "#47c930"; + yellow = "#fff138"; + blue = "#2e4bea"; + magenta = "#cc15ed"; + cyan = "#54d9ff"; + white = "#dbdbdb"; + }; + + dim = { + black = "#676f78"; + red = "#b55454"; + green = "#78a670"; + yellow = "#faf380"; + blue = "#707fd0"; + magenta = "#c583d0"; + cyan = "#8adaf1"; + white = "#e0e3e7"; + }; + + #indexed_colors = [ + # {index = 16; color = "#ff00ff";} + # ]; + transparent_background_colors = false; # TODO + }; + }; + + bell = { + animation = "EaseOutExpo"; + duration = 0; + color = "#ffffff"; + command = "None"; + }; + + selection = { + semantic_escape_chars = ",│`|:\"' ()[]{}<>\t"; + save_to_clipboard = false; + }; + + cursor = { + style = { + shape = "Beam"; + blinking = "On"; + }; + vi_mode_style = "None"; + blink_interval = 750; + blink_timeout = 5; + unfocused_hollow = true; + thickness = 0.15; + }; + live_config_reload = true; + + #shell = { + # program = "/bin/sh"; + # args = ["--login"]; + #} + + working_directory = "None"; + + ipc_socket = true; # TODO + + mouse = { + hide_when_typing = false; + double_click.threshold = 300; + triple_click.threshold = 300; + }; + + hints = { + alphabet = "jfkdls;ahgurieowpq"; + enabled = [ + { + regex = "(ipfs:|ipns:|magnet:|mailto:|gemini:|gopher:|https:|http:|news:|file:|git:|ssh:|ftp:)\ + [^\u0000-\u001F\u007F-\u009F<>\"\\s{-}\\^⟨⟩`]+"; + hyperlinks = true; + command = "xdg-open"; + post_processing = true; + mouse = { + enabled = true; + mods = "None"; + }; + binding = { + key = "U"; + mods = "Control|Shift"; + }; + } + + { + # multi regex for different purposes: + # 2. UUIDs + # 3. hex (for example signatures) + # 4. IP addresses + regex = "([[:alnum:]_$%&+=/@-]+)|([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})|([0-9a-f]{12,128})|([[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3})"; + action = "Copy"; + post_processing = false; + binding = { + key = "U"; + mods = "Control|Shift"; + }; + } + ]; + + mouse_bindings = [ + # { mouse = "Right"; action = "ExpandSelection" ;} + # { mouse = "Right"; mods = "Control"; action = "ExpandSelection" ;} + # { mouse = "Middle"; mode = "~Vi"; action = "PasteSelection" ;} + { + mouse = "Middle"; + action = "Copy"; + } + ]; + + key_bindings = [ + # (Windows, Linux, and BSD only) + { + key = "P"; + mods = "Control"; + action = "Paste"; + } + { + key = "Insert"; + mods = "Shift"; + action = "Paste"; + } + { + key = "Slash"; + mods = "Control"; + chars = "gc"; + } + { + key = "Y"; + mods = "Control"; + action = "Copy"; + } + { + key = "Key0"; + mods = "Control"; + action = "ResetFontSize"; + } + { + key = "Equals"; + mods = "Control"; + action = "IncreaseFontSize"; + } + { + key = "Plus"; + mods = "Control"; + action = "IncreaseFontSize"; + } + { + key = "Minus"; + mods = "Control"; + action = "DecreaseFontSize"; + } + # Vi Mode + { + key = "Space"; + mods = "Control"; + action = "ToggleViMode"; + } + { + key = "Space"; + mods = "Control"; + mode = "Vi"; + action = "ScrollToBottom"; + } + { + key = "I"; + mode = "Vi"; + action = "ScrollToBottom"; + } + { + key = "I"; + mode = "Vi"; + action = "ToggleViMode"; + } + { + key = "C"; + mods = "Control"; + mode = "Vi"; + action = "ScrollToBottom"; + } + { + key = "C"; + mods = "Control"; + mode = "Vi"; + action = "ToggleViMode"; + } + { + key = "Escape"; + mode = "Vi"; + action = "ClearSelection"; + } + { + key = "Y"; + mods = "Control"; + mode = "Vi"; + action = "ScrollLineUp"; + } + { + key = "E"; + mods = "Control"; + mode = "Vi"; + action = "ScrollLineDown"; + } + { + key = "G"; + mode = "Vi"; + action = "ScrollToTop"; + } + { + key = "G"; + mods = "Shift"; + mode = "Vi"; + action = "ScrollToBottom"; + } + { + key = "B"; + mods = "Control"; + mode = "Vi"; + action = "ScrollPageUp"; + } + { + key = "F"; + mods = "Control"; + mode = "Vi"; + action = "ScrollPageDown"; + } + { + key = "U"; + mods = "Control"; + mode = "Vi"; + action = "ScrollHalfPageUp"; + } + { + key = "D"; + mods = "Control"; + mode = "Vi"; + action = "ScrollHalfPageDown"; + } + { + key = "Y"; + mode = "Vi"; + action = "Copy"; + } + { + key = "Y"; + mode = "Vi"; + action = "ClearSelection"; + } + { + key = "V"; + mode = "Vi"; + action = "ToggleNormalSelection"; + } + { + key = "V"; + mods = "Shift"; + mode = "Vi"; + action = "ToggleLineSelection"; + } + { + key = "V"; + mods = "Control"; + mode = "Vi"; + action = "ToggleBlockSelection"; + } + { + key = "V"; + mods = "Alt"; + mode = "Vi"; + action = "ToggleSemanticSelection"; + } + { + key = "Return"; + mode = "Vi"; + action = "Open"; + } + { + key = "K"; + mode = "Vi"; + action = "Up"; + } + { + key = "J"; + mode = "Vi"; + action = "Down"; + } + { + key = "H"; + mode = "Vi"; + action = "Left"; + } + { + key = "L"; + mode = "Vi"; + action = "Right"; + } + { + key = "Up"; + mode = "Vi"; + action = "Up"; + } + { + key = "Down"; + mode = "Vi"; + action = "Down"; + } + { + key = "Left"; + mode = "Vi"; + action = "Left"; + } + { + key = "Right"; + mode = "Vi"; + action = "Right"; + } + { + key = "Key0"; + mode = "Vi"; + action = "First"; + } + { + key = "Key4"; + mode = "Vi"; + action = "Last"; + } + { + key = "Key6"; + mods = "Shift"; + mode = "Vi"; + action = "FirstOccupied"; + } + { + key = "H"; + mods = "Shift"; + mode = "Vi"; + action = "High"; + } + { + key = "M"; + mods = "Shift"; + mode = "Vi"; + action = "Middle"; + } + { + key = "L"; + mods = "Shift"; + mode = "Vi"; + action = "Low"; + } + { + key = "B"; + mode = "Vi"; + action = "SemanticLeft"; + } + { + key = "W"; + mode = "Vi"; + action = "SemanticRight"; + } + { + key = "E"; + mode = "Vi"; + action = "SemanticRightEnd"; + } + { + key = "B"; + mods = "Shift"; + mode = "Vi"; + action = "WordLeft"; + } + { + key = "W"; + mods = "Shift"; + mode = "Vi"; + action = "WordRight"; + } + { + key = "E"; + mods = "Shift"; + mode = "Vi"; + action = "WordRightEnd"; + } + { + key = "Key5"; + mods = "Shift"; + mode = "Vi"; + action = "Bracket"; + } + { + key = "Slash"; + mode = "Vi"; + action = "SearchForward"; + } + { + key = "Slash"; + mods = "Shift"; + mode = "Vi"; + action = "SearchBackward"; + } + { + key = "N"; + mode = "Vi"; + action = "SearchNext"; + } + { + key = "N"; + mods = "Shift"; + mode = "Vi"; + action = "SearchPrevious"; + } + ]; + }; + }; + + #debug: + # Display the time it takes to redraw each frame. + #render_timer: false + + # Keep the log file after quitting Alacritty. + #persistent_logging: false + + # Log level + # + # Values for `log_level`: + # - Off + # - Error + # - Warn + # - Info + # - Debug + # - Trace + #log_level: Warn + + # Renderer override. + # - glsl3 + # - gles2 + # - gles2_pure + #renderer: None + + # Print all received window events. + #print_events: false + + # Highlight window damage information. + #highlight_damage: false + }; + }; +} diff --git a/home-manager/cups/default.nix b/home-manager/cups/default.nix new file mode 100644 index 00000000..f86fa806 --- /dev/null +++ b/home-manager/cups/default.nix @@ -0,0 +1,3 @@ +{config, ...}: { + home-manager.xdg.configFile."cups/lpoptions".text = "Default Brother\n"; +} diff --git a/home-manager/default.nix b/home-manager/default.nix new file mode 100644 index 00000000..ffec4ccc --- /dev/null +++ b/home-manager/default.nix @@ -0,0 +1,29 @@ +# vim: ts=2 +{ + config, + pkgs, + home-manager, + ... +}: { + imports = [ + home-manager.nixosModules.home-manger + + ./alacritty + ./cups + ./firefox + ./gammastep + ./git + ./grades + ./gtk + ./keepassxc + ./latexindent + ./less + ./lf + ./mako + ./mpd + ]; + + home-manager.users.soispha = { + home.packages = []; + }; +} diff --git a/home-manager/firefox/chrome/userChrome.css b/home-manager/firefox/chrome/userChrome.css new file mode 100644 index 00000000..0b3aff77 --- /dev/null +++ b/home-manager/firefox/chrome/userChrome.css @@ -0,0 +1,41 @@ +/* thickness of tab when you have too many open tabs */ +.tabbrowser-tab:not([pinned="true"]) { + min-width: 10px !important; + min-height: 10px !important; +} + +/* tab height +#TabsToolbar .tabbrowser-tabs { +min-height: 10px !important; +} +*/ + +/* +.tabbrowser-tab {min-width: 016px !important;} +.tabbrowser-tab {clip-width: 016px !important;} +*/ + +/* the + button that opens new tabs */ +#TabsToolbar .tabs-newtab-button { + margin-left: 10px !important; + height: Auto !important; +} + +#main-window[privatebrowsingmode="temporary"] #navigator-toolbox { + background-color: #c40944 !important; +} + +/* close button inside a tab */ +.tab-close-button * { + width: 10px !important; + height: 10px !important; +} + +/* bookmark toolbar */ +#personal-bookmarks .bookmark-item > .toolbarbutton-text { + font-size: 10pt !important; +} +#personal-bookmarks .bookmark-item > .toolbarbutton-icon { + height: 12px !important; + width: 12px !important; +} diff --git a/home-manager/firefox/default.nix b/home-manager/firefox/default.nix new file mode 100644 index 00000000..5e9b9632 --- /dev/null +++ b/home-manager/firefox/default.nix @@ -0,0 +1,220 @@ +# vim: ts=2 +{ + config, + pkgs, + lib, + stdenv, + ... +}: let + user_js_override = "./settings/override.js"; + user_js = lib.runCommand "user.js" {} '' + mkdir $out; + ${config.inputs.strip_js_comments}/bin ${config.inputs.user_js} > $out/user.js; + cat ${user_js_override} >> $out/user.js; + sed 's/user_pref(\(.*\)",\(.*\));/\1" = \2;/' $out/user.js > $out/user.nix; + ''; + + # source: https://gitlab.com/rycee/nur-expressions/-/blob/master/pkgs/firefox-addons/default.nix + buildFirefoxXpiAddon = { + pname, + version, + addonId, + url, + sha256, + meta, + ... + }: + builtins.stdenv.mkDerivation { + name = "${pname}-${version}"; + + inherit meta; + + src = builtins.fetchurl {inherit url sha256;}; + + preferLocalBuild = true; + allowSubstitutes = true; + + buildCommand = '' + dst="$out/share/mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}" + mkdir -p "$dst" + install -v -m644 "$src" "$dst/${addonId}.xpi" + ''; + }; + + settings = + pkgs.lib.recursiveUpdate + { + # Allow my custom css + "toolkit.legacyUserProfileCustomizations.stylesheets" = true; + + # might improve performance TODO + "gfx.webrender.all" = true; + + # disable updates (pretty pointless with nix) + "extensions.update.autoUpdateDefault" = false; + "extensions.update.enabled" = false; + "app.update.channel" = "default"; + + "browser.ctrlTab.recentlyUsedOrder" = false; + + "browser.download.useDownloadDir" = true; + "browser.download.dir" = "${config.user.soisha.home}/media/downloads"; + "browser.download.folderList" = 2; # TODO + "browser.download.viewableInternally.typeWasRegistered.svg" = true; + "browser.download.viewableInternally.typeWasRegistered.webp" = true; + "browser.download.viewableInternally.typeWasRegistered.xml" = true; + + # TODO what does this do? + "browser.search.widget.inNavBar" = true; + + "browser.shell.checkDefaultBrowser" = false; + "browser.tabs.loadInBackground" = true; + "browser.urlbar.placeholderName" = "Brave"; + + "general.autoScroll" = true; + + # Set the tabs and bookmarks + "browser.tabs.inTitlebar" = 1; + "browser.toolbars.bookmarks.visibility" = "always"; + + # Theme + "extensions.activeThemeID" = "firefox-alpenglow@mozilla.org"; + "extensions.extensions.activeThemeID" = "firefox-alpenglow@mozilla.org"; + + # highlight all entries when searching + "findbar.highlightAll" = true; + + # TODO + #"extensions.webcompat.enable_picture_in_picture_overrides" = true; + #"extensions.webcompat.enable_shims" = true; + #"extensions.webcompat.perform_injections" = true; + #"extensions.webcompat.perform_ua_overrides" = true; + + # onlykey / copied from a yubikey config + #"security.webauth.u2f" = true; + #"security.webauth.webauthn" = true; + #"security.webauth.webauthn_enable_softtoken" = true; + #"security.webauth.webauthn_enable_usbtoken" = true; + } + builtins.readFile + "${user_js}/user.nix"; +in { + home-manager.users.${config.soisha.user.username} = { + packages = [ + pkgs.firefox-wayland + ]; + sessionVariables = { + # improve touch input & make scrolling smother + MOZ_USE_XINPUT2 = "1"; + # improve wayland support + MOZ_ENABLE_WAYLAND = 1; + XDG_CURRENT_DESKTOP = "river"; + }; + xdg.mimeApps = { + enable = true; + defaultApplications = { + "text/html" = ["firefox.desktop"]; + "x-scheme-handler/http" = ["firefox.desktop"]; + "x-scheme-handler/https" = ["firefox.desktop"]; + "x-scheme-handler/about" = ["firefox.desktop"]; + "x-scheme-handler/unknown" = ["firefox.desktop"]; + }; + }; + programs.firefox = { + enable = true; + package = pkgs.firefox; + extensions = builtins.map buildFirefoxXpiAddon (lib.attrValues (lib.importJSON ./extensions.json)); + profile."default" = { + isDefault = true; + id = 0; + name = "default"; + + userChrome = builtins.readFile "./chrome/userChrome.css"; + + search = { + default = "Brave Search"; + force = true; + + engines = { + "Brave Search" = { + urls = [{template = "https://search.brave.com/search?q={searchTerms}";}]; + iconUpdateURL = "https://cdn.search.brave.com/serp/v1/static/brand/8eabe183f0d1f2cb3e2916b7b20c310efd196d740c8cecd341732fcd396fb665-apple-touch-icon.png"; + updateInterval = 24 * 60 * 60 * 1000; # every day + definedAliases = ["@bs"]; + }; + + "Nix Packages" = { + urls = [ + { + template = "https://search.nixos.org/packages"; + params = [ + { + name = "type"; + value = "packages"; + } + { + name = "query"; + value = "{searchTerms}"; + } + ]; + } + ]; + + icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; + definedAliases = ["@np"]; + }; + + "NixOS Wiki" = { + urls = [{template = "https://nixos.wiki/index.php?search={searchTerms}";}]; + iconUpdateURL = "https://nixos.wiki/favicon.png"; + updateInterval = 24 * 60 * 60 * 1000; # every day + definedAliases = ["@nw"]; + }; + "Bing".metaData.hidden = true; + "Google".metaData.hidden = true; + "Amazon.de".metaData.hidden = true; + }; + }; + + bookmarks = [ + { + name = "Rust::std"; + # TODO + url = "file:///home/dt/.local/share/rustup/toolchains/stable-x86_64-unknown-linux-gnu/share/doc/rust/html/std/all.html"; + } + + { + name = "Feed - Piped"; + url = "https://piped.kavin.rocks/feed"; + } + + { + name = "DeepL Translate"; + url = "https://www.deepl.com/translator#en/de/test"; + } + + { + name = "Google Scholar"; + url = "https://scholar.google.com/"; + } + + { + name = "ArchWiki"; + url = "https://wiki.archlinux.org/"; + } + + { + name = "Arch Package "; + url = "https://archlinux.org/packages/"; + } + + { + name = "layout.css.devPixelsPerPx"; + url = "about:config"; + } + ]; + inherit settings; + }; + }; + }; +} diff --git a/home-manager/firefox/extensions.json b/home-manager/firefox/extensions.json new file mode 100644 index 00000000..a7673612 --- /dev/null +++ b/home-manager/firefox/extensions.json @@ -0,0 +1,30 @@ +{ + "darkreader": { + "pname": "darkreader", + "version": "4.9.62", + "addonId": "addon@darkreader.org", + "url": "https://addons.mozilla.org/firefox/downloads/file/4053589/darkreader-4.9.62.xpi", + "sha256": "sha256:e537a2cee45ed7c26f79ecd3ed362620e3f00d24c158532a58e163a63a3d60cc" + }, + "firenvim": { + "pname": "firenvim", + "version": "0.2.14", + "addonId": "firenvim@lacamb.re", + "url": "https://addons.mozilla.org/firefox/downloads/file/4026386/firenvim-0.2.14.xpi", + "sha256": "sha256:a8c495a59e30eaabbb3fcd188db9b5e28b40bffefe41a3f0fa22ecc58c80c2b6" + }, + "keepassxc-browser": { + "pname": "keepassxc-browser", + "version": "1.8.4", + "addonId": "keepassxc-browser@keepassxc.org", + "url": "https://addons.mozilla.org/firefox/downloads/file/4045866/keepassxc_browser-1.8.4.xpi", + "sha256": "sha256:cc39aa058cb8915cfc88424e2e1cebe3ccfc3f95d7bddb2abd0c4905d2b17719" + }, + "simple-tab-groups": { + "pname": "simple-tab-groups", + "version": "4.7.2.1", + "addonId": "simple-tab-groups@drive4ik", + "url": "https://addons.mozilla.org/firefox/downloads/file/3873608/simple_tab_groups-4.7.2.1.xpi", + "sha256": "sha256:75077589098ca62c00b86cf9554c6120bf8dc04c5f916fe26f84915f5147b2a4" + } +} \ No newline at end of file diff --git a/home-manager/firefox/generate-extension.py b/home-manager/firefox/generate-extension.py new file mode 100755 index 00000000..cfb73542 --- /dev/null +++ b/home-manager/firefox/generate-extension.py @@ -0,0 +1,41 @@ +#!/usr/bin/env python +# source: https://github.com/etu/nixconfig/blob/ba47d577c8bfb4a1c06927c34ece34118f4a0460/modules/graphical/firefox/generate.py + +from concurrent.futures import ThreadPoolExecutor +import json +import os +import requests + +EXTENSIONS = sorted([ + "darkreader", + "firenvim", + "keepassxc-browser", + "simple-tab-groups", +]) + +def index_ext(ext: str): + print(f"Indexing {ext}...") + + resp = requests.get(f"https://addons.mozilla.org/api/v5/addons/addon/{ext}/").json() + rel = resp["current_version"] + + if not rel["file"]["hash"].startswith("sha256:"): + raise ValueError("Unhandled hash type") + + return { + "pname": ext, + "version": rel["version"], + "addonId": resp["guid"], + "url": rel["file"]["url"], + "sha256": rel["file"]["hash"], + } + +if __name__ == "__main__": + outfile = os.path.dirname(os.path.realpath(__file__)) + "/extensions.json" + + with ThreadPoolExecutor() as e: + extensions = {ext: e.submit(index_ext, ext) for ext in EXTENSIONS} + extensions = {k: v.result() for k, v in extensions.items()} + + with open(outfile, "w") as f: + json.dump(extensions, f, indent=2) diff --git a/home-manager/firefox/settings.nix b/home-manager/firefox/settings.nix new file mode 100644 index 00000000..f38e23b3 --- /dev/null +++ b/home-manager/firefox/settings.nix @@ -0,0 +1,660 @@ +{config, ...}: { + settings = { + accessibility.typeaheadfind.flashBar = 0; + + app = { + normandy = { + first_run = false; + migrationsApplied = 12; + startupRolloutPrefs.extensions.webcompat.disabled_shims.AdvertisingDotCom = true; + user_id = "9b445ee0-1055-4b05-ad18-cdcfd8d15cdb"; + }; + + update.lastUpdateTime = { + addon-background-update-timer = 1675712908; + browser-cleanup-thumbnails = 1675795148; + recipe-client-addon-run = 1675774559; + region-update-timer = 1675779021; + rs-experiment-loader-timer = 1675777057; + search-engine-update-timer = 1675777177; + services-settings-poll-changes = 1675710065; + telemetry_modules_ping = 1675779141; + xpi-signature-verification = 1675706945; + }; + }; + + browser = { + anchor_color = "#57e389"; + + bookmarks = { + editDialog.confirmationHintShowCount = 3; + restore_default_bookmarks = false; + }; + + contentblocking = { + category = "custom"; + cfr-milestone.milestone-achieved = 10000; + report.hide_vpn_banner = true; + }; + + contextual-services.contextId = "{c840a4ea-6278-46b7-bb56-21d7faab57dd}"; + + discovery.enabled = false; + + display = { + background_color = "#551a8b"; + foreground_color = "#ffbe6f"; + use_system_colors = true; + }; + + download = { + dir = "/home/dt/media/downloads"; + folderList = 2; + lastDir = "/home/dt/media/downloads"; + panel.shown = true; + viewableInternally.typeWasRegistered.avif = true; + viewableInternally.typeWasRegistered.webp = true; + }; + + eme.ui.firstContentShown = true; + + engagement = { + ctrlTab.has-used = true; + downloads-button.has-used = true; + }; + + firefox-view.feature-tour = { + message = "FIREFOX_VIEW_FEATURE_TOUR"; + screen = ""; + complete = true; + }; + + firefox-view.view-count = 1; + + laterrun.bookkeeping = { + profileCreationTime = 1654872928; + sessionCount = 39; + }; + + migration.version = 133; + + newtabpage = { + activity-stream = { + impressionId = "{ade7a2f2-7d8f-49b0-a684-d2bb3bda1e09}"; + improvesearch.topSiteSearchShortcuts.havePinned = "google"; + }; + pinned = "[]"; + storageVersion = 1; + }; + + pageActions.persistedActions = { + ids = ["bookmark"]; + idsInUrlbar = ["bookmark"]; + idsInUrlbarPreProton = []; + version = 1; + }; + + pagethumbnails.storage_version = 3; + + protections_panel.infoMessage.seen = true; + + proton.toolbar.version = 3; + + region.update.updated = 1675779022; + + "rights.3.shown" = true; + + safebrowsing.provider = { + google4.lastupdatetime = "1675794837495"; + google4.nextupdatetime = "1675796650495"; + mozilla.lastupdatetime = "1675795004767"; + mozilla.nextupdatetime = "1675816604767"; + }; + + search = { + region = "DE"; + separatePrivateDefault.urlbarResult.enabled = false; + }; + + sessionstore.upgradeBackup.latestBuildID = "20230130183437"; + + shell.mostRecentDateSetAsDefault = "1675756595"; + + startup = { + couldRestoreSession.count = 1; + homepage_override.buildID = "20230130183437"; + homepage_override.mstone = "109.0.1"; + lastColdStartupCheck = 1675756594; + page = 3; + upgradeDialog.version = 106; + }; + + tabs.inTitlebar = 1; + + toolbars.bookmarks.visibility = "always"; + + uiCustomization.state = { + placements = { + widget-overflow-fixed-list = []; + unified-extensions-area = ["yt_pause_example_com-browser-action" "_762f9885-5a13-4abd-9c77-433dcd38b8fd_-browser-action"]; + + nav-bar = [ + "back-button" + "forward-button" + "stop-reload-button" + "urlbar-container" + "save-to-pocket-button" + "downloads-button" + "fxa-toolbar-menu-button" + "enhancerforyoutube_maximerf_addons_mozilla_org-browser-action" + "plasma-browser-integration_kde_org-browser-action" + "tab-stash_condordes_net-browser-action" + "addon_darkreader_org-browser-action" + "vim-vixen_i-beam_org-browser-action" + "simple-tab-groups_drive4ik-browser-action" + "e2933bff1d77b6ea81b2df1dda992244e7892b6c_temporary-addon-browser-action" + "74a30c85e187d69156225de1c415366fafa84866_temporary-addon-browser-action" + "e6fd60f4f456c06312d75c0eceabef8ee0c28bbb_temporary-addon-browser-action" + "addon_example_com-browser-action" + "pause_example_com-browser-action" + "stackoverflowtweakstools_richard_com-browser-action" + "keepassxc-browser_keepassxc_org-browser-action" + "firenvim_lacamb_re-browser-action" + ]; + + toolbar-menubar = ["menubar-items"]; + + TabsToolbar = ["tabbrowser-tabs" "new-tab-button" "alltabs-button"]; + PersonalToolbar = ["personal-bookmarks"]; + + seen = [ + "save-to-pocket-button" + "enhancerforyoutube_maximerf_addons_mozilla_org-browser-action" + "plasma-browser-integration_kde_org-browser-action" + "developer-button" + "tab-stash_condordes_net-browser-action" + "addon_darkreader_org-browser-action" + "vim-vixen_i-beam_org-browser-action" + "simple-tab-groups_drive4ik-browser-action" + "_762f9885-5a13-4abd-9c77-433dcd38b8fd_-browser-action" + "e2933bff1d77b6ea81b2df1dda992244e7892b6c_temporary-addon-browser-action" + "74a30c85e187d69156225de1c415366fafa84866_temporary-addon-browser-action" + "e6fd60f4f456c06312d75c0eceabef8ee0c28bbb_temporary-addon-browser-action" + "addon_example_com-browser-action" + "pause_example_com-browser-action" + "yt_pause_example_com-browser-action" + "stackoverflowtweakstools_richard_com-browser-action" + "keepassxc-browser_keepassxc_org-browser-action" + "firenvim_lacamb_re-browser-action" + ]; + dirtyAreaCache = ["nav-bar" "toolbar-menubar" "PersonalToolbar" "unified-extensions-area"]; + currentVersion = 18; + newElementCount = 6; + browser = { + urlbar = { + quicksuggest = { + migrationVersion = 2; + scenario = "history"; + }; + tabToSearch.onboard.interactionsLeft = 0; + tipShownCount.searchTip_onboard = 4; + }; + visited_color = "#cdab8f"; + }; + + datareporting.policy = { + dataSubmissionPolicyAcceptedVersion = 2; + dataSubmissionPolicyNotifiedTime = "1655649367480"; + }; + + devtools = { + aboutdebugging = { + collapsibilities.processes = false; + tmpExtDirPath = "/home/dt/repos/javascript/firefox-extension/YouTube-Extension"; + }; + + debugger = { + pending-selected-location = { + sourceId = "source-file=///home/dt/repos/web/i5/test/silas.html"; + line = 0; + column = 0; + sourceActorId = "server0.conn0.windowGlobal423054278666/source25"; + url = "file=///home/dt/repos/web/i5/test/silas.html"; + }; + prefs-schema-version = 11; + }; + everOpened = true; + netmonitor = { + columnsData = [ + { + name = "status"; + minWidth = 30; + width = 6.67; + } + { + name = "method"; + minWidth = 30; + width = 6.67; + } + { + name = "domain"; + minWidth = 30; + width = 13.33; + } + { + name = "file"; + minWidth = 30; + width = 33.32; + } + { + name = "url"; + minWidth = 30; + width = 25; + } + { + name = "initiator"; + minWidth = 30; + width = 13.33; + } + { + name = "type"; + minWidth = 30; + width = 6.67; + } + { + name = "transferred"; + minWidth = 30; + width = 13.33; + } + { + name = "contentSize"; + minWidth = 30; + width = 6.67; + } + { + name = "waterfall"; + minWidth = 150; + width = 11.11; + } + ]; + customRequest = { + "method" = "GET"; + "url" = ""; + "urlQueryParams" = []; + "headers" = []; + "postBody" = ""; + }; + msg.visibleColumns = ["data" "time"]; + panes-search-height = 1175; + panes-search-width = 466; + }; + performance.recording = { + entries = 134217728; + features = ["screenshots" "js" "cpu"]; + threads = ["GeckoMain" "Compositor" "Renderer" "DOM Worker"]; + }; + + selfxss.count = 5; + + toolbox = { + alwaysOnTop = false; + footer.height = 692; + host = "right"; + previousHost = "bottom"; + selectedTool = "webconsole"; + sidebar.width = 699; + splitconsoleEnabled = true; + }; + + toolsidebar-height.inspector = 350; + "toolsidebar-width.inspector" = 244; # TODO + toolsidebar-width.inspector.splitsidebar = 0; + + webconsole.filter = { + css = true; + filter = { + net = true; + netxhr = true; + }; + + input = { + editor = true; + editorOnboarding = false; + }; + + persistlog = true; + timestampMessages = true; + }; + }; + distribution = { + archlinux.bookmarksProcessed = true; + iniFile.exists = { + appversion = "109.0.1"; + value = true; + }; + }; + + doh-rollout = { + balrog-migration-done = true; + doneFirstRun = true; + home-region = "DE"; + }; + + dom = { + forms.autocomplete.formautofill = true; + push.userAgentID = "5e34b02066224519abd755189f802422"; + security.https_only_mode_ever_enabled = true; + }; + + extensions = { + activeThemeID = "default-theme@mozilla.org"; + blocklist.pingCountVersion = -1; + databaseSchema = 35; + formautofill.creditCards.used = 2; + getAddons = { + cache.lastUpdate = 1675712909; + databaseSchema = 6; + }; + + lastAppBuildId = "20230130183437"; + lastAppVersion = "109.0.1"; + + lastPlatformVersion = "109.0.1"; + + pendingOperations = false; + pictureinpicture.enable_picture_in_picture_overrides = true; + systemAddonSet = { + "schema" = 1; + "addons" = {}; + }; + ui = { + dictionary.hidden = true; + extension.hidden = false; + lastCategory = "addons://list/extension"; + locale.hidden = true; + sitepermission.hidden = true; + theme.hidden = false; + }; + + webcompat = { + enable_shims = true; + perform_injections = true; + perform_ua_overrides = true; + }; + + webextensions = { + ExtensionStorageIDB.migrated = { + "addon@darkreader.org" = true; + "enhancerforyoutube@maximerf.addons.mozilla.org" = true; + "firenvim@lacamb.re" = true; + "keepassxc-browser@keepassxc.org" = true; + "screenshots@mozilla.org" = true; + "simple-tab-groups@drive4ik" = true; + "{762f9885-5a13-4abd-9c77-433dcd38b8fd}" = true; + }; + uuids = { + "doh-rollout@mozilla.org" = "3830b9af-a7ab-45ae-a10a-df08c432e9f7"; + "formautofill@mozilla.org" = "e05754ff-1fe6-4e78-84dc-f5cc845da180"; + "pictureinpicture@mozilla.org" = "d7135e8a-368e-4f92-bd09-e19c0975de7f"; + "screenshots@mozilla.org" = "6a611696-f2f7-41c4-bb4e-a56eda2447a5"; + "webcompat-reporter@mozilla.org" = "99972218-65f7-4a9a-9f1d-8dcd1f86a563"; + "webcompat@mozilla.org" = "71ce01a8-6fa2-4b21-ba57-59b36478daf6"; + "default-theme@mozilla.org" = "f8e9414d-e977-4d2a-8941-93bf72212b01"; + "addons-search-detection@mozilla.com" = "344d2821-32ec-418f-8665-32c5ae14c40b"; + "google@search.mozilla.org" = "caa826ac-7699-4cdc-9a01-3b35145dbb92"; + "wikipedia@search.mozilla.org" = "ee7a4ba4-10d2-440b-a259-33fc62084480"; + "bing@search.mozilla.org" = "bb80bdc4-bd41-47a8-b9d5-10d4a57f2b2d"; + "ddg@search.mozilla.org" = "2ad38783-b68d-41f2-a76d-c4e800f65d64"; + "amazon@search.mozilla.org" = "aac3e95f-8267-4182-b8a2-2b949160adb7"; + "enhancerforyoutube@maximerf.addons.mozilla.org" = "1ecb30aa-dd3a-4e1c-b405-7400176b683a"; + "@contain-facebook" = "7e386381-dd25-43f7-9fcc-c3f541f2a458"; + "addon@darkreader.org" = "9b7b4403-7e99-4138-a9a9-114b72299253"; + "simple-tab-groups@drive4ik" = "3f29df14-5127-4de4-863c-17846549e474"; + "{762f9885-5a13-4abd-9c77-433dcd38b8fd}" = "3f954cd9-0f14-4595-ba83-4dc0f318e002"; + "e2933bff1d77b6ea81b2df1dda992244e7892b6c@temporary-addon" = "b6ad60ec-a560-427d-aaac-c2c568d69495"; + "pause@example.com" = "87db7ee4-2820-4a56-bb94-9d837886e029"; + "yt_pause@example.com" = "ba2218e1-792e-47a5-99ae-942fc46441fd"; + "keepassxc-browser@keepassxc.org" = "00b8fb40-3ba7-4a33-b086-cb71c5bbe952"; + "firenvim@lacamb.re" = "cf26e07b-4e07-4a42-978f-30f92409ae88"; + }; + }; + }; + + findbar.highlightAll = true; + + fission.experiment.max-origins = { + last-disqualified = 1675596365; + last-qualified = 1675793855; + qualified = false; + }; + + gecko.handlerService.defaultHandlersVersion = 1; + + gfx.blacklist = { + layers.opengl.failureid = "FEATURE_FAILURE_SOFTWARE_GL"; + + "vaapi" = 4; + "vaapi.failureid" = "FEATURE_FAILURE_VAAPI_TEST_FAILED"; + }; + + idle.lastDailyNotification = 1675756850; + + intl.regional_prefs.use_os_locales = true; + + media = { + eme.enabled = true; + + gmp-gmpopenh264 = { + abi = "x86_64-gcc3"; + lastDownload = 1668329402; + lastDownloadFailReason = "Error: Failed downloading via ServiceRequest, status: 0, reason: error"; + lastDownloadFailed = 1666889531; + lastInstallStart = 1668329400; + lastUpdate = 1668329402; + version = "1.8.1.2"; + }; + + gmp-manager = { + buildID = "20230130183437"; + lastCheck = 1675756691; + lastEmptyCheck = 1675756691; + }; + + gmp-widevinecdm = { + abi = "x86_64-gcc3"; + lastDownload = 1674828538; + lastInstallStart = 1674828533; + lastUpdate = 1674828538; + version = "4.10.2557.0"; + }; + + gmp.storage.version.observed = 1; + + videocontrols.picture-in-picture.video-toggle.enabled = false; + }; + + network = { + cookie.cookieBehavior = 1; + http.referer.disallowCrossSiteRelaxingDefault.top_navigation = true; + }; + + pdfjs = { + enabledCache.state = true; + migrationVersion = 2; + }; + + permissions.default = { + camera = 2; + desktop-notification = 2; + geo = 2; + microphone = 2; + xr = 2; + }; + + places.database.lastMaintenance = 1675756852; + + pref.privacy.disable_button = { + tracking_protection_exceptions = false; + view_passwords = false; + }; + + print = { + more-settings.open = true; + print = { + printer_Brother.print_in_color = false; + + printer_Brother_DCP_9022CDW = { + print_duplex = 0; + print_footercenter = ""; + print_footerleft = ""; + print_footerright = ""; + print_headercenter = ""; + print_headerleft = ""; + print_headerright = ""; + print_in_color = false; + }; + }; + + print_printer = "Brother_DCP_9022CDW"; + }; + + privacy = { + annotate_channels.strict_list.enabled = true; + donottrackheader.enabled = true; + partition.network_state.ocsp_cache = true; + + purge_trackers = { + date_in_cookie_database = "0"; + last_purge = "1675756851136"; + }; + + "query_stripping.enabled" = true; # TODO + query_stripping.enabled.pbmode = true; + + restrict3rdpartystorage.rollout.enabledByDefault = true; + + sanitize.pending = [ + { + "id" = "newtab-container"; + "itemsToClear" = []; + "options" = {}; + } + ]; + + trackingprotection = { + enabled = true; + socialtracking.enabled = true; + }; + + userContext = { + enabled = true; + extension = "simple-tab-groups@drive4ik"; + ui.enabled = true; + }; + }; + + security = { + remote_settings = { + crlite_filters.checked = 1656529337; + intermediates.checked = 1656529337; + }; + + sandbox.content.tempDirSuffix = "86b82f75-b18b-4db2-a563-ba4380a07a97"; + }; + + services = { + blocklist = { + addons-mlbf.checked = 1656684436; + gfx.checked = 1656684436; + }; + + settings = { + blocklists = { + addons-bloomfilters.last_check = 1675773838; + gfx.last_check = 1675772639; + }; + + clock_skew_seconds = 0; + last_etag = 1675795222827; + last_update_seconds = 1675795598; + + main = { + addons-manager-settings.last_check = 1675772639; + anti-tracking-url-decoration.last_check = 1675772639; + cfr.last_check = 1675772639; + cookie-banner-rules-list.last_check = 1675772639; + devtools-compatibility-browsers.last_check = 1675772639; + devtools-devices.last_check = 1675772639; + doh-config.last_check = 1675772639; + doh-providers.last_check = 1675772639; + fxmonitor-breaches.last_check = 1675772639; + hijack-blocklists.last_check = 1675772639; + language-dictionaries.last_check = 1675772639; + message-groups.last_check = 1675772639; + ms-images.last_check = 1675772639; + nimbus-desktop-experiments.last_check = 1675793197; + normandy-recipes-capabilities.last_check = 1675772639; + partitioning-exempt-urls.last_check = 1675772639; + password-recipes.last_check = 1675772639; + password-rules.last_check = 1675772639; + personality-provider-models.last_check = 1675772639; + personality-provider-recipe.last_check = 1675772639; + pioneer-study-addons-v1.last_check = 1675772639; + public-suffix-list.last_check = 1675772639; + query-stripping.last_check = 1675772639; + search-config.last_check = 1675772639; + search-default-override-allowlist.last_check = 1675772639; + search-telemetry-v2.last_check = 1675772639; + sites-classification.last_check = 1675772639; + tippytop.last_check = 1675772639; + top-sites.last_check = 1675772639; + url-classifier-skip-urls.last_check = 1675772639; + websites-with-shared-credential-backends.last_check = 1675772639; + whats-new-panel.last_check = 1675772639; + }; + + security-state = { + cert-revocations.last_check = 1675772639; + intermediates.last_check = 1675772639; + onecrl.last_check = 1675772639; + }; + security.onecrl.checked = 1656529337; + }; + + sync = { + clients.lastSync = "0"; + declinedEngines = ""; + globalScore = 0; + nextSync = 0; + tabs.lastSync = "0"; + }; + }; + + signon.rememberSignons = false; + + storage.vacuum.last = { + index = 1; + places.sqlite = 1673364894; + }; + + svg.context-properties.content.enabled = true; + + toolkit = { + legacyUserProfileCustomizations.stylesheets = true; + + startup.last_success = 1675756592; + + telemetry = { + cachedClientID = "7d88e3fb-f77d-4d7e-8aa5-623d7349a4dc"; + pioneer-new-studies-available = true; + reportingpolicy.firstRun = false; + previousBuildID = "20230130183437"; + }; + }; + + trailhead.firstrun.didSeeAboutWelcome = true; + }; + }; + }; + }; +} diff --git a/home-manager/firefox/settings/override.js b/home-manager/firefox/settings/override.js new file mode 100644 index 00000000..1f92735b --- /dev/null +++ b/home-manager/firefox/settings/override.js @@ -0,0 +1,137 @@ +/* + 0100: STARTUP + 0200: GEOLOCATION / LANGUAGE / LOCALE + 0300: QUIETER FOX + 0400: SAFE BROWSING + 0600: BLOCK IMPLICIT OUTBOUND + 0700: DNS / DoH / PROXY / SOCKS / IPv6 + 0800: LOCATION BAR / SEARCH BAR / SUGGESTIONS / HISTORY / FORMS + 0900: PASSWORDS + 1000: DISK AVOIDANCE + 1200: HTTPS (SSL/TLS / OCSP / CERTS / HPKP) + 1400: FONTS + 1600: HEADERS / REFERERS + 1700: CONTAINERS + 2000: PLUGINS / MEDIA / WEBRTC + 2400: DOM (DOCUMENT OBJECT MODEL) + 2600: MISCELLANEOUS + 2700: ETP (ENHANCED TRACKING PROTECTION) + 2800: SHUTDOWN & SANITIZING + 4500: RFP (RESIST FINGERPRINTING) + 5000: OPTIONAL OPSEC + 5500: OPTIONAL HARDENING + 6000: DON'T TOUCH + 7000: DON'T BOTHER + 8000: DON'T BOTHER: FINGERPRINTING + 9000: NON-PROJECT RELATED + 9999: DEPRECATED / REMOVED / LEGACY / RENAMED +*/ + + +// restore session +user_pref("browser.startup.page", 3); // 0102 + +user_pref("browser.startup.homepage", "file:///home/dt/home.html"); // 0103 +user_pref("browser.newtabpage.enabled", true); // 0104 + +// disable the geoservice, TODO don't know if I want this +//user_pref("geo.provider.use_geoclue", false); // 0202 + +// TODO is this something useful? +user_pref("datareporting.policy.dataSubmissionEnabled", true); // 0330 + +// enable health reports +user_pref("datareporting.healthreport.uploadEnabled", true); // 0331 + +// Do I want to opt-out? +user_pref("toolkit.telemetry.coverage.opt-out", false); // 0333 + +// enables studies +user_pref("app.shield.optoutstudies.enabled", true); // 0340 + +// I guess that browsing protection is useful +user_pref("browser.safebrowsing.downloads.remote.enabled", true); // 0403 + +// TODO does this (-> set to false) make things slower? +user_pref("network.prefetch-next", true); // 0601 + +// enable ipv6 because the rest of the system uses it +user_pref("network.dns.disableIPv6", true); // 0701 + +// TRR only +user_pref("network.trr.mode", 3); // 0710 + +// I trust my search engine +user_pref("keyword.enabled", true); // 801 +user_pref("browser.search.suggest.enabled", true); // 0804 +user_pref("browser.urlbar.suggest.searches", true); // 0804 + +// prefetch urls, if the get auto completed +user_pref("browser.urlbar.speculativeConnect.enabled", true); // 0805 + +// TODO I might want to enable this +//user_pref("browser.urlbar.suggest.quicksuggest.nonsponsored", false); // 0807 + +// TODO enable form and search history? +//user_pref("browser.formfill.enable", false); // 0810 + +// disk cache should help performance +user_pref("browser.cache.disk.enable", true); // 1001 + +// store extra session data (form content, cookies and POST data) 0: everywhere +user_pref("browser.sessionstore.privacy_level", 0); // 1003 + +// Disable unsafe passive content (images) on https sites +user_pref("security.mixed_content.block_display_content", true); // 1241 + +// Disable the eme banner +user_pref("browser.eme.ui.enabled", false); // 2022 + +// Don't delete my precious temp files +user_pref("browser.helperApps.deleteTempFileOnExit", false); // 2603 + +// Download to the download dir +user_pref("browser.download.useDownloadDir", true); // 2651 + +// Open the download panel +user_pref("browser.download.alwaysOpenPanel", true); // 2652 + +// Block after custom ruleset +user_pref("browser.contentblocking.category", "custom"); // 2701 + +// set the custome settings // 7016 +user_pref("network.cookie.cookieBehavior", 1); +user_pref("network.http.referer.disallowCrossSiteRelaxingDefault", true); +user_pref("network.http.referer.disallowCrossSiteRelaxingDefault.top_navigation", true); +user_pref("privacy.partition.network_state.ocsp_cache", true); +user_pref("privacy.query_stripping.enabled", true); +user_pref("privacy.trackingprotection.enabled", true); +user_pref("privacy.trackingprotection.socialtracking.enabled", true); +user_pref("privacy.trackingprotection.cryptomining.enabled", true); +user_pref("privacy.trackingprotection.fingerprinting.enabled", true); + + +// I might want to change that, when it hinders session restore +//user_pref("privacy.partition.always_partition_third_party_non_cookie_storage.exempt_sessionstorage", false); // 2720 + +// I like my history very much! +user_pref("privacy.sanitize.sanitizeOnShutdown", false); // 2810 + +// The downsides (light theme + potential breakages): +//user_pref("privacy.resistFingerprinting", true); // 4501 +user_pref("privacy.resistFingerprinting.letterboxing", false); // 4504 + +// I would like to keep my gl, even in the web +user_pref("webgl.disabled", false); // 4520 + +// I like my service workers and am using a service using them. +user_pref("dom.serviceWorkers.enabled", true); // 7017 + +// I've got a password manager already +user_pref("signon.rememberSignons", false); // 5003 + +// Do not track header +user_pref("privacy.donottrackheader.enabled", true); // 7015 + +// TODO no idea what this does, enabling it +user_pref("browser.urlbar.showSearchTerms.enabled", true); // 9004 diff --git a/home-manager/firefox/unzip_mozlz4.py b/home-manager/firefox/unzip_mozlz4.py new file mode 100755 index 00000000..311fd214 --- /dev/null +++ b/home-manager/firefox/unzip_mozlz4.py @@ -0,0 +1,43 @@ +#!/usr/bin/python +# source: https://unix.stackexchange.com/a/497861 +# Command-line tool to decompress mozLz4 files used for example by Firefox to store various kinds of session backup information. +# Works in both Python 2.7.15 and 3.6.7, as of version 2.1.6 of the LZ4 Python bindings at pypi.org/project/lz4. +# To use in another script, simply cut and paste the import statement and the mozlz4_to_text() function (lines 8 to 17). + +import lz4.block # pip install lz4 --user + + +def mozlz4_to_text(filepath): + # Given the path to a "mozlz4", "jsonlz4", "baklz4" etc. file, + # return the uncompressed text. + bytestream = open(filepath, "rb") + bytestream.read(8) # skip past the b"mozLz40\0" header + valid_bytes = bytestream.read() + text = lz4.block.decompress(valid_bytes) + return text + + +def main(args): + # Given command-line arguments of an input filepath for a ".mozlz4" file + # and optionally an output filepath, write the decompressed text to the + # output filepath. + # Default output filepath is the input filepath minus the last three characters + # (e.g. "foo.jsonlz4" becomes "foo.json") + filepath_in = args[0] + if len(args) < 2: + filepath_out = filepath_in[:-3] + else: + filepath_out = args[1] + text = mozlz4_to_text(filepath_in) + with open(filepath_out, "wb") as outfile: + outfile.write(text) + print("Wrote decompressed text to {}".format(filepath_out)) + + +if __name__ == "__main__": + import sys + args = sys.argv[1:] + if args and not args[0] in ("--help", "-h"): + main(args) + else: + print("Usage: mozlz4.py <mozlz4 file to read> <location to write>") diff --git a/home-manager/gammastep/default.nix b/home-manager/gammastep/default.nix new file mode 100644 index 00000000..75c5630f --- /dev/null +++ b/home-manager/gammastep/default.nix @@ -0,0 +1,20 @@ +{config, ...}: { + home-manager.services.gammastep = { + enable = true; + settings = { + general = { + temp-day = 1300; + temp-night = 1300; + gamma = "0.8:0.8:0.8"; + fade = 0; + adjustment-method = "wayland"; + location-provider = "manual"; + }; + + manual = { + lat = 48.1; + lon = 11.6; + }; + }; + }; +} diff --git a/home-manager/git/default.nix b/home-manager/git/default.nix new file mode 100644 index 00000000..179c449b --- /dev/null +++ b/home-manager/git/default.nix @@ -0,0 +1,141 @@ +{ + config, + pkgs, + ... +}: let + gitTemplateFile = + pkgs.writeText "git_template.git" + '' + # Title: Summary, imperative, start upper case, don't end with a period + # If applied, this commit will <your Title> + + # Body: Explain *what* and *why* (not *how*). + + + # BREAKING CHANGE: <description> + # Fixes: # + # Refs: # + # Co-authored-by: <name> <email> + + + + # Convention Commits (https://www.conventionalcommits.org/en/v1.0.0/): + # feat: [Features] -> MINOR version bump + # A new feature + # + # fix: [Bug Fixes] -> PATCH version bump + # A bug fix + # + # append '!' after the type/scope: [Breaking Change] -> MAJOR version bump + # A breaking API change + # + # docs: [Documentation] + # Documentation only changes + # + # style: [Styles] + # Changes that do not affect the meaning of the code + # (white-space, formatting, missing semi-colons, etc) + # + # refactor: [Code Refactoring] + # A code change that neither fixes a bug nor adds a feature + # + # perf: [Performance Improvements] -> PATCH version bump + # A code change that improves performance + # + # test: [Tests] + # Adding missing tests or correcting existing tests + # + # build: [Builds] -> PATCH version bump + # Changes that affect the build system or external dependencies + # (example scopes: gulp, broccoli, npm) + # + # ci: [Continuous Integrations] + # Changes to our CI configuration files and scripts + # (example scopes: Travis, Circle, BrowserStack, SauceLabs) + # + # chore: [Chores] + # Other changes that don't modify src or test files + # + # reverts: [Reverts] + # Reverts a previous commit + + # How to Write a Git Commit Message: + # [https://chris.beams.io/posts/git-commit/] -> https://cbea.ms/git-commit/ + # + # 1. Separate subject from body with a blank line + # 2. Limit the subject line to 50 characters + # 3. Capitalize the subject line + # 4. Do not end the subject line with a period + # 5. Use the imperative mood in the subject line + # 6. Wrap the body at 72 characters + # 7. Use the body to explain *what* and *why* vs. *how* + ''; + + gitConfig = { + init = { + defaultBranch = "prime"; + }; + credential = { + helper = "cache --timeout 43200"; + }; + user = { + email = "ene@sils.li"; + name = "ene"; + }; + help = { + autocorrect = 5; + }; + commit = { + template = "${gitTemplateFile}"; + }; + }; +in { + home-manager.programs.git = { + enable = true; + #package = pkgs.gitAndTools.gitFull; # TODO for git send-email support + aliases = { + st = "status"; + + ## Logging: + ls = "log --max-count=10 --color --format=format:'%C(bold red)%h%C(reset) %C(dim bold blue)%s%C(reset) %C(dim white)[%aN]' "; + + # https://stackoverflow.com/a/61487052 + lg = "lg1"; + lg1 = "lg1-specific --all"; + lg2 = "lg2-specific --all"; + lg3 = "lg3-specific --all"; + + lg1-specific = "log --graph --abbrev-commit --decorate \ + --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(auto)%d%C(reset)'"; + + lg2-specific = "log --graph --abbrev-commit --decorate \ + --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(auto)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)'"; + + lg3-specific = "log --graph --abbrev-commit --decorate \ + --format=format:'%C(bold blue)%h%C(reset)\ + - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)\ + %C(bold cyan)(committed: %cD)%C(reset) %C(auto)%d%C(reset)%n\ + '' %C(white)%s%C(reset)%n'' \ + %C(dim white)- %an <%ae> %C(reset) %C(dim white)(committer: %cn <%ce>)%C(reset)'"; + }; + extraConfig = gitConfig; + delta = { + enable = true; + options = { + decorations = { + commit-decoration-style = "bold yellow box ul"; + file-decoration-style = "none"; + file-style = "bold yellow ul"; + }; + features = "decorations"; + whitespace-error-style = "22 reverse"; + }; + }; + signing = { + key = null; #let gpg2 decide, based on the author + signByDefault = true; + }; + }; +} +# vim: ts=2 + diff --git a/home-manager/grades/config.yaml b/home-manager/grades/config.yaml new file mode 100644 index 00000000..ebbc61f8 --- /dev/null +++ b/home-manager/grades/config.yaml @@ -0,0 +1,59 @@ +--- +# The unit of your grades. +# This can also be specified +# on a per grade basis on the command line +unit: Punkte + +# List of the possible grade groups +# +# name: +# This is the name used below +# +# weight: +# This is the weight applied to all grades form the group +# when calculation the average (see https://en.wikipedia.org//wiki/Weighted_arithmetic_mean for a explanation). +grade_groups: + - name: major + weight: '2' + - name: minor + weight: '1' + +# List of the types of grades. +# +# name: +# This is the name used on the command line. +# NB: The name is case sensitive. +# +# group: +# This is used when calculating the average, to group multiple types together. +# You might want to use separate types to keep grades ordered, +# but calculate their average as one. +# The value is one of the names you declared in the grade_group section. +grade_types: + - name: graded-homework + group: minor + - name: exam + group: major + - name: oral-mark + group: minor + +# List of the types of Classes +# +# name: +# The name used below +class_types: + - name: subsidiary-subject + - name: intensified-course + +# List of classes +# +# name: +# The name used on the cli +# +# class_type: +# The name of the class type you declared above +classes: + - name: Math + class_type: intensified-course2 + - name: English + class_type: subsidiary-subject diff --git a/home-manager/grades/default.nix b/home-manager/grades/default.nix new file mode 100644 index 00000000..8cca9640 --- /dev/null +++ b/home-manager/grades/default.nix @@ -0,0 +1,7 @@ +{config, ...}: { + home-manager.xdg.configFile."grades/config.yaml" = { + enable = true; + target = "grades/config.yaml"; + source = "./config.yaml"; + }; +} diff --git a/home-manager/gtk/default.nix b/home-manager/gtk/default.nix new file mode 100644 index 00000000..d72986d5 --- /dev/null +++ b/home-manager/gtk/default.nix @@ -0,0 +1,58 @@ +{ + config, + pkgs, + ... +}: { + home-manager.gkt = { + enable = true; + theme = { + package = pkgs.nordic; + name = "Nordic"; + }; + cursorTheme = { + package = pkgs.nordzy-cursor-theme; + name = "Nordzy-cursors"; + }; + iconTheme = { + package = pkgs.nordzy-icon-theme; + name = "Nordzy-icon"; + }; + font = { + name = "Noto Sans"; + size = 10; + }; + gtk2 = { + configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc"; + # extraConfig = '' + # gtk-enable-animations=1 + # gtk-primary-button-warps-slider=0 + # gtk-toolbar-style=3 + # gtk-menu-images=1 + # gtk-button-images=1 + # + # ''; + }; + gtk3 = { + # extraConfig = '' + # gtk-button-images=true + # gtk-decoration-layout=icon:minimize,maximize,close + # gtk-enable-animations=true + # gtk-menu-images=true + # gtk-primary-button-warps-slider=false + # gtk-toolbar-style=3 + # #gtk-modules=window-decorations-gtk-module:colorreload-gtk-module + # ''; + extraCss = ""; + }; + gtk4 = { + # extraConfig = '' + # gtk-application-prefer-dark-theme=true + # gtk-decoration-layout=icon:minimize,maximize,close + # gtk-enable-animations=true + # gtk-primary-button-warps-slider=false + # ''; + }; + }; +} +# vim: ts=2 + diff --git a/home-manager/keepassxc/default.nix b/home-manager/keepassxc/default.nix new file mode 100644 index 00000000..dfe89e35 --- /dev/null +++ b/home-manager/keepassxc/default.nix @@ -0,0 +1,12 @@ +{ + config, + pkgs, + ... +}: { + home-manager.xdg.configFile."keepassxc/keepassxc.ini" = { + target = "keepassxc/keepassxc.ini"; + source = "./keepasxc.ini"; + }; +} +# vim: ts=2 + diff --git a/home-manager/keepassxc/keepassxc.ini b/home-manager/keepassxc/keepassxc.ini new file mode 100644 index 00000000..ee10d691 --- /dev/null +++ b/home-manager/keepassxc/keepassxc.ini @@ -0,0 +1,58 @@ +[General] +AutoSaveAfterEveryChange=true +BackupBeforeSave=true +BackupFilePathPattern=/home/dt/.local/share/keepassxc/{DB_FILENAME}.old.kdbx +ConfigVersion=2 +HideWindowOnCopy=false + +[Browser] +CustomProxyLocation= +Enabled=true + +[FdoSecrets] +Enabled=true + +[GUI] +AdvancedSettings=true +ApplicationTheme=dark +CompactMode=false +HidePasswords=true +ShowExpiredEntriesOnDatabaseUnlockOffsetDays=1 +TrayIconAppearance=monochrome-light + +[KeeShare] +Active="<?xml version=\"1.0\"?><KeeShare><Active/></KeeShare>\n" +Own="<?xml version=\"1.0\"?><KeeShare><PrivateKey>MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQC70HR8Lq7Sgg9cjJQ6qWnPywUl48IDhI93CYhg7VC7sEsMjNCyUqUpYpkO40lg3slmkWgB8XXa7MUa4DDZo2V4qXz+E5WfZLnr77B64n2WqTAsx7HqQjRw1SOLBceXxU3Zh7486fdekeg/mgJQPcU+snh1JeMqRqHGvtVo4hGM4TOwWjbQ8gRZmqPBELCLry2Dj4m2/swFZo3yARwnSpMBO5IyKq9aAZctKxQG4EeFJcm6MiZ2UkrDUe9RI8x9LwhIbDZ8G2WEy82dESaj4KOSRiz1XCiQ54wqE/MYDWzBUXA8+Q+vyuKXKUKU2RY5ScXCaLHUzBwcU7tX8HeThs5NAgMBAAECggEAIoMF4KroY5TUM06+zz/BypX1IncFeAWEIlzdU2hQYUjeJZZ7pAUFRgNQ+lggK/2MVz1pdg/zdvDysENZnqiElSVZ60tYf3NwKa+AB7i2WLjKujPQ2Onk/oXf8+QyPsyaB1rHBaT9mIJpwcQwYCPVqrV7ZpV5dpOHl0CKcS03ieIoa5UOGB8bx35xkDtSW27tyyfdtAdkycni22MdHbgVYozUkpVnwtxGqg0zBxTQWxzhD+qVNxGBhT0HZNLz7qQOGghoDsDXkYWvbcJmnOLA9FvH7ihdDw5LjsWQf+rUwCxCKX4JLpSAhkGcEIz1yvlmJR1kWD0NnJDkKvGZxnpXsQKBgQDjp9fgxMx8k9apFzSaIaA77D9aJBGR9QHuewhd4EJR7tCqyjV9CZ+V86T8pqDTtCAEyvmO7VPiHuw2ZzgrzZLr2Suy2fur53AdWDk7PYrWjUtYolyVdsTWHdGoyPksSZM/1biCVW4eY986R9wHnn88m1X4Rz52BC0m22cNrVUbnQKBgQDTMruJXWegrytWdJcx8VoD81WA0/pqbTB9qMoaoR4i/VYK1BGyFnnwuMpoAAX72yhMbJRSLdIO5eQXNHleMLEKEkrWkQIkwYGyvGkTEM7bDWoAIdLA8MV6ad/1G9txT/QtH9PlQYpK65RB1L6Nabgeavwultb5izkuRzIb/mS2cQKBgQDXD10hieg/G44i6LgZjwCG+zQR3Jb4kkMD3hhWTp94NSnM3f9PosKubp+CyYqO08+Xl4PPoKWorFurPTFUN/y+bscYS1Kz34wLPKe8LfQ1oP73uVHLJIroVv0T/N9fFhZTrHuELF49uU1NCktyqyk5wOijBfKcnG9nEMc2pXMMBQKBgQCMsCn/aopinu3mrMofSeCl6w4VQKB7DvuTacIgFR4nPs13byfOk2xtsBudRg62ZJqmtlnjmIRqyje0QY9r8FGvHNpfrr9XztPgReRVAAhcIcZwChgD0SAr2KWI+SKojBNjj+Uuvgcqu13KsLazKy6sjKYrPu4708OmkWTPAxsB8QKBgB7rvH8tRZQqUGYVW0+Q89jmUNK/MFGiIUMLBA9d45sEG6daDdDMXPV/M/uvwVyr3iUPIZpKTtM1kjz60P2zQKXIlGwkfdXiNg+fq9cfY0NE0tyckZubi8/P8+Uw6AkU70i7zwVWRm8/r3QliThjLLq1GiKrkvaXTG7ATAOpPYdU</PrivateKey><PublicKey><Signer>dt</Signer><Key>MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQC70HR8Lq7Sgg9cjJQ6qWnPywUl48IDhI93CYhg7VC7sEsMjNCyUqUpYpkO40lg3slmkWgB8XXa7MUa4DDZo2V4qXz+E5WfZLnr77B64n2WqTAsx7HqQjRw1SOLBceXxU3Zh7486fdekeg/mgJQPcU+snh1JeMqRqHGvtVo4hGM4TOwWjbQ8gRZmqPBELCLry2Dj4m2/swFZo3yARwnSpMBO5IyKq9aAZctKxQG4EeFJcm6MiZ2UkrDUe9RI8x9LwhIbDZ8G2WEy82dESaj4KOSRiz1XCiQ54wqE/MYDWzBUXA8+Q+vyuKXKUKU2RY5ScXCaLHUzBwcU7tX8HeThs5NAgMBAAECggEAIoMF4KroY5TUM06+zz/BypX1IncFeAWEIlzdU2hQYUjeJZZ7pAUFRgNQ+lggK/2MVz1pdg/zdvDysENZnqiElSVZ60tYf3NwKa+AB7i2WLjKujPQ2Onk/oXf8+QyPsyaB1rHBaT9mIJpwcQwYCPVqrV7ZpV5dpOHl0CKcS03ieIoa5UOGB8bx35xkDtSW27tyyfdtAdkycni22MdHbgVYozUkpVnwtxGqg0zBxTQWxzhD+qVNxGBhT0HZNLz7qQOGghoDsDXkYWvbcJmnOLA9FvH7ihdDw5LjsWQf+rUwCxCKX4JLpSAhkGcEIz1yvlmJR1kWD0NnJDkKvGZxnpXsQKBgQDjp9fgxMx8k9apFzSaIaA77D9aJBGR9QHuewhd4EJR7tCqyjV9CZ+V86T8pqDTtCAEyvmO7VPiHuw2ZzgrzZLr2Suy2fur53AdWDk7PYrWjUtYolyVdsTWHdGoyPksSZM/1biCVW4eY986R9wHnn88m1X4Rz52BC0m22cNrVUbnQKBgQDTMruJXWegrytWdJcx8VoD81WA0/pqbTB9qMoaoR4i/VYK1BGyFnnwuMpoAAX72yhMbJRSLdIO5eQXNHleMLEKEkrWkQIkwYGyvGkTEM7bDWoAIdLA8MV6ad/1G9txT/QtH9PlQYpK65RB1L6Nabgeavwultb5izkuRzIb/mS2cQKBgQDXD10hieg/G44i6LgZjwCG+zQR3Jb4kkMD3hhWTp94NSnM3f9PosKubp+CyYqO08+Xl4PPoKWorFurPTFUN/y+bscYS1Kz34wLPKe8LfQ1oP73uVHLJIroVv0T/N9fFhZTrHuELF49uU1NCktyqyk5wOijBfKcnG9nEMc2pXMMBQKBgQCMsCn/aopinu3mrMofSeCl6w4VQKB7DvuTacIgFR4nPs13byfOk2xtsBudRg62ZJqmtlnjmIRqyje0QY9r8FGvHNpfrr9XztPgReRVAAhcIcZwChgD0SAr2KWI+SKojBNjj+Uuvgcqu13KsLazKy6sjKYrPu4708OmkWTPAxsB8QKBgB7rvH8tRZQqUGYVW0+Q89jmUNK/MFGiIUMLBA9d45sEG6daDdDMXPV/M/uvwVyr3iUPIZpKTtM1kjz60P2zQKXIlGwkfdXiNg+fq9cfY0NE0tyckZubi8/P8+Uw6AkU70i7zwVWRm8/r3QliThjLLq1GiKrkvaXTG7ATAOpPYdU</Key></PublicKey></KeeShare>\n" +QuietSuccess=true + +[PasswordGenerator] +AdditionalChars= +AdvancedMode=true +Braces=true +Dashes=true +EASCII=true +ExcludedChars= +Length=128 +Logograms=true +LowerCase=true +Math=true +Numbers=true +Punctuation=true +Quotes=true +SpecialChars=true +Type=0 +UpperCase=true +WordCount=4 +WordSeparator="," + +[SSHAgent] +Enabled=true + +[Security] +HidePasswordPreviewPanel=true +IconDownloadFallback=true +LockDatabaseIdle=false +LockDatabaseIdleSeconds=960 +PasswordEmptyPlaceholder=true +PasswordsHidden=true +PasswordsRepeatVisible=true diff --git a/home-manager/latexindent/default.nix b/home-manager/latexindent/default.nix new file mode 100644 index 00000000..657382ca --- /dev/null +++ b/home-manager/latexindent/default.nix @@ -0,0 +1,16 @@ +{ + config, + pkgs, + ... +}: { + home-manager.xdg.configFile."latexindent/indentconfig.yaml" = { + target = "latexindent/indentconfig.yaml"; + source = "./indentconfig.yaml"; + }; + home-manager.xdg.configFile."latexindent/mysettings.yaml" = { + target = "latexindent/mysettings.yaml"; + source = "./mysettings.yaml"; + }; +} +# vim: ts=2 + diff --git a/home-manager/latexindent/indentconfig.yaml b/home-manager/latexindent/indentconfig.yaml new file mode 100644 index 00000000..d67351f3 --- /dev/null +++ b/home-manager/latexindent/indentconfig.yaml @@ -0,0 +1,2 @@ +paths: +- /home/dt/.config/latexindent/mysettings.yaml diff --git a/home-manager/latexindent/mysettings.yaml b/home-manager/latexindent/mysettings.yaml new file mode 100644 index 00000000..9a0f8b2f --- /dev/null +++ b/home-manager/latexindent/mysettings.yaml @@ -0,0 +1,672 @@ +# defaultSettings.yaml for latexindent.pl, version 3.19.1, 2022-12-04 +# a script that aims to +# beautify .tex, .sty, .cls files +# +# (or latexindent.exe if you're on Windows) +# +#--------------------------------------------------------------------------------------- +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# See http://www.gnu.org/licenses/. +# +# Chris Hughes, 2017 +# +# For all communication, please visit: https://github.com/cmhughes/latexindent.pl +# +#--------------------------------------------------------------------------------------- +# You should feel encouraged to change anything you like in these settings, but +# it would probably be better to have your own user settings +# files somewhere else - remember that this file may be overwritten +# when you update your tex distribution. Please see the manual linked from: +# +# https://github.com/cmhughes/latexindent.pl +# +# for details of how to create and configure your own settings files. +# +# Please read the manual (linked from above) first to understand what each switch does. +# +#--------------------------------------------------------------------------------------- + +# latexindent can be called to act on a file without using the file's extension, +# e.g, simply +# latexindent myfile +# in which case the choice of file extension is chosen +# according to the choices made in fileExtensionPreference +# Other file extensions can be added. +fileExtensionPreference: + .tex: 1 + .sty: 2 + .cls: 3 + .bib: 4 + +# default file extension of backup file (if -w switch is active) +# for example, if your .tex file is called +# myfile.tex +# and you specify the backupExtension as BACKUP.bak then your +# backup file will be +# myfileBACKUP.bak +backupExtension: .bak + +# only one backup per file: +# - if onlyOneBackUp is 0 then, as a safety measure, +# the number on the extension increments by 1 each time: +# +# myfile.bak0, myfile.bak1, myfile.bak2 +# - if you set onlyOnebackUp to 1, then the backup file will +# be overwritten each time (not recommended until you trust the script) +onlyOneBackUp: 0 + +# some users may want a finite number of backup files, +# say at most 3; in which case, they can change this maxNumberOfBackUps. +# +# If maxNumberOfBackUps is set to 0 (or less) then infinitely +# many backups are possible, unless onlyOneBackUp is switched on +maxNumberOfBackUps: 0 + +# some users may wish to cycle through back up files. +# +# for example, with maxNumberOfBackUps: 4, they may +# wish to delete the oldest back up file, and keep only the most recent. +# +# copy myfile.bak1 to myfile.bak0 +# copy myfile.bak2 to myfile.bak1 +# copy myfile.bak3 to myfile.bak2 +# copy myfile.bak4 to myfile.bak3 +# +# the back up will be written to myfile.bak4 +cycleThroughBackUps: 0 + +# preferences for information displayed in the log file +logFilePreferences: + showEveryYamlRead: 1 + showAmalgamatedSettings: 0 + showDecorationStartCodeBlockTrace: 0 + showDecorationFinishCodeBlockTrace: 0 + endLogFileWith: '--------------' + showGitHubInfoFooter: 1 + Dumper: + Terse: 1 + Indent: 1 + Useqq: 1 + Deparse: 1 + Quotekeys: 0 + Sortkeys: 1 + Pair: " => " + +# verbatim environments specified +# in this field will not be changed at all! +verbatimEnvironments: + verbatim: 1 + lstlisting: 1 + minted: 1 + +# verbatim commands such as \verb! body !, \lstinline$something else$ +verbatimCommands: + verb: 1 + lstinline: 1 + +# no indent blocks (not necessarily verbatim +# environments) which are marked as %\begin{noindent} +# or anything else that you detail in the following +noIndentBlock: + noindent: 1 + cmhtest: 1 + +# \begin{document} and \end{document} are treated differently +# by latexindent within filecontents environments +fileContentsEnvironments: + filecontents: 1 + filecontents*: 1 + +# indent preamble +indentPreamble: 1 + +# assume no preamble in cls, sty, by default +lookForPreamble: + .tex: 1 + .sty: 0 + .cls: 0 + .bib: 0 + +# some preambles can contain \begin and \end statements +# that are not in their 'standard environment block', for example, +# consider the following key = values: +# preheadhook={\begin{mdframed}[style=myframedstyle]}, +# postfoothook=\end{mdframed}, +preambleCommandsBeforeEnvironments: 0 + +# default value of indentation +defaultIndent: " " + +# remove trailing whitespace from all lines +removeTrailingWhitespace: + beforeProcessing: 0 + afterProcessing: 1 + +# name of code blocks that should have their body aligned at ampersand delimiters +lookForAlignDelims: + tabular: + delims: 1 + alignDoubleBackSlash: 1 + spacesBeforeDoubleBackSlash: 1 + multiColumnGrouping: 0 + alignRowsWithoutMaxDelims: 1 + spacesBeforeAmpersand: 1 + spacesAfterAmpersand: 1 + justification: left + alignFinalDoubleBackSlash: 0 + dontMeasure: 0 + delimiterRegEx: '(?<!\\)(&)' + delimiterJustification: left + lookForChildCodeBlocks: 1 + tabularx: + delims: 1 + longtable: 1 + tabu: 1 + array: 1 + matrix: 1 + listabla: 1 + # amsmath + align: 1 + align*: 1 + alignat: 1 + alignat*: 1 + aligned: 1 + bmatrix: 1 + Bmatrix: 1 + cases: 1 + flalign: 1 + flalign*: 1 + pmatrix: 1 + vmatrix: 1 + Vmatrix: 1 + # mathtools + cases*: 1 + dcases: 1 + dcases*: 1 + rcases: 1 + rcases*: 1 + drcases: 1 + drcases*: 1 + # nicematrix + NiceTabular: 1 + NiceMatrix: 1 + pNiceMatrix: 1 + bNiceMatrix: 1 + BNiceMatrix: 1 + vNiceMatrix: 1 + VNiceMatrix: 1 + NiceArray: 1 + pNiceArrayC: 1 + bNiceArrayC: 1 + BNiceArrayC: 1 + vNiceArrayC: 1 + VNiceArrayC: 1 + NiceArrayCwithDelims: 1 + pNiceArrayRC: 1 + bNiceArrayRC: 1 + BNiceArrayRC: 1 + vNiceArrayRC: 1 + VNiceArrayRC: 1 + NiceArrayRCwithDelims: 1 + # tabularray + tblr: 1 + longtblr: 1 + talltblr: 1 + +# if you want the script to look for \item commands +# and format it, as follows (for example), +# \begin{itemize} +# \item content here +# next line is indented +# next line is indented +# \item another item +# \end{itemize} +# then populate indentAfterItems. See also itemNames +indentAfterItems: + itemize: 1 + itemize*: 1 + enumerate: 1 + enumerate*: 1 + description: 1 + description*: 1 + list: 1 + +# if you want to use other names for your items (for example, \part) +# then populate them here; note that you can trick latexindent.pl +# into indenting all kinds of commands (within environments specified in +# indentAfterItems) using this technique. +itemNames: + item: 1 + myitem: 1 + +# specialBeginEnd is, by default, mathmode focus, although +# there's no restrictions +specialBeginEnd: + displayMath: + begin: '\\\[' + end: '\\\]' + lookForThis: 1 + inlineMath: + begin: '(?<!\$)(?<!\\)\$(?!\$)' + end: '(?<!\\)\$(?!\$)' + lookForThis: 1 + displayMathTeX: + begin: '\$\$' + end: '\$\$' + lookForThis: 1 + specialBeforeCommand: 0 + +# if you want to add indentation after +# a heading, such as \part, \chapter, etc +# then populate it in here - you can add +# an indent rule to indentRules if you would +# like something other than defaultIndent +# +# you can also change the level if you like, +# or add your own title command +indentAfterHeadings: + part: + indentAfterThisHeading: 0 + level: 1 + chapter: + indentAfterThisHeading: 0 + level: 2 + section: + indentAfterThisHeading: 0 + level: 3 + subsection: + indentAfterThisHeading: 0 + level: 4 + subsection*: + indentAfterThisHeading: 0 + level: 4 + subsubsection: + indentAfterThisHeading: 0 + level: 5 + paragraph: + indentAfterThisHeading: 0 + level: 6 + subparagraph: + indentAfterThisHeading: 0 + level: 7 + +# maximum indentation, off by default +maximumIndentation: -1 + +# if you don't want to have additional indentation +# in a code block, then add it to noAdditionalIndent; note that +# code blocks in this field will inherit +# the *current* level of indentation they just won't +# get any *additional* indentation +noAdditionalIndent: + myexample: 0 + mydefinition: 0 + problem: 0 + exercises: 0 + mysolution: 0 + foreach: 0 + widepage: 0 + comment: 0 + document: 0 + frame: 0 + +# if you have indent rules for particular code blocks +# then you can populate them in indentRules; for example, you might just want +# to use a space " " or maybe a double tab " " +indentRules: + myenvironment: " " + anotherenvironment: " " + chapter: " " + section: " " + item: " " + myitem: " " + +# set noAdditionalIndent globally for codeblocks +noAdditionalIndentGlobal: + environments: 0 + commands: 0 + optionalArguments: 0 + mandatoryArguments: 0 + ifElseFi: 0 + items: 0 + keyEqualsValuesBracesBrackets: 0 + namedGroupingBracesBrackets: 0 + UnNamedGroupingBracesBrackets: 0 + specialBeginEnd: 0 + afterHeading: 0 + filecontents: 0 + +# set indentRules globally for codeblocks; these need +# to be horizontal spaces, if they are to be used +indentRulesGlobal: + environments: 0 + commands: 0 + optionalArguments: 0 + mandatoryArguments: 0 + ifElseFi: 0 + items: 0 + keyEqualsValuesBracesBrackets: 0 + namedGroupingBracesBrackets: 0 + UnNamedGroupingBracesBrackets: 0 + specialBeginEnd: 0 + afterHeading: 0 + filecontents: 0 + +# command code block details +commandCodeBlocks: + roundParenthesesAllowed: 1 + stringsAllowedBetweenArguments: + - + amalgamate: 1 + - 'node' + - 'at' + - 'to' + - 'decoration' + - '\+\+' + - '\-\-' + - '\#\#\d' + commandNameSpecial: + - + amalgamate: 1 + - '@ifnextchar\[' + +# change dos line breaks into unix +dos2unixlinebreaks: 1 + +# modifyLineBreaks will only be searched if the -m +# switch is active +# +# poly-switch examples: +# +# BeginStartsOnOwnLine: +# modify line breaks before a begin statement +# +# when set to -1, e.g +# some text some text +# \begin{myenvironment} +# will be changed to +# some text some text \begin{myenvironment} +# when set to 0, the switch is ignored +# when set to 1, e.g +# some text some text \begin{myenvironment} +# will be changed to +# some text some text +# \begin{myenvironment} +# when set to 2, e.g +# some text some text \begin{myenvironment} +# will be changed to +# some text some text% +# \begin{myenvironment} +# when set to 3, e.g +# some text some text \begin{myenvironment} +# will be changed to +# some text some text +# +# \begin{myenvironment} +# +# BodyStartsOnOwnLine: +# modify line breaks before the beginning of the body +# +# when set to -1, e.g +# \begin{myenv} +# body text body text +# will be changed to +# \begin{myenv}body text body text +# when set to 0, the switch is ignored +# when set to 1, e.g +# \begin{myenv}body text body text +# will be changed to +# \begin{myenv} +# body text body text +# when set to 2, e.g +# \begin{myenv}body text body text +# will be changed to +# \begin{myenv}% +# body text body text +# when set to 3, e.g +# \begin{myenv}body text body text +# will be changed to +# \begin{myenv} +# +# body text body text +# +# EndStartsOnOwnLine: +# modify line breaks before the end statement +# +# when set to -1, e.g +# some text some text +# \end{myenvironment} +# will be changed to +# some text some text \end{myenvironment} +# when set to 0, the switch is ignored +# when set to 1, e.g +# some text some text \end{myenvironment} +# will be changed to +# some text some text +# \end{myenvironment} +# when set to 2, e.g +# some text some text \end{myenvironment} +# will be changed to +# some text some text% +# \end{myenvironment} +# when set to 3, e.g +# some text some text \end{myenvironment} +# will be changed to +# some text some text +# +# \end{myenvironment} +# +# EndFinishesWithLineBreak: +# modify line breaks after the end statement +# +# when set to -1, e.g +# \end{myenvironment} +# some text some text +# will be changed to +# \end{myenvironment}some text some text +# when set to 0, the switch is ignored +# when set to 1, e.g +# \end{myenvironment}some text some text +# will be changed to +# \end{myenvironment} +# some text some text +# when set to 2, e.g +# \end{myenvironment}some text some text +# will be changed to +# \end{myenvironment}% +# some text some text +# when set to 3, e.g +# \end{myenvironment}some text some text +# will be changed to +# \end{myenvironment} +# +# some text some text +# +# you can specify settings on a per-name basis +modifyLineBreaks: + preserveBlankLines: 1 + condenseMultipleBlankLinesInto: 1 + oneSentencePerLine: + manipulateSentences: 0 + removeSentenceLineBreaks: 1 + multipleSpacesToSingle: 1 + textWrapSentences: 0 # setting to 1 disables main textWrap routine + sentenceIndent: "" + sentencesFollow: + par: 1 + blankLine: 1 + fullStop: 1 + exclamationMark: 1 + questionMark: 1 + rightBrace: 1 + commentOnPreviousLine: 1 + other: 0 + sentencesBeginWith: + A-Z: 1 + a-z: 0 + other: 0 + sentencesEndWith: + basicFullStop: 0 + betterFullStop: 1 + exclamationMark: 1 + questionMark: 1 + other: 0 + textWrapOptions: + columns: 0 + multipleSpacesToSingle: 1 + removeBlockLineBreaks: 1 + blocksFollow: + headings: 1 + commentOnPreviousLine: 1 + par: 1 + blankLine: 1 + verbatim: 1 + filecontents: 1 + other: '\\\]|\\item(?:\h|\[)' # regex + blocksBeginWith: + A-Z: 1 + a-z: 1 + 0-9: 0 + other: 0 # regex + blocksEndBefore: + commentOnOwnLine: 1 + verbatim: 1 + filecontents: 1 + other: '\\begin\{|\\\[|\\end\{' # regex + huge: overflow # forbid mid-word line breaks + separator: "" + # poly-switches below here + environments: + BeginStartsOnOwnLine: 0 + BodyStartsOnOwnLine: 0 + EndStartsOnOwnLine: 0 + EndFinishesWithLineBreak: 0 + equation*: + BeginStartsOnOwnLine: 0 + BodyStartsOnOwnLine: 0 + EndStartsOnOwnLine: 0 + EndFinishesWithLineBreak: 0 + ifElseFi: + IfStartsOnOwnLine: 0 + BodyStartsOnOwnLine: 0 + OrStartsOnOwnLine: 0 + OrFinishesWithLineBreak: 0 + ElseStartsOnOwnLine: 0 + ElseFinishesWithLineBreak: 0 + FiStartsOnOwnLine: 0 + FiFinishesWithLineBreak: 0 + ifnum: + IfStartsOnOwnLine: 0 + BodyStartsOnOwnLine: 0 + OrStartsOnOwnLine: 0 + OrFinishesWithLineBreak: 0 + ElseStartsOnOwnLine: 0 + ElseFinishesWithLineBreak: 0 + FiStartsOnOwnLine: 0 + FiFinishesWithLineBreak: 0 + commands: + CommandStartsOnOwnLine: 0 + CommandNameFinishesWithLineBreak: 0 + optionalArguments: + LSqBStartsOnOwnLine: 0 + OptArgBodyStartsOnOwnLine: 0 + RSqBStartsOnOwnLine: 0 + RSqBFinishesWithLineBreak: 0 + mandatoryArguments: + LCuBStartsOnOwnLine: 0 + MandArgBodyStartsOnOwnLine: 0 + RCuBStartsOnOwnLine: 0 + RCuBFinishesWithLineBreak: 0 + keyEqualsValuesBracesBrackets: + KeyStartsOnOwnLine: 0 + EqualsStartsOnOwnLine: 0 + EqualsFinishesWithLineBreak: 0 + items: + ItemStartsOnOwnLine: 0 + ItemFinishesWithLineBreak: 0 + namedGroupingBracesBrackets: + NameStartsOnOwnLine: 0 + NameFinishesWithLineBreak: 0 + specialBeginEnd: + SpecialBeginStartsOnOwnLine: 0 + SpecialBodyStartsOnOwnLine: 0 + SpecialEndStartsOnOwnLine: 0 + SpecialEndFinishesWithLineBreak: 0 + verbatim: + VerbatimBeginStartsOnOwnLine: 0 + VerbatimEndFinishesWithLineBreak: 0 + +# replacements, only active when either -r or -rr switches are active +replacements: + - + amalgamate: 1 + - + this: 'latexindent.pl' + that: 'pl.latexindent' + lookForThis: 0 + when: before + +# fineTuning allows you to tweak the internal pattern matching that +# is central to latexindent.pl +fineTuning: + environments: + name: '[a-zA-Z@\*0-9_\\]+' + ifElseFi: + name: '(?!@?if[a-zA-Z@]*?\{)@?if[a-zA-Z@]*?' + commands: + name: '[+a-zA-Z@\*0-9_\:]+?' + items: + canBeFollowedBy: '(?:\[[^]]*?\])|(?:<[^>]*?>)' + keyEqualsValuesBracesBrackets: + name: '[a-zA-Z@\*0-9_\/.:\#-]+[a-zA-Z@\*0-9_\/.\h\{\}:\#-]*?' + follow: '(?:(?<!\\)\{)|,|(?:(?<!\\)\[)' + namedGroupingBracesBrackets: + name: '[0-9\.a-zA-Z@\*><]+?' + follow: '\h|\R|\{|\[|\$|\)|\(' + UnNamedGroupingBracesBrackets: + follow: '\{|\[|,|&|\)|\(|\$' + arguments: + before: '(?:#\d\h*;?,?\/?)+|\<.*?\>' + between: '_|\^|\*' + trailingComments: + notPreceededBy: '(?<!\\)' + modifyLineBreaks: + doubleBackSlash: '\\\\(?:\h*\[\h*\d+\h*[a-zA-Z]+\h*\])?' + comma: ',' + betterFullStop: |- + (?x) # ignore spaces in the below + (?: # + \.\) # .) + (?!\h*[a-z]) # not *followed by* a-z + ) # + | # OR + (?: # + (?<! # not *preceeded by* + (?: # + (?:[eE]\.[gG]) # e.g OR E.g OR e.G OR E.G + | # + (?:[iI]\.[eE]) # i.e OR I.e OR i.E OR I.E + | # + (?:etc) # etc + ) # + ) # + ) # + \. # . + (?! # not *followed by* + (?: # + [a-zA-Z0-9-~,] # + | # + \), # ), + | # + \)\. # ). + ) # + ) # diff --git a/home-manager/less/default.nix b/home-manager/less/default.nix new file mode 100644 index 00000000..052f736f --- /dev/null +++ b/home-manager/less/default.nix @@ -0,0 +1,17 @@ +{ + config, + pkgs, + ... +}: { + home-manager.programs.less = { + enable = true; + keys = '' + t forw-line + n back-line + l repeat-search + L reverse-search + ''; + }; +} +# vim: ts=2 + diff --git a/home-manager/lf/cmds/archive.sh b/home-manager/lf/cmds/archive.sh new file mode 100644 index 00000000..48544365 --- /dev/null +++ b/home-manager/lf/cmds/archive.sh @@ -0,0 +1,40 @@ +#!/bin/sh +# shellcheck disable=SC2086 +# shellcheck source=/home/dt/.local/lib/shell/lib +. ~/.local/lib/shell/lib + + +# Option '-f' disables pathname expansion which can be useful when $f, $fs, and +# $fx variables contain names with '*' or '?' characters. However, this option +# is used selectively within individual commands as it can be limiting at +# times. +set -f + +fx="$*" + +archivers=$(mktmp) +echo "tar+zip tar+xz 7z zip" > $archivers; + +readp "File Name: " name + + +case $(awk '{for (i=1; i<=NF; i++) print $i}' $archivers | fzf) in + "tar+zip") + tar -czf "$name".tar.gz "$name" + ;; + "tar+xz") + tar -cf "$name".tar $fx + xz -z -9 -e -T0 "$name".tar + ;; + "7z") + 7z a "$name".7z $fx + ;; + "zip") + zip -r "$name".zip $fx + ;; +esac + + + + +if [ -d /tmp/LIB_FILE_TEMP_DIR/ ];then rm -r /tmp/LIB_FILE_TEMP_DIR/; fi diff --git a/home-manager/lf/cmds/broot_jump.sh b/home-manager/lf/cmds/broot_jump.sh new file mode 100644 index 00000000..188c9508 --- /dev/null +++ b/home-manager/lf/cmds/broot_jump.sh @@ -0,0 +1,19 @@ +#!/bin/sh +# shellcheck disable=SC2086 +# shellcheck source=/dev/null +. ~/.local/lib/shell/lib + +f=$(mktemp) +res="$(broot --outcmd $f && cat $f | sed 's/cd //')" +rm -f "$f" +if [ -f "$res" ]; then + cmd="select" +elif [ -d "$res" ]; then + cmd="cd" +fi +lf -remote "send $id $cmd \"$res\"" + + + + +if [ -d /tmp/LIB_FILE_TEMP_DIR/ ];then rm -r /tmp/LIB_FILE_TEMP_DIR/; fi diff --git a/home-manager/lf/cmds/chmod.sh b/home-manager/lf/cmds/chmod.sh new file mode 100644 index 00000000..f6a87336 --- /dev/null +++ b/home-manager/lf/cmds/chmod.sh @@ -0,0 +1,17 @@ +#!/bin/sh +# shellcheck disable=SC2086 +# shellcheck source=/dev/null +. ~/.local/lib/shell/lib + + +readp "Mode Bits: " ans + +for file in $fx +do + chmod "$ans" "$file" +done + +lf -remote 'send reload' + + +if [ -d /tmp/LIB_FILE_TEMP_DIR/ ];then rm -r /tmp/LIB_FILE_TEMP_DIR/; fi diff --git a/home-manager/lf/cmds/clear_trash.sh b/home-manager/lf/cmds/clear_trash.sh new file mode 100644 index 00000000..c02321f2 --- /dev/null +++ b/home-manager/lf/cmds/clear_trash.sh @@ -0,0 +1,10 @@ +#!/bin/sh +# shellcheck disable=SC2086 +# shellcheck source=/dev/null +. ~/.local/lib/shell/lib + + +trash-empty + + +if [ -d /tmp/LIB_FILE_TEMP_DIR/ ];then rm -r /tmp/LIB_FILE_TEMP_DIR/; fi diff --git a/home-manager/lf/cmds/dl_file.sh b/home-manager/lf/cmds/dl_file.sh new file mode 100644 index 00000000..9cb9023c --- /dev/null +++ b/home-manager/lf/cmds/dl_file.sh @@ -0,0 +1,36 @@ +#!/bin/sh +# shellcheck disable=SC2086 +# shellcheck source=/dev/null +. ~/.local/lib/shell/lib + +# Provides the ability to download a file by dropping it into a window + +url=$(dragon-drop -t -x) + +if [ -n "$url" ]; then + printf "File Name: " + name="" + while [ -z $name ] || [ -e $name ] + do + read -r name + if [ -e "$name" ]; then + printf "File already exists, overwrite (y|n): " + read -r ans + + if [ "$ans" = "y" ]; then + break + else + printf "File Name: " + fi + fi + done + + # Download the file with curl + [ -n "$name" ] && curl -o "$name" "$url" || exit 1 +else + exit 1 +fi + + + +if [ -d /tmp/LIB_FILE_TEMP_DIR/ ];then rm -r /tmp/LIB_FILE_TEMP_DIR/; fi diff --git a/home-manager/lf/cmds/dragon.sh b/home-manager/lf/cmds/dragon.sh new file mode 100644 index 00000000..36e94706 --- /dev/null +++ b/home-manager/lf/cmds/dragon.sh @@ -0,0 +1,11 @@ +#!/bin/sh +# shellcheck disable=SC2086 +# shellcheck source=/dev/null +. ~/.local/lib/shell/lib + +dragon-drop -a -x "$fx" + + + + +if [ -d /tmp/LIB_FILE_TEMP_DIR/ ];then rm -r /tmp/LIB_FILE_TEMP_DIR/; fi diff --git a/home-manager/lf/cmds/dragon_individual.sh b/home-manager/lf/cmds/dragon_individual.sh new file mode 100644 index 00000000..abcadb13 --- /dev/null +++ b/home-manager/lf/cmds/dragon_individual.sh @@ -0,0 +1,10 @@ +#!/bin/sh +# shellcheck disable=SC2086 +# shellcheck source=/dev/null +. ~/.local/lib/shell/lib + +dragon-drop "$fx" + + + +if [ -d /tmp/LIB_FILE_TEMP_DIR/ ];then rm -r /tmp/LIB_FILE_TEMP_DIR/; fi diff --git a/home-manager/lf/cmds/dragon_stay.sh b/home-manager/lf/cmds/dragon_stay.sh new file mode 100644 index 00000000..60195d09 --- /dev/null +++ b/home-manager/lf/cmds/dragon_stay.sh @@ -0,0 +1,11 @@ +#!/bin/sh +# shellcheck disable=SC2086 +# shellcheck source=/dev/null +. ~/.local/lib/shell/lib + +dragon-drop -a "$fx" + + + + +if [ -d /tmp/LIB_FILE_TEMP_DIR/ ];then rm -r /tmp/LIB_FILE_TEMP_DIR/; fi diff --git a/home-manager/lf/cmds/fzf_jump.sh b/home-manager/lf/cmds/fzf_jump.sh new file mode 100644 index 00000000..688efdb9 --- /dev/null +++ b/home-manager/lf/cmds/fzf_jump.sh @@ -0,0 +1,17 @@ +#!/bin/sh +# shellcheck disable=SC2086 +# shellcheck source=/dev/null +. ~/.local/lib/shell/lib + +res="$(find . -maxdepth 3 | fzf --reverse --header='Jump to location')" +if [ -f "$res" ]; then + cmd="select" +elif [ -d "$res" ]; then + cmd="cd" +fi +lf -remote "send $id $cmd \"$res\"" + + + + +if [ -d /tmp/LIB_FILE_TEMP_DIR/ ];then rm -r /tmp/LIB_FILE_TEMP_DIR/; fi diff --git a/home-manager/lf/cmds/help.sh b/home-manager/lf/cmds/help.sh new file mode 100644 index 00000000..8fedd0ea --- /dev/null +++ b/home-manager/lf/cmds/help.sh @@ -0,0 +1,10 @@ +#!/bin/sh +# shellcheck disable=SC2086 +# shellcheck source=/dev/null +. ~/.local/lib/shell/lib + + +cat ~/.config/lf/lfrc + + +if [ -d /tmp/LIB_FILE_TEMP_DIR/ ];then rm -r /tmp/LIB_FILE_TEMP_DIR/; fi diff --git a/home-manager/lf/cmds/mk_dir.sh b/home-manager/lf/cmds/mk_dir.sh new file mode 100644 index 00000000..bfa0627d --- /dev/null +++ b/home-manager/lf/cmds/mk_dir.sh @@ -0,0 +1,12 @@ +#!/bin/sh +# shellcheck disable=SC2086 +# shellcheck source=/dev/null +. ~/.local/lib/shell/lib + + +readp "Directory Name: " ans +mkdir $ans + + + +if [ -d /tmp/LIB_FILE_TEMP_DIR/ ];then rm -r /tmp/LIB_FILE_TEMP_DIR/; fi diff --git a/home-manager/lf/cmds/mk_file.sh b/home-manager/lf/cmds/mk_file.sh new file mode 100644 index 00000000..044016a6 --- /dev/null +++ b/home-manager/lf/cmds/mk_file.sh @@ -0,0 +1,11 @@ +#!/bin/sh +# shellcheck disable=SC2086 +# shellcheck source=/dev/null +. ~/.local/lib/shell/lib + + +readp "File Name: " name +$EDITOR "$name" + + +if [ -d /tmp/LIB_FILE_TEMP_DIR/ ];then rm -r /tmp/LIB_FILE_TEMP_DIR/; fi diff --git a/home-manager/lf/cmds/mk_ln.sh b/home-manager/lf/cmds/mk_ln.sh new file mode 100644 index 00000000..71a70a36 --- /dev/null +++ b/home-manager/lf/cmds/mk_ln.sh @@ -0,0 +1,43 @@ +#!/bin/sh +# shellcheck disable=SC2086 +# shellcheck source=/dev/null +. ~/.local/lib/shell/lib + +while IFS= read -r i;do + set -- "$@" "$i" +done < "$(tmp "cat ~/.local/share/lf/files")" + +mode="$1" +shift + +if [ "$#" -lt 1 ]; then + msg "no files to link" + exit 0 +fi + + +case "$mode" in + copy) + while [ "$#" -gt 0 ]; do + file=$1 + ans="$(basename "$file")" + + while ls -a "$(pwd)" | grep --word-regexp "$ans" > /dev/null;do + printf "\"%s\" already exists, new name for link: " "$ans" + read -r ans + done + + ln -s "$file" "$(pwd)/$ans" + + + shift + done + ;; +esac +rm ~/.local/share/lf/files +# lf -remote "send clear" + + + + +if [ -d /tmp/LIB_FILE_TEMP_DIR/ ];then rm -r /tmp/LIB_FILE_TEMP_DIR/; fi diff --git a/home-manager/lf/cmds/mk_scr.sh b/home-manager/lf/cmds/mk_scr.sh new file mode 100644 index 00000000..b6c17458 --- /dev/null +++ b/home-manager/lf/cmds/mk_scr.sh @@ -0,0 +1,29 @@ +#!/bin/sh +# shellcheck disable=SC2086 +# shellcheck source=/dev/null +. ~/.local/lib/shell/lib + +star=$(mktmp) +cat << EOF > $star +#!/bin/sh +# shellcheck disable=SC2086 +# shellcheck source=/dev/null +. ~/.local/lib/shell/lib + + + + + +if [ -d /tmp/LIB_FILE_TEMP_DIR/ ];then rm -r /tmp/LIB_FILE_TEMP_DIR/; fi +EOF + +readp "Script Name: " script_name +scr="$(pwd)"/"$script_name" + +[ -e $scr ] && die "$script_name exitst, exiting.." + +cat "$star" > $scr +chmod +x $scr +if [ -d /tmp/LIB_FILE_TEMP_DIR/ ];then rm -r /tmp/LIB_FILE_TEMP_DIR/; fi + +$VISUAL $scr diff --git a/home-manager/lf/cmds/open.sh b/home-manager/lf/cmds/open.sh new file mode 100644 index 00000000..8376be21 --- /dev/null +++ b/home-manager/lf/cmds/open.sh @@ -0,0 +1,16 @@ +#!/bin/sh +# shellcheck disable=SC2086 +# shellcheck source=/dev/null +. ~/.local/lib/shell/lib + + +case $(file --mime-type "$f" -bL) in + text/*|application/json) $EDITOR "$f";; + image/*) $IVIEWER "$f";; + *) xdg-open "$f" ;; +esac + + + + +if [ -d /tmp/LIB_FILE_TEMP_DIR/ ];then rm -r /tmp/LIB_FILE_TEMP_DIR/; fi diff --git a/home-manager/lf/cmds/open_config.sh b/home-manager/lf/cmds/open_config.sh new file mode 100644 index 00000000..93c174d7 --- /dev/null +++ b/home-manager/lf/cmds/open_config.sh @@ -0,0 +1,10 @@ +#!/bin/sh +# shellcheck disable=SC2086 +# shellcheck source=/dev/null +. ~/.local/lib/shell/lib + +$EDITOR "$(bookmenu -b ~/.config/bookmenu/configs -f fzf -o)" + + + +if [ -d /tmp/LIB_FILE_TEMP_DIR/ ];then rm -r /tmp/LIB_FILE_TEMP_DIR/; fi diff --git a/home-manager/lf/cmds/restore_trash.sh b/home-manager/lf/cmds/restore_trash.sh new file mode 100644 index 00000000..432e9e9b --- /dev/null +++ b/home-manager/lf/cmds/restore_trash.sh @@ -0,0 +1,10 @@ +#!/bin/sh +# shellcheck disable=SC2086 +# shellcheck source=/dev/null +. ~/.local/lib/shell/lib + + +trash-restore + + +if [ -d /tmp/LIB_FILE_TEMP_DIR/ ];then rm -r /tmp/LIB_FILE_TEMP_DIR/; fi diff --git a/home-manager/lf/cmds/set_wall_paper.sh b/home-manager/lf/cmds/set_wall_paper.sh new file mode 100644 index 00000000..4599de2a --- /dev/null +++ b/home-manager/lf/cmds/set_wall_paper.sh @@ -0,0 +1,15 @@ +#!/bin/sh +# shellcheck disable=SC2086 +# shellcheck source=/dev/null +. ~/.local/lib/shell/lib + + +die "No yet implemented" +#sed -i "s,export AWMWALLPAPER='.*',export AWMWALLPAPER='${f}'," ${ZDOTDIR}/.zshenv +#swaybg -i "$f" & +#feh --bg-max --no-fehbg "$f" + + + + +if [ -d /tmp/LIB_FILE_TEMP_DIR/ ];then rm -r /tmp/LIB_FILE_TEMP_DIR/; fi diff --git a/home-manager/lf/cmds/stripspace.sh b/home-manager/lf/cmds/stripspace.sh new file mode 100644 index 00000000..c7f68767 --- /dev/null +++ b/home-manager/lf/cmds/stripspace.sh @@ -0,0 +1,10 @@ +#!/bin/sh +# shellcheck disable=SC2086 +# shellcheck source=/dev/null +. ~/.local/lib/shell/lib + + +stripspace "$f" + + +if [ -d /tmp/LIB_FILE_TEMP_DIR/ ];then rm -r /tmp/LIB_FILE_TEMP_DIR/; fi diff --git a/home-manager/lf/cmds/sudo_mk_file.sh b/home-manager/lf/cmds/sudo_mk_file.sh new file mode 100644 index 00000000..1f06a92f --- /dev/null +++ b/home-manager/lf/cmds/sudo_mk_file.sh @@ -0,0 +1,13 @@ +#!/bin/sh +# shellcheck disable=SC2086 +# shellcheck source=/dev/null +. ~/.local/lib/shell/lib + + +readp "File Name: " ans +sudo $EDITOR "$ans" + + + + +if [ -d /tmp/LIB_FILE_TEMP_DIR/ ];then rm -r /tmp/LIB_FILE_TEMP_DIR/; fi diff --git a/home-manager/lf/cmds/trash.sh b/home-manager/lf/cmds/trash.sh new file mode 100644 index 00000000..4598b4fd --- /dev/null +++ b/home-manager/lf/cmds/trash.sh @@ -0,0 +1,27 @@ +#!/bin/sh +# shellcheck disable=SC2086 +# shellcheck source=/dev/null +. ~/.local/lib/shell/lib + +files=$(printf "$fx" | tr '\n' ';') + +while [ "$files" ]; do + # extract the substring from start of string up to delimiter. + # this is the first "element" of the string. + file=${files%%;*} + + trash-put "$(basename "$file")" + # if there's only one element left, set `files` to an empty string. + # this causes us to exit this `while` loop. + # else, we delete the first "element" of the string from files, and move onto the next. + if [ "$files" = "$file" ]; then + files='' + else + files="${files#*;}" + fi +done + + + + +if [ -d /tmp/LIB_FILE_TEMP_DIR/ ];then rm -r /tmp/LIB_FILE_TEMP_DIR/; fi diff --git a/home-manager/lf/cmds/unarchive.sh b/home-manager/lf/cmds/unarchive.sh new file mode 100644 index 00000000..47a713fa --- /dev/null +++ b/home-manager/lf/cmds/unarchive.sh @@ -0,0 +1,22 @@ +#!/bin/sh +# shellcheck disable=SC2086 +# shellcheck source=/dev/null +. ~/.local/lib/shell/lib + + +# extract the current file with the right command +# (xkcd link: https://xkcd.com/1168/) +set -f +case "$f" in + *.tar.bz|*.tar.bz2|*.tbz|*.tbz2) tar xjvf $f;; + *.tar.gz|*.tgz) tar xzvf $f;; + *.tar.xz|*.txz) tar xJvf $f;; + *.zip) unzip $f;; + *.rar) unrar x $f;; + *.7z) 7z x $f;; + *) warning "Unsupported format" ;; +esac + + + +if [ -d /tmp/LIB_FILE_TEMP_DIR/ ];then rm -r /tmp/LIB_FILE_TEMP_DIR/; fi diff --git a/home-manager/lf/colors b/home-manager/lf/colors new file mode 100644 index 00000000..c4b6417b --- /dev/null +++ b/home-manager/lf/colors @@ -0,0 +1,196 @@ +# vim:ft=dircolors +# (This is not a dircolors file but it helps to highlight colors and comments) + +# default values from dircolors +# (entries with a leading # are not implemented in lf) +# #no 00 # NORMAL +# fi 00 # FILE +# #rs 0 # RESET +# di 01;34 # DIR +# ln 01;36 # LINK +# #mh 00 # MULTIHARDLINK +# pi 40;33 # FIFO +# so 01;35 # SOCK +# #do 01;35 # DOOR +# bd 40;33;01 # BLK +# cd 40;33;01 # CHR +# or 40;31;01 # ORPHAN +# #mi 00 # MISSING +# su 37;41 # SETUID +# sg 30;43 # SETGID +# #ca 30;41 # CAPABILITY +# tw 30;42 # STICKY_OTHER_WRITABLE +# ow 34;42 # OTHER_WRITABLE +# st 37;44 # STICKY +# ex 01;32 # EXEC + +# default values from lf (with matching order) +# ln 01;36 # LINK +# or 31;01 # ORPHAN +# tw 01;34 # STICKY_OTHER_WRITABLE +# ow 01;34 # OTHER_WRITABLE +# st 01;34 # STICKY +# di 01;34 # DIR +# pi 33 # FIFO +# so 01;35 # SOCK +# bd 33;01 # BLK +# cd 33;01 # CHR +# su 01;32 # SETUID +# sg 01;32 # SETGID +# ex 01;32 # EXEC +# fi 00 # FILE + + +# file types (with matching order) +ln 01;33 # LINK +#ln 01;34 # LINK +or 01;35;46 # ORPHAN +tw 35 # STICKY_OTHER_WRITABLE +ow 35 # OTHER_WRITABLE +st 01;36 # STICKY +di 01;36 # DIR +pi 33 # FIFO +so 01;35 # SOCK +bd 33;01 # BLK +cd 33;01 # CHR +su 01;32 # SETUID +sg 01;32 # SETGID +ex 01;31;44 # EXEC +fi 00 # FILE + +# links +# ~/.librewolf 01;34 +~/.cups 01;34 +~/.mozilla 01;34 +#~/.pki 01;34 +~/.ssh 01;34 +#~/.lesskey 01;34 +#~/.pulse-cookie 01;34 + +~/.steampid 01;34 +~/.steam 01;34 +~/.steampath 01;34 + +# nix +~/.nix-profile 01;34 +~/.nix-defexpr 01;34 + +# can now be removed +~/.indentconfig.yaml 01;34 + +# archives or compressed (dircolors defaults) +*.tar 01;31 +*.tgz 01;31 +*.arc 01;31 +*.arj 01;31 +*.taz 01;31 +*.lha 01;31 +*.lz4 01;31 +*.lzh 01;31 +*.lzma 01;31 +*.tlz 01;31 +*.txz 01;31 +*.tzo 01;31 +*.t7z 01;31 +*.zip 01;31 +*.z 01;31 +*.dz 01;31 +*.gz 01;31 +*.lrz 01;31 +*.lz 01;31 +*.lzo 01;31 +*.xz 01;31 +*.zst 01;31 +*.tzst 01;31 +*.bz2 01;31 +*.bz 01;31 +*.tbz 01;31 +*.tbz2 01;31 +*.tz 01;31 +*.deb 01;31 +*.rpm 01;31 +*.jar 01;31 +*.war 01;31 +*.ear 01;31 +*.sar 01;31 +*.rar 01;31 +*.alz 01;31 +*.ace 01;31 +*.zoo 01;31 +*.cpio 01;31 +*.7z 01;31 +*.rz 01;31 +*.cab 01;31 +*.wim 01;31 +*.swm 01;31 +*.dwm 01;31 +*.esd 01;31 + +# image formats (dircolors defaults) +*.jpg 01;35 +*.jpeg 01;35 +*.mjpg 01;35 +*.mjpeg 01;35 +*.gif 01;35 +*.bmp 01;35 +*.pbm 01;35 +*.pgm 01;35 +*.ppm 01;35 +*.tga 01;35 +*.xbm 01;35 +*.xpm 01;35 +*.tif 01;35 +*.tiff 01;35 +*.png 01;35 +*.svg 01;35 +*.svgz 01;35 +*.mng 01;35 +*.pcx 01;35 +*.mov 01;35 +*.mpg 01;35 +*.mpeg 01;35 +*.m2v 01;35 +*.mkv 01;35 +*.webm 01;35 +*.ogm 01;35 +*.mp4 01;35 +*.m4v 01;35 +*.mp4v 01;35 +*.vob 01;35 +*.qt 01;35 +*.nuv 01;35 +*.wmv 01;35 +*.asf 01;35 +*.rm 01;35 +*.rmvb 01;35 +*.flc 01;35 +*.avi 01;35 +*.fli 01;35 +*.flv 01;35 +*.gl 01;35 +*.dl 01;35 +*.xcf 01;35 +*.xwd 01;35 +*.yuv 01;35 +*.cgm 01;35 +*.emf 01;35 +*.ogv 01;35 +*.ogx 01;35 + +# audio formats (dircolors defaults) +*.aac 00;36 +*.au 00;36 +*.flac 00;36 +*.m4a 00;36 +*.mid 00;36 +*.midi 00;36 +*.mka 00;36 +*.mp3 00;36 +*.mpc 00;36 +*.ogg 00;36 +*.ra 00;36 +*.wav 00;36 +*.oga 00;36 +*.opus 00;36 +*.spx 00;36 +*.xspf 00;36 diff --git a/home-manager/lf/default.nix b/home-manager/lf/default.nix new file mode 100644 index 00000000..fd8c4b39 --- /dev/null +++ b/home-manager/lf/default.nix @@ -0,0 +1,200 @@ +{ + config, + pkgs, + ... +}: let + shell = file: + "\${{" + builtins.readFile "${file}" + "}}"; # closes the lf tui + pipe = file: + "%{{" + builtins.readFile "${file}" + "}}"; # runs the command in the ui,term bar + async = file: + "&{{" + builtins.readFile "${file}" + "}}"; # runs the command in the background + wait = file: + "!{{" + builtins.readFile "${file}" + "}}"; # adds a prompt after the command has run +in { + home-manager.xdg.configFile."lf/icons" = { + target = "lf/icons"; + source = "./icons"; + }; + home-manager.xdg.configFile."lf/colors" = { + target = "lf/colors"; + source = "./colors"; + }; + + home-manager.programs.lf = { + enable = true; + + commands = { + help = shell "./cmds/help.sh"; + open = shell "./cmds/open.sh"; + mk_dir = pipe "./cmds/mk_dir.sh"; + mk_scr = shell "./cmds/mk_scr.sh"; + mk_file = shell "./cmds/mk_file.sh"; + chmod = pipe "./cmds/chmod.sh"; + mk_ln = shell "./cmds/mk_ln.sh"; # TODO could be pipe, right? + sudo_mk_file = shell "./cmds/sudo_mk_file.sh"; + set_wall_paper = pipe "./cmds/set_wall_paper.sh"; + fzf_jump = shell "./cmds/fzf_jump.sh"; + broot_jump = shell "./cmds/broot_jump.sh"; + open_config = shell "./cmds/open_config.sh"; + + dragon = pipe "./cmds/dragon.sh"; + dragon_stay = pipe "./cmds/dragon_stay.sh"; + dragon_individual = pipe "./cmds/dragon_individual.sh"; + dl_file = pipe "./cmds/dl_file.sh"; + + unarchive = pipe "./cmds/unarchive.sh"; + archive = pipe "./cmds/archive.sh"; + + trash = pipe "./cmds/trash.sh"; + clear_trash = pipe "./cmds/clear_trash.sh"; + restore_trash = shell "./cmds/restore_trash.sh"; + + stripspace = pipe "./cmds/stripspace.sh"; + }; + keybindings = { + # Remove some defaults + m = null; + "'" = null; + #" = null; # TODO + d = null; + c = null; + e = null; + j = null; + k = null; + l = null; + ";" = null; + + # File Openers + ee = "\$\$EDITOR \"$f\""; + u = "%\$IVIEWER \"$f\""; + cc = "\$sudo -e \"$f\""; + + # Archive Mappings + au = "unarchive"; + a = "archive"; + + # Trash Mappings + dd = "trash"; + jc = "clear_trash"; + jr = "restore_trash"; + + # Broot Mapping + f = "broot_jump"; + + # Dragon Mapping + dr = "dragon"; + ds = "dragon-stay"; + di = "dragon-individual"; + #dm = "mvdragon"; + #dc = "cpdragon"; + dl = "dlfile"; + + ss = "stripspace"; + + # Vim keys + h = "updir"; + t = "down"; + n = "up"; + s = "open"; + + # Basic Functions + bn = "help"; + kk = "mklkn"; + "." = "set hidden!"; + DD = "delete"; + p = "paste"; + x = "cut"; + y = "copy"; + "<enter>" = "open"; + mf = "mkfile"; + mr = "sudomkfile"; + md = "mkdir"; + ms = "mkscr"; + ch = "chmod"; + bg = "setwallpaper"; + o = "open_config"; + br = "\$vimv \$fx"; # TODO what is this command? + r = "rename"; + H = "top"; + L = "bottom"; + R = "reload"; + C = "clear"; + U = "unselect"; + + # Movement + gjr = "cd ~/.local/share/Trash/files"; + gus = "cd /run/dt"; + + "gr." = "cd /home/dt/repos"; + grr = "cd /home/dt/repos/rust"; + grp = "cd /home/dt/repos/python"; + grc = "cd /home/dt/repos/c"; + gra = "cd /home/dt/repos/auto_hot_key"; + grt = "cd /home/dt/repos/tex"; + grs = "cd /home/dt/repos/shell"; + + grch = "cd /home/dt/repos/chroot"; + grpe = "cd /home/dt/repos/perl"; + grja = "cd /home/dt/repos/java"; + grjs = "cd /home/dt/repos/java_script"; + # ------------- + "gm." = "cd /home/dt/media"; + gmpi = "cd /home/dt/media/pictures"; + gmdo = "cd /home/dt/media/downloads"; + gmpl = "cd /home/dt/media/playlist"; + gmis = "cd /home/dt/media/isos"; + # ------------- + "gs." = "cd /home/dt/school"; + gsgs = "cd /home/dt/school/geschichte"; + gsch = "cd /home/dt/school/chemie"; + gsen = "cd /home/dt/school/english"; + gsgo = "cd /home/dt/school/geographie"; + gsin = "cd /home/dt/school/infomatik"; + gsso = "cd /home/dt/school/sozialkunde"; + gskr = "cd /home/dt/school/katholische_religion"; + gsmu = "cd /home/dt/school/musik"; + gsla = "cd /home/dt/school/latein"; + gsde = "cd /home/dt/school/deutsch"; + gsma = "cd /home/dt/school/mathematik"; + gspr = "cd /home/dt/school/praktikum"; + gsbi = "cd /home/dt/school/biologie"; + gssp = "cd /home/dt/school/sport"; + gsphy = "cd /home/dt/school/physik"; + gsphi = "cd /home/dt/school/philosophie"; + + gc = "cd ~/.config"; + gl = "cd ~/.local"; + gE = "cd /etc"; + + "gU." = "cd /usr"; + gUs = " cd /usr/share"; + + gt = "cd /tmp"; + }; + previewer = { + keybinding = "i"; + source = "ctpv"; + }; + settings = { + cleaner = "ctpvclear"; + autoquit = true; # quit the server, if no clients are left + dircounts = true; # count things in directories TODO this has performance impact + dirpreviews = true; # preview for directories + drawbox = true; + errorfmt = "\\033[1;91m==> ERROR:\\033[0m\\033[1;93m%s\\033[0m"; + hidden = true; # show hidden files + icons = true; + ifs = "\n"; # internal field separator for shell commands + info = ["size"]; # show the size of a directory + shell = "sh"; + shellopts = ["-e" "-u"]; # e: exit on error; u: error for unset variables + }; + extraConfig = '' + &ctpv -s $id + &ctpvquit $id + ''; + }; +} +# vim: ts=2 + diff --git a/home-manager/lf/icons b/home-manager/lf/icons new file mode 100644 index 00000000..68d53e34 --- /dev/null +++ b/home-manager/lf/icons @@ -0,0 +1,357 @@ +# vim:ft=conf + +# These examples require Nerd Fonts or a compatible font to be used. +# See https://www.nerdfonts.com for more information. + +# default values from lf (with matching order) +# ln l # LINK +# or l # ORPHAN +# tw t # STICKY_OTHER_WRITABLE +# ow d # OTHER_WRITABLE +# st t # STICKY +# di d # DIR +# pi p # FIFO +# so s # SOCK +# bd b # BLK +# cd c # CHR +# su u # SETUID +# sg g # SETGID +# ex x # EXEC +# fi - # FILE + +# file types (with matching order) +ln # LINK +or # ORPHAN +tw t # STICKY_OTHER_WRITABLE +ow # OTHER_WRITABLE +st t # STICKY +di # DIR +pi p # FIFO +so s # SOCK +bd b # BLK +cd c # CHR +su u # SETUID +sg g # SETGID +ex # EXEC +fi # FILE + +# file extensions (vim-devicons) +*.styl +*.sass +*.scss +*.htm +*.html +*.slim +*.haml +*.ejs +*.css +*.less +*.md +*.mdx +*.markdown +*.rmd +*.json +*.webmanifest +*.js +*.mjs +*.jsx +*.rb +*.gemspec +*.rake +*.php +*.py +*.pyc +*.pyo +*.pyd +*.coffee +*.mustache +*.hbs +*.conf +*.ini +*.yml +*.yaml +*.toml +*.bat +*.mk +*.jpg +*.jpeg +*.bmp +*.png +*.webp +*.gif +*.ico +*.twig +*.cpp +*.c++ +*.cxx +*.cc +*.cp +*.c +*.cs +*.h +*.hh +*.hpp +*.hxx +*.hs +*.lhs +*.nix +*.lua +*.java +*.sh +*.fish +*.bash +*.zsh +*.ksh +*.csh +*.awk +*.ps1 +*.ml λ +*.mli λ +*.diff +*.db +*.sql +*.dump +*.clj +*.cljc +*.cljs +*.edn +*.scala +*.go +*.dart +*.xul +*.sln +*.suo +*.pl +*.pm +*.t +*.rss +'*.f#' +*.fsscript +*.fsx +*.fs +*.fsi +*.rs +*.rlib +*.d +*.erl +*.hrl +*.ex +*.exs +*.eex +*.leex +*.heex +*.vim +*.ai +*.psd +*.psb +*.ts +*.tsx +*.jl +*.pp +*.vue ﵂ +*.elm +*.swift +*.xcplayground +*.tex ﭨ +*.r ﳒ +*.rproj 鉶 +*.sol ﲹ +*.pem + +# file names (vim-devicons) (case-insensitive not supported in lf) +*gruntfile.coffee +*gruntfile.js +*gruntfile.ls +*gulpfile.coffee +*gulpfile.js +*gulpfile.ls +*mix.lock +*dropbox +*.ds_store +*.gitconfig +*.gitignore +*.gitattributes +*.gitlab-ci.yml +*.bashrc +*.zshrc +*.zshenv +*.zprofile +*.vimrc +*.gvimrc +*_vimrc +*_gvimrc +*.bashprofile +*favicon.ico +*license +*node_modules +*react.jsx +*procfile +*dockerfile +*docker-compose.yml +*rakefile +*config.ru +*gemfile +*makefile +*cmakelists.txt +*robots.txt ﮧ + +# file names (case-sensitive adaptations) +*Gruntfile.coffee +*Gruntfile.js +*Gruntfile.ls +*Gulpfile.coffee +*Gulpfile.js +*Gulpfile.ls +*Dropbox +*.DS_Store +*LICENSE +*React.jsx +*Procfile +*Dockerfile +*Docker-compose.yml +*Rakefile +*Gemfile +*Makefile +*CMakeLists.txt + +# file patterns (vim-devicons) (patterns not supported in lf) +# .*jquery.*\.js$ +# .*angular.*\.js$ +# .*backbone.*\.js$ +# .*require.*\.js$ +# .*materialize.*\.js$ +# .*materialize.*\.css$ +# .*mootools.*\.js$ +# .*vimrc.* +# Vagrantfile$ + +# file patterns (file name adaptations) +*jquery.min.js +*angular.min.js +*backbone.min.js +*require.min.js +*materialize.min.js +*materialize.min.css +*mootools.min.js +*vimrc +Vagrantfile + +# archives or compressed (extensions from dircolors defaults) +*.tar +*.tgz +*.arc +*.arj +*.taz +*.lha +*.lz4 +*.lzh +*.lzma +*.tlz +*.txz +*.tzo +*.t7z +*.zip +*.z +*.dz +*.gz +*.lrz +*.lz +*.lzo +*.xz +*.zst +*.tzst +*.bz2 +*.bz +*.tbz +*.tbz2 +*.tz +*.deb +*.rpm +*.jar +*.war +*.ear +*.sar +*.rar +*.alz +*.ace +*.zoo +*.cpio +*.7z +*.rz +*.cab +*.wim +*.swm +*.dwm +*.esd + +# image formats (extensions from dircolors defaults) +*.jpg +*.jpeg +*.mjpg +*.mjpeg +*.gif +*.bmp +*.pbm +*.pgm +*.ppm +*.tga +*.xbm +*.xpm +*.tif +*.tiff +*.png +*.svg +*.svgz +*.mng +*.pcx +*.mov +*.mpg +*.mpeg +*.m2v +*.mkv +*.webm +*.ogm +*.mp4 +*.m4v +*.mp4v +*.vob +*.qt +*.nuv +*.wmv +*.asf +*.rm +*.rmvb +*.flc +*.avi +*.fli +*.flv +*.gl +*.dl +*.xcf +*.xwd +*.yuv +*.cgm +*.emf +*.ogv +*.ogx + +# audio formats (extensions from dircolors defaults) +*.aac +*.au +*.flac +*.m4a +*.mid +*.midi +*.mka +*.mp3 +*.mpc +*.ogg +*.ra +*.wav +*.oga +*.opus +*.spx +*.xspf + +# other formats +*.pdf diff --git a/home-manager/mako/default.nix b/home-manager/mako/default.nix new file mode 100644 index 00000000..30a11930 --- /dev/null +++ b/home-manager/mako/default.nix @@ -0,0 +1,46 @@ +{ + config, + pkgs, + ... +}: { + home-manager.programs.mako = { + enable = true; + backgroudColor = "#2e3440"; + borderColor = "#88c0d0"; + borderRadius = 25; + borderSize = 2; + defaultTimeout = 5000; + font = "Source Code Pro 10"; + width = 500; + height = 500; + icons = true; + ignore-timeout = true; + layer = "overlay"; + markup = true; # TODO + maxIconSize = 64; + sort = "-time"; + extraConfig = '' + [urgency=low] + border-color=#cccccc + + [urgency=normal] + border-color=#d08770 + + [urgency=high] + border-size=3 + border-color=#bf616a + default-timeout=0 + + [urgency=critical] + border-size=4 + border-color=#bf616a + default-timeout=0 + + [category=mpd] + default-timeout=2000 + group-by=category + ''; + }; +} +# vim: ts=2 + diff --git a/home-manager/mpd/default.nix b/home-manager/mpd/default.nix new file mode 100644 index 00000000..02b94d0e --- /dev/null +++ b/home-manager/mpd/default.nix @@ -0,0 +1,30 @@ +{ + config, + pkgs, + ... +}: let + dataDir = "$XDG_DATA_HOME/mpd"; +in { + home-manager.services.mpd = { + enable = true; + inherit dataDir; + musicDirectory = "~/media/music"; + network = { + listenAddress = "${dataDir}/socket"; + }; + extraConfig = '' + metadata_to_use "artist,album,title,track,name,genre,date,composer,performer,disc,comment" + auto_update "yes" + + #database { + # plugin "simple" + # path "~/.local/share/mpd/db + # cache_directory "~/.local/share/mpd/cache" + #} + + filesystem_charset "UTF-8" + ''; + }; +} +# vim: ts=2 + diff --git a/home-manager/mpd/mpdconf.example b/home-manager/mpd/mpdconf.example new file mode 100644 index 00000000..eaa5e641 --- /dev/null +++ b/home-manager/mpd/mpdconf.example @@ -0,0 +1,418 @@ +# An example configuration file for MPD. +# Read the user manual for documentation: http://www.musicpd.org/doc/user/ + + +# Files and directories ####################################################### +# +# This setting controls the top directory which MPD will search to discover the +# available audio files and add them to the daemon's online database. This +# setting defaults to the XDG directory, otherwise the music directory will be +# be disabled and audio files will only be accepted over ipc socket (using +# file:// protocol) or streaming files over an accepted protocol. +# +#music_directory "~/music" +# +# This setting sets the MPD internal playlist directory. The purpose of this +# directory is storage for playlists created by MPD. The server will use +# playlist files not created by the server but only if they are in the MPD +# format. This setting defaults to playlist saving being disabled. +# +#playlist_directory "~/.mpd/playlists" +# +# This setting sets the location of the MPD database. This file is used to +# load the database at server start up and store the database while the +# server is not up. This setting defaults to disabled which will allow +# MPD to accept files over ipc socket (using file:// protocol) or streaming +# files over an accepted protocol. +# +#db_file "~/.mpd/database" + +# These settings are the locations for the daemon log files for the daemon. +# +# The special value "syslog" makes MPD use the local syslog daemon. This +# setting defaults to logging to syslog. +# +# If you use systemd, do not configure a log_file. With systemd, MPD +# defaults to the systemd journal, which is fine. +# +#log_file "~/.mpd/log" + +# This setting sets the location of the file which stores the process ID +# for use of mpd --kill and some init scripts. This setting is disabled by +# default and the pid file will not be stored. +# +# If you use systemd, do not configure a pid_file. +# +#pid_file "~/.mpd/pid" + +# This setting sets the location of the file which contains information about +# most variables to get MPD back into the same general shape it was in before +# it was brought down. This setting is disabled by default and the server +# state will be reset on server start up. +# +#state_file "~/.mpd/state" +# +# The location of the sticker database. This is a database which +# manages dynamic information attached to songs. +# +#sticker_file "~/.mpd/sticker.sql" +# +############################################################################### + + +# General music daemon options ################################################ +# +# This setting specifies the user that MPD will run as. MPD should never run as +# root and you may use this setting to make MPD change its user ID after +# initialization. This setting is disabled by default and MPD is run as the +# current user. +# +#user "nobody" +# +# This setting specifies the group that MPD will run as. If not specified +# primary group of user specified with "user" setting will be used (if set). +# This is useful if MPD needs to be a member of group such as "audio" to +# have permission to use sound card. +# +#group "nogroup" +# +# This setting sets the address for the daemon to listen on. Careful attention +# should be paid if this is assigned to anything other than the default, any. +# This setting can deny access to control of the daemon. Not effective if +# systemd socket activation is in use. +# +# For network +#bind_to_address "any" +# +# And for Unix Socket +#bind_to_address "~/.mpd/socket" +# +# This setting is the TCP port that is desired for the daemon to get assigned +# to. +# +#port "6600" +# +# Suppress all messages below the given threshold. Use "verbose" for +# troubleshooting. Available setting arguments are "notice", "info", "verbose", +# "warning" and "error". +# +#log_level "notice" +# +# Setting "restore_paused" to "yes" puts MPD into pause mode instead +# of starting playback after startup. +# +#restore_paused "no" +# +# This setting enables MPD to create playlists in a format usable by other +# music players. +# +#save_absolute_paths_in_playlists "no" +# +# This setting defines a list of tag types that will be extracted during the +# audio file discovery process. The complete list of possible values can be +# found in the user manual. +#metadata_to_use "artist,album,title,track,name,genre,date,composer,performer,disc" +# +# This example just enables the "comment" tag without disabling all +# the other supported tags: +#metadata_to_use "+comment" +# +# This setting enables automatic update of MPD's database when files in +# music_directory are changed. +# +#auto_update "yes" +# +# Limit the depth of the directories being watched, 0 means only watch +# the music directory itself. There is no limit by default. +# +#auto_update_depth "3" +# +############################################################################### + + +# Symbolic link behavior ###################################################### +# +# If this setting is set to "yes", MPD will discover audio files by following +# symbolic links outside of the configured music_directory. +# +#follow_outside_symlinks "yes" +# +# If this setting is set to "yes", MPD will discover audio files by following +# symbolic links inside of the configured music_directory. +# +#follow_inside_symlinks "yes" +# +############################################################################### + + +# Zeroconf / Avahi Service Discovery ########################################## +# +# If this setting is set to "yes", service information will be published with +# Zeroconf / Avahi. +# +#zeroconf_enabled "yes" +# +# The argument to this setting will be the Zeroconf / Avahi unique name for +# this MPD server on the network. %h will be replaced with the hostname. +# +#zeroconf_name "Music Player @ %h" +# +############################################################################### + + +# Permissions ################################################################# +# +# If this setting is set, MPD will require password authorization. The password +# setting can be specified multiple times for different password profiles. +# +#password "password@read,add,control,admin" +# +# This setting specifies the permissions a user has who has not yet logged in. +# +#default_permissions "read,add,control,admin" +# +############################################################################### + + +# Database ####################################################################### +# +# An example of a database section instead of the old 'db_file' setting. +# It enables mounting other storages into the music directory. +# +#database { +# plugin "simple" +# path "~/.local/share/mpd/db +# cache_directory "~/.local/share/mpd/cache" +#} +# +# An example of database config for a satellite setup +# +#music_directory "nfs://fileserver.local/srv/mp3" +#database { +# plugin "proxy" +# host "other.mpd.host" +# port "6600" +#} + +# Input ####################################################################### +# +input { + plugin "curl" +# proxy "proxy.isp.com:8080" +# proxy_user "user" +# proxy_password "password" +} + +# +############################################################################### + +# Audio Output ################################################################ +# +# MPD supports various audio output types, as well as playing through multiple +# audio outputs at the same time, through multiple audio_output settings +# blocks. Setting this block is optional, though the server will only attempt +# autodetection for one sound card. +# +# An example of an ALSA output: +# +#audio_output { +# type "alsa" +# name "My ALSA Device" +## device "hw:0,0" # optional +## mixer_type "hardware" # optional +## mixer_device "default" # optional +## mixer_control "PCM" # optional +## mixer_index "0" # optional +#} +# +# An example of an OSS output: +# +#audio_output { +# type "oss" +# name "My OSS Device" +## device "/dev/dsp" # optional +## mixer_type "hardware" # optional +## mixer_device "/dev/mixer" # optional +## mixer_control "PCM" # optional +#} +# +# An example of a shout output (for streaming to Icecast): +# +#audio_output { +# type "shout" +# encoder "vorbis" # optional +# name "My Shout Stream" +# host "localhost" +# port "8000" +# mount "/mpd.ogg" +# password "hackme" +# quality "5.0" +# bitrate "128" +# format "44100:16:1" +## protocol "icecast2" # optional +## user "source" # optional +## description "My Stream Description" # optional +## url "http://example.com" # optional +## genre "jazz" # optional +## public "no" # optional +## timeout "2" # optional +## mixer_type "software" # optional +#} +# +# An example of a recorder output: +# +#audio_output { +# type "recorder" +# name "My recorder" +# encoder "vorbis" # optional, vorbis or lame +# path "/var/lib/mpd/recorder/mpd.ogg" +## quality "5.0" # do not define if bitrate is defined +# bitrate "128" # do not define if quality is defined +# format "44100:16:1" +#} +# +# An example of a httpd output (built-in HTTP streaming server): +# +#audio_output { +# type "httpd" +# name "My HTTP Stream" +# encoder "vorbis" # optional, vorbis or lame +# port "8000" +# bind_to_address "0.0.0.0" # optional, IPv4 or IPv6 +## quality "5.0" # do not define if bitrate is defined +# bitrate "128" # do not define if quality is defined +# format "44100:16:1" +# max_clients "0" # optional 0=no limit +#} +# +# An example of a pulseaudio output (streaming to a remote pulseaudio server) +# +#audio_output { +# type "pulse" +# name "My Pulse Output" +## server "remote_server" # optional +## sink "remote_server_sink" # optional +## media_role "media_role" #optional +#} +# +# An example of a winmm output (Windows multimedia API). +# +#audio_output { +# type "winmm" +# name "My WinMM output" +## device "Digital Audio (S/PDIF) (High Definition Audio Device)" # optional +# or +## device "0" # optional +## mixer_type "hardware" # optional +#} +# +# An example of a wasapi output (Windows multimedia API). +# +#audio_output { +# type "wasapi" +# name "My WASAPI output" +## device "Digital Audio (S/PDIF) (High Definition Audio Device)" # optional +# or +## device "0" # optional +## Exclusive mode blocks all other audio source, and get best audio quality without resampling. +## exclusive "no" # optional +## Enumerate all devices in log. +## enumerate "no" # optional +#} +# +# An example of an openal output. +# +#audio_output { +# type "openal" +# name "My OpenAL output" +## device "Digital Audio (S/PDIF) (High Definition Audio Device)" # optional +#} +# +# An example of an sndio output. +# +#audio_output { +# type "sndio" +# name "sndio output" +# mixer_type "hardware" +#} +# +# An example of an OS X output: +# +#audio_output { +# type "osx" +# name "My OS X Device" +## device "Built-in Output" # optional +## channel_map "-1,-1,0,1" # optional +#} +# +## Example "pipe" output: +# +#audio_output { +# type "pipe" +# name "my pipe" +# command "aplay -f cd 2>/dev/null" +## Or if you're want to use AudioCompress +# command "AudioCompress -m | aplay -f cd 2>/dev/null" +## Or to send raw PCM stream through PCM: +# command "nc example.org 8765" +# format "44100:16:2" +#} +# +## An example of a null output (for no audio output): +# +#audio_output { +# type "null" +# name "My Null Output" +# mixer_type "none" # optional +#} +# +############################################################################### + + +# Normalization automatic volume adjustments ################################## +# +# This setting specifies the type of ReplayGain to use. This setting can have +# the argument "off", "album", "track" or "auto". "auto" is a special mode that +# chooses between "track" and "album" depending on the current state of +# random playback. If random playback is enabled then "track" mode is used. +# See <https://wiki.hydrogenaud.io/index.php?title=Replaygain> for +# more details about ReplayGain. +# This setting is off by default. +# +#replaygain "album" +# +# This setting sets the pre-amp used for files that have ReplayGain tags. By +# default this setting is disabled. +# +#replaygain_preamp "0" +# +# This setting sets the pre-amp used for files that do NOT have ReplayGain tags. +# By default this setting is disabled. +# +#replaygain_missing_preamp "0" +# +# This setting enables or disables ReplayGain limiting. +# MPD calculates actual amplification based on the ReplayGain tags +# and replaygain_preamp / replaygain_missing_preamp setting. +# If replaygain_limit is enabled MPD will never amplify audio signal +# above its original level. If replaygain_limit is disabled such amplification +# might occur. By default this setting is enabled. +# +#replaygain_limit "yes" +# +# This setting enables on-the-fly normalization volume adjustment. This will +# result in the volume of all playing audio to be adjusted so the output has +# equal "loudness". This setting is disabled by default. +# +#volume_normalization "no" +# +############################################################################### + +# Character Encoding ########################################################## +# +# If file or directory names do not display correctly for your locale then you +# may need to modify this setting. +# +#filesystem_charset "UTF-8" +# +############################################################################### diff --git a/home-manager/mpd/test.TODO b/home-manager/mpd/test.TODO new file mode 100644 index 00000000..6225d8fd --- /dev/null +++ b/home-manager/mpd/test.TODO @@ -0,0 +1 @@ +# TODO this still needs some client |