From 7f1abd6092a66ec578d30329d8cb6dee350a338c Mon Sep 17 00:00:00 2001 From: Buliway Date: Wed, 31 Jul 2024 06:18:16 +0300 Subject: [PATCH] first testing cfg --- README.md | 1 + flake.lock | 27 + flake.nix | 49 + modules/home-manager/browsers/chromium.nix | 7 + modules/home-manager/browsers/firefox.nix | 77 + modules/home-manager/browsers/librewolf.nix | 57 + modules/home-manager/browsers/lynx.nix | 14 + modules/home-manager/bundle.nix | 32 + modules/home-manager/default-apps.nix | 120 ++ .../file-managers/ranger/commands.py | 136 ++ .../file-managers/ranger/ranger.nix | 79 + .../home-manager/file-managers/ranger/rc.conf | 333 ++++ .../file-managers/ranger/rifle.conf | 284 ++++ .../file-managers/ranger/scope.sh | 351 ++++ .../file-managers/thunar/thunar.nix | 3 + .../file-managers/thunar/thunar.xml | 21 + .../home-manager/file-managers/yazi/init.lua | 2 + .../file-managers/yazi/keymap.toml | 18 + .../yazi/plugins/exifaudio.yazi/LICENSE | 21 + .../yazi/plugins/exifaudio.yazi/README.md | 32 + .../yazi/plugins/exifaudio.yazi/init.lua | 139 ++ .../yazi/plugins/full-border.yazi/LICENSE | 21 + .../yazi/plugins/full-border.yazi/README.md | 28 + .../yazi/plugins/full-border.yazi/init.lua | 40 + .../yazi/plugins/glow.yazi/LICENSE | 7 + .../yazi/plugins/glow.yazi/README.md | 18 + .../yazi/plugins/glow.yazi/init.lua | 66 + .../yazi/plugins/miller.yazi/LICENSE | 7 + .../yazi/plugins/miller.yazi/README.md | 26 + .../yazi/plugins/miller.yazi/init.lua | 59 + .../yazi/plugins/ouch.yazi/LICENSE | 21 + .../yazi/plugins/ouch.yazi/README.md | 67 + .../yazi/plugins/ouch.yazi/init.lua | 143 ++ .../yazi/plugins/starship.yazi/LICENSE | 21 + .../yazi/plugins/starship.yazi/README.md | 99 ++ .../yazi/plugins/starship.yazi/init.lua | 28 + .../home-manager/file-managers/yazi/yazi.nix | 46 + .../home-manager/file-managers/yazi/yazi.toml | 33 + modules/home-manager/imv/config | 62 + modules/home-manager/imv/imv.nix | 5 + modules/home-manager/mpv/README.md | 160 ++ modules/home-manager/mpv/fonts/uosc_icons.otf | Bin 0 -> 400360 bytes .../home-manager/mpv/fonts/uosc_textures.ttf | Bin 0 -> 38228 bytes modules/home-manager/mpv/input.conf | 16 + modules/home-manager/mpv/mpv.conf | 55 + modules/home-manager/mpv/mpv.nix | 19 + .../mpv/script-opts/quality-menu.conf | 103 ++ .../mpv/script-opts/streamsave.conf | 24 + .../mpv/script-opts/thumbfast.conf | 38 + .../home-manager/mpv/script-opts/uosc.conf | 234 +++ modules/home-manager/mpv/scripts/clipshot.lua | 41 + .../home-manager/mpv/scripts/copyStuff.lua | 166 ++ .../home-manager/mpv/scripts/quality-menu.lua | 1289 +++++++++++++++ .../home-manager/mpv/scripts/simple-cut.lua | 117 ++ .../mpv/scripts/sponsorblock_minimal.lua | 130 ++ .../home-manager/mpv/scripts/streamsave.lua | 449 ++++++ .../home-manager/mpv/scripts/thumbfast.lua | 940 +++++++++++ .../mpv/scripts/uosc/bin/ziggy-linux | Bin 0 -> 5296128 bytes .../mpv/scripts/uosc/char-conv/zh.json | 405 +++++ .../uosc/elements/BufferingIndicator.lua | 39 + .../mpv/scripts/uosc/elements/Button.lua | 95 ++ .../mpv/scripts/uosc/elements/Controls.lua | 374 +++++ .../mpv/scripts/uosc/elements/Curtain.lua | 35 + .../mpv/scripts/uosc/elements/CycleButton.lua | 59 + .../mpv/scripts/uosc/elements/Element.lua | 194 +++ .../mpv/scripts/uosc/elements/Elements.lua | 152 ++ .../mpv/scripts/uosc/elements/Menu.lua | 1408 +++++++++++++++++ .../scripts/uosc/elements/PauseIndicator.lua | 83 + .../mpv/scripts/uosc/elements/Speed.lua | 191 +++ .../mpv/scripts/uosc/elements/Timeline.lua | 481 ++++++ .../mpv/scripts/uosc/elements/TopBar.lua | 349 ++++ .../mpv/scripts/uosc/elements/Updater.lua | 170 ++ .../mpv/scripts/uosc/elements/Volume.lua | 282 ++++ .../scripts/uosc/elements/WindowBorder.lua | 35 + .../mpv/scripts/uosc/intl/de.json | 83 + .../mpv/scripts/uosc/intl/es.json | 59 + .../mpv/scripts/uosc/intl/fr.json | 59 + .../mpv/scripts/uosc/intl/ro.json | 59 + .../mpv/scripts/uosc/intl/ru.json | 59 + .../mpv/scripts/uosc/intl/uk.json | 69 + .../mpv/scripts/uosc/intl/zh-hans.json | 83 + .../home-manager/mpv/scripts/uosc/lib/ass.lua | 242 +++ .../mpv/scripts/uosc/lib/char_conv.lua | 72 + .../mpv/scripts/uosc/lib/cursor.lua | 410 +++++ .../mpv/scripts/uosc/lib/intl.lua | 68 + .../mpv/scripts/uosc/lib/menus.lua | 877 ++++++++++ .../home-manager/mpv/scripts/uosc/lib/std.lua | 317 ++++ .../mpv/scripts/uosc/lib/text.lua | 515 ++++++ .../mpv/scripts/uosc/lib/utils.lua | 907 +++++++++++ .../home-manager/mpv/scripts/uosc/main.lua | 1140 +++++++++++++ modules/home-manager/obs/obs.nix | 20 + modules/home-manager/symlinks.nix | 21 + modules/home-manager/terminal/alacritty.nix | 31 + modules/home-manager/terminal/fish.nix | 80 + modules/home-manager/terminal/git.nix | 21 + modules/home-manager/terminal/kitty.nix | 15 + modules/home-manager/terminal/starship.nix | 14 + modules/home-manager/terminal/starship.toml | 164 ++ modules/home-manager/terminal/zellij.nix | 8 + modules/home-manager/terminal/zsh.nix | 92 ++ modules/home-manager/wm/bspwm.nix | 3 + modules/home-manager/wm/polybar.nix | 3 + modules/home-manager/wm/rofi.nix | 3 + modules/home-manager/wm/sxhkd.nix | 3 + modules/nixos/bundle.nix | 11 + modules/nixos/env.nix | 5 + modules/nixos/locale.nix | 21 + modules/nixos/network.nix | 19 + modules/nixos/sound.nix | 32 + modules/nixos/stylix.nix | 68 + modules/nixos/virtmanager.nix | 15 + modules/nixos/xserver.nix | 32 + nixos/configuration.nix | 61 + nixos/hardware-configuration.nix | 37 + nixos/home.nix | 29 + nixos/packages.nix | 161 ++ 116 files changed, 16721 insertions(+) create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 modules/home-manager/browsers/chromium.nix create mode 100644 modules/home-manager/browsers/firefox.nix create mode 100644 modules/home-manager/browsers/librewolf.nix create mode 100644 modules/home-manager/browsers/lynx.nix create mode 100644 modules/home-manager/bundle.nix create mode 100644 modules/home-manager/default-apps.nix create mode 100644 modules/home-manager/file-managers/ranger/commands.py create mode 100644 modules/home-manager/file-managers/ranger/ranger.nix create mode 100644 modules/home-manager/file-managers/ranger/rc.conf create mode 100644 modules/home-manager/file-managers/ranger/rifle.conf create mode 100644 modules/home-manager/file-managers/ranger/scope.sh create mode 100644 modules/home-manager/file-managers/thunar/thunar.nix create mode 100644 modules/home-manager/file-managers/thunar/thunar.xml create mode 100644 modules/home-manager/file-managers/yazi/init.lua create mode 100644 modules/home-manager/file-managers/yazi/keymap.toml create mode 100644 modules/home-manager/file-managers/yazi/plugins/exifaudio.yazi/LICENSE create mode 100644 modules/home-manager/file-managers/yazi/plugins/exifaudio.yazi/README.md create mode 100644 modules/home-manager/file-managers/yazi/plugins/exifaudio.yazi/init.lua create mode 100644 modules/home-manager/file-managers/yazi/plugins/full-border.yazi/LICENSE create mode 100644 modules/home-manager/file-managers/yazi/plugins/full-border.yazi/README.md create mode 100644 modules/home-manager/file-managers/yazi/plugins/full-border.yazi/init.lua create mode 100644 modules/home-manager/file-managers/yazi/plugins/glow.yazi/LICENSE create mode 100644 modules/home-manager/file-managers/yazi/plugins/glow.yazi/README.md create mode 100644 modules/home-manager/file-managers/yazi/plugins/glow.yazi/init.lua create mode 100644 modules/home-manager/file-managers/yazi/plugins/miller.yazi/LICENSE create mode 100644 modules/home-manager/file-managers/yazi/plugins/miller.yazi/README.md create mode 100644 modules/home-manager/file-managers/yazi/plugins/miller.yazi/init.lua create mode 100644 modules/home-manager/file-managers/yazi/plugins/ouch.yazi/LICENSE create mode 100644 modules/home-manager/file-managers/yazi/plugins/ouch.yazi/README.md create mode 100644 modules/home-manager/file-managers/yazi/plugins/ouch.yazi/init.lua create mode 100644 modules/home-manager/file-managers/yazi/plugins/starship.yazi/LICENSE create mode 100644 modules/home-manager/file-managers/yazi/plugins/starship.yazi/README.md create mode 100644 modules/home-manager/file-managers/yazi/plugins/starship.yazi/init.lua create mode 100644 modules/home-manager/file-managers/yazi/yazi.nix create mode 100644 modules/home-manager/file-managers/yazi/yazi.toml create mode 100644 modules/home-manager/imv/config create mode 100644 modules/home-manager/imv/imv.nix create mode 100644 modules/home-manager/mpv/README.md create mode 100644 modules/home-manager/mpv/fonts/uosc_icons.otf create mode 100644 modules/home-manager/mpv/fonts/uosc_textures.ttf create mode 100644 modules/home-manager/mpv/input.conf create mode 100644 modules/home-manager/mpv/mpv.conf create mode 100644 modules/home-manager/mpv/mpv.nix create mode 100644 modules/home-manager/mpv/script-opts/quality-menu.conf create mode 100644 modules/home-manager/mpv/script-opts/streamsave.conf create mode 100644 modules/home-manager/mpv/script-opts/thumbfast.conf create mode 100644 modules/home-manager/mpv/script-opts/uosc.conf create mode 100644 modules/home-manager/mpv/scripts/clipshot.lua create mode 100644 modules/home-manager/mpv/scripts/copyStuff.lua create mode 100644 modules/home-manager/mpv/scripts/quality-menu.lua create mode 100644 modules/home-manager/mpv/scripts/simple-cut.lua create mode 100644 modules/home-manager/mpv/scripts/sponsorblock_minimal.lua create mode 100644 modules/home-manager/mpv/scripts/streamsave.lua create mode 100644 modules/home-manager/mpv/scripts/thumbfast.lua create mode 100755 modules/home-manager/mpv/scripts/uosc/bin/ziggy-linux create mode 100644 modules/home-manager/mpv/scripts/uosc/char-conv/zh.json create mode 100644 modules/home-manager/mpv/scripts/uosc/elements/BufferingIndicator.lua create mode 100644 modules/home-manager/mpv/scripts/uosc/elements/Button.lua create mode 100644 modules/home-manager/mpv/scripts/uosc/elements/Controls.lua create mode 100644 modules/home-manager/mpv/scripts/uosc/elements/Curtain.lua create mode 100644 modules/home-manager/mpv/scripts/uosc/elements/CycleButton.lua create mode 100644 modules/home-manager/mpv/scripts/uosc/elements/Element.lua create mode 100644 modules/home-manager/mpv/scripts/uosc/elements/Elements.lua create mode 100644 modules/home-manager/mpv/scripts/uosc/elements/Menu.lua create mode 100644 modules/home-manager/mpv/scripts/uosc/elements/PauseIndicator.lua create mode 100644 modules/home-manager/mpv/scripts/uosc/elements/Speed.lua create mode 100644 modules/home-manager/mpv/scripts/uosc/elements/Timeline.lua create mode 100644 modules/home-manager/mpv/scripts/uosc/elements/TopBar.lua create mode 100644 modules/home-manager/mpv/scripts/uosc/elements/Updater.lua create mode 100644 modules/home-manager/mpv/scripts/uosc/elements/Volume.lua create mode 100644 modules/home-manager/mpv/scripts/uosc/elements/WindowBorder.lua create mode 100644 modules/home-manager/mpv/scripts/uosc/intl/de.json create mode 100644 modules/home-manager/mpv/scripts/uosc/intl/es.json create mode 100644 modules/home-manager/mpv/scripts/uosc/intl/fr.json create mode 100644 modules/home-manager/mpv/scripts/uosc/intl/ro.json create mode 100644 modules/home-manager/mpv/scripts/uosc/intl/ru.json create mode 100644 modules/home-manager/mpv/scripts/uosc/intl/uk.json create mode 100644 modules/home-manager/mpv/scripts/uosc/intl/zh-hans.json create mode 100644 modules/home-manager/mpv/scripts/uosc/lib/ass.lua create mode 100644 modules/home-manager/mpv/scripts/uosc/lib/char_conv.lua create mode 100644 modules/home-manager/mpv/scripts/uosc/lib/cursor.lua create mode 100644 modules/home-manager/mpv/scripts/uosc/lib/intl.lua create mode 100644 modules/home-manager/mpv/scripts/uosc/lib/menus.lua create mode 100644 modules/home-manager/mpv/scripts/uosc/lib/std.lua create mode 100644 modules/home-manager/mpv/scripts/uosc/lib/text.lua create mode 100644 modules/home-manager/mpv/scripts/uosc/lib/utils.lua create mode 100644 modules/home-manager/mpv/scripts/uosc/main.lua create mode 100644 modules/home-manager/obs/obs.nix create mode 100644 modules/home-manager/symlinks.nix create mode 100644 modules/home-manager/terminal/alacritty.nix create mode 100644 modules/home-manager/terminal/fish.nix create mode 100644 modules/home-manager/terminal/git.nix create mode 100644 modules/home-manager/terminal/kitty.nix create mode 100644 modules/home-manager/terminal/starship.nix create mode 100644 modules/home-manager/terminal/starship.toml create mode 100644 modules/home-manager/terminal/zellij.nix create mode 100644 modules/home-manager/terminal/zsh.nix create mode 100644 modules/home-manager/wm/bspwm.nix create mode 100644 modules/home-manager/wm/polybar.nix create mode 100644 modules/home-manager/wm/rofi.nix create mode 100644 modules/home-manager/wm/sxhkd.nix create mode 100644 modules/nixos/bundle.nix create mode 100644 modules/nixos/env.nix create mode 100644 modules/nixos/locale.nix create mode 100644 modules/nixos/network.nix create mode 100644 modules/nixos/sound.nix create mode 100644 modules/nixos/stylix.nix create mode 100644 modules/nixos/virtmanager.nix create mode 100644 modules/nixos/xserver.nix create mode 100644 nixos/configuration.nix create mode 100644 nixos/hardware-configuration.nix create mode 100644 nixos/home.nix create mode 100644 nixos/packages.nix diff --git a/README.md b/README.md index e69de29..7b9593e 100644 --- a/README.md +++ b/README.md @@ -0,0 +1 @@ +Это мои приватные дотсы \ No newline at end of file diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..0821cb0 --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1720768451, + "narHash": "sha256-EYekUHJE2gxeo2pM/zM9Wlqw1Uw2XTJXOSAO79ksc4Y=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "7e7c39ea35c5cdd002cd4588b03a3fb9ece6fad9", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..e0ec524 --- /dev/null +++ b/flake.nix @@ -0,0 +1,49 @@ +{ + description = "A very basic flake"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-24.05"; + + stylix = { + url = "github:danth/stylix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + home-manager = { + url = "github:nix-community/home-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + # nix-gaming = { # Удобно ставить некоторые игры + # url = "github:fufexan/nix-gaming"; + # inputs.nixpkgs.follows = "nixpkgs"; + # }; + + # firefox-addons = { # Мб не пригодится. Мб сработает другой метод установки через параметр + # url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons"; + # inputs.nixpkgs.follows = "nixpkgs"; + # }; + }; + + outputs = { self, nixpkgs, ... }@inputs: + # let + # system = "x86_64-linux"; + # pkgs = nixpkgs.legacyPackages.${system}; + # in + { + nixosConfigurations = { + nixos = nixpkgs.lib.nixosSystem { + specialArgs = {inherit inputs;}; + # inherit pkgs; + # inherit system; + modules = [ + ./nixos/configuration.nix + inputs.home-manager.nixosModules.default + inputs.stylix.nixosModules.stylix + ]; + }; + + }; + }; +} diff --git a/modules/home-manager/browsers/chromium.nix b/modules/home-manager/browsers/chromium.nix new file mode 100644 index 0000000..585ea19 --- /dev/null +++ b/modules/home-manager/browsers/chromium.nix @@ -0,0 +1,7 @@ +{ + programs.chromium = { + enable = true; + + # Настроить по фулам попробовать + }; +} \ No newline at end of file diff --git a/modules/home-manager/browsers/firefox.nix b/modules/home-manager/browsers/firefox.nix new file mode 100644 index 0000000..cb68650 --- /dev/null +++ b/modules/home-manager/browsers/firefox.nix @@ -0,0 +1,77 @@ +{ inputs, ... }: { + programs.firefox = { + enable = true; + + profiles.buliway = { + + # search = { + # engines = { + + # }; + + # force = true; + # }; + + # bookmarks = [ + # { + # name = "wikipedia"; + # tags = [ "wiki" ]; + # keyword = "wiki"; + # url = "https://en.wikipedia.org/wiki/Special:Search?search=%s&go=Go"; + # } + # { + # name = "kernel.org"; + # url = "https://www.kernel.org"; + # } + # { + # name = "Nix sites"; + # toolbar = true; + # bookmarks = [ + # { + # name = "homepage"; + # url = "https://nixos.org/"; + # } + # { + # name = "wiki"; + # tags = [ "wiki" "nix" ]; + # url = "https://wiki.nixos.org/"; + # } + # ]; + # } + # ]; + + # extensions = with inputs.firefox-addons.packages."x86_64-linux"; [ # Ты не активировал это во флейках + # bitwarden + # block-origin + # sponsorblock + # darkreader + # tridactyl + # youtube-shorts-block + # ]; + + nativeMessagingHosts.ff2mpv = true; # Чтоб ff2mpv работал + + settings = { + # "extensions.autoDisableScopes" = 0; # To automatically enable extensions + "browser.bookmarks.openInTabClosesMenu" = false; + "browser.tabs.loadBookmarksInBackground" = true; + "layout.css.has-selector.enabled" = true; + # https://github.com/K3V1991/Disable-Firefox-Telemetry-and-Data-Collection + "browser.newtabpage.activity-stream.feeds.telemetry" = false; + "browser.newtabpage.activity-stream.telemetry" = false; + "datareporting.healthreport.uploadEnabled" = false; + "datareporting.policy.dataSubmissionEnabled" = false; + "toolkit.telemetry.archive.enabled" = false; + "toolkit.telemetry.bhrPing.enabled" = false; + "toolkit.telemetry.enabled" = false; + "toolkit.telemetry.firstShutdownPing.enabled" = false; + "toolkit.telemetry.newProfilePing.enabled" = false; + "toolkit.telemetry.reportingpolicy.firstRun" = false; + "toolkit.telemetry.server" = ""; + "toolkit.telemetry.shutdownPingSender.enabled" = false; + "toolkit.telemetry.unified" = false; + "toolkit.telemetry.updatePing.enabled" = false; + }; + }; + }; +} \ No newline at end of file diff --git a/modules/home-manager/browsers/librewolf.nix b/modules/home-manager/browsers/librewolf.nix new file mode 100644 index 0000000..c6b24c1 --- /dev/null +++ b/modules/home-manager/browsers/librewolf.nix @@ -0,0 +1,57 @@ +{ pkgs, ... }: { + programs.librewolf = { + enable = true; + + settings = { # Надо из about:config записать сюда свои изменения + "browser.bookmarks.openInTabClosesMenu" = false; # Не закрывать каталог закладок при открытии через СКМ? Не помню + "browser.tabs.loadBookmarksInBackground" = true; # Не перекидывать меня сразу на открытую закладку через СКМ? Не помню + "layout.css.has-selector.enabled" = true; # Некоторые кастом стили это требуют + + # General + + # Search (Если надо вернуть гугл поисковик в стоке) + # "browser.policies.runOncePerModification.extensionsUninstall" = [ # Удалить расширения + # "amazondotcom@search.mozilla.org" + # "ebay@search.mozilla.org" + # "twitter@search.mozilla.org" + # ]; + # "browser.policies.runOncePerModification.removeSearchEngines" = [ # Удалить поисковые движки + # "Amazon.com" + # "eBay" + # "Twitter" + # ]; + # "browser.policies.runOncePerModification.setDefaultSearchEngine" = "Google"; # Стандартный поисковик + + # Privacy & Security + + # LibreWolf + "clipboard.autocopy" = false; # Выкл копирование колесом мыши + "middlemouse.paste" = false; # Выкл копирование колесом мыши + "network.dns.disableIPv6" = true; # Выкл ivp6 + "privacy.resistFingerprinting" = false; # Лайтовое и мб не ломает работу сайтов + "privacy.fingerprintingProtection" = false; # Хардовее и может ломать работу сайтов? + "webgl.disabled" = false; # Включить WebGL + + # Extensions + "browser.policies.runOncePerModification.extensionsInstall" = [ # Установка расширений + "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi" # uBlock + "https://addons.mozilla.org/firefox/downloads/latest/privacy-badger/latest.xpi" # Privacy Badger + ]; + }; + }; + + # Чтоб ff2mpv работал. Не надо юзать их скрипт с гитхаба + # Надо будет потом написать "nix-build -A ff2mpv", чтоб проверить реальный путь до ff2mpv бинаря + # home.file.".librewolf/native-messaging-hosts/ff2mpv.json".text = '' + # { + # "name": "ff2mpv", + # "description": "ff2mpv's external manifest", + # "path": "${pkgs.ff2mpv}/bin/ff2mpv.py", + # "type": "stdio", + # "allowed_extensions": ["ff2mpv@yossarian.net"] + # } + # ''; + + # Ниже сделать настройки расширений декларативными + # home.file.".config/starship.toml".source = ./starship.toml; +} \ No newline at end of file diff --git a/modules/home-manager/browsers/lynx.nix b/modules/home-manager/browsers/lynx.nix new file mode 100644 index 0000000..cc493ff --- /dev/null +++ b/modules/home-manager/browsers/lynx.nix @@ -0,0 +1,14 @@ +{ pkgs, ... }: { + home = { + packages = [ pkgs.lynx ]; # Текстовый браузер в терминале. Без картинок + + # Чтоб lynx отображал все символы, а не транслит + file.".lynxrc".text = '' + accept_all_cookies=on + force_ssl_cookies_secure=on + + case_sensitive_searching=off + character_set=UNICODE (UTF-8) + ''; + }; +} \ No newline at end of file diff --git a/modules/home-manager/bundle.nix b/modules/home-manager/bundle.nix new file mode 100644 index 0000000..d044c0b --- /dev/null +++ b/modules/home-manager/bundle.nix @@ -0,0 +1,32 @@ +{ + imports = [ + ./browsers/chromium.nix + ./browsers/firefox.nix + ./browsers/librewolf.nix + ./browsers/lynx.nix + + ./file-managers/ranger/ranger.nix + ./file-managers/thunar/thunar.nix + ./file-managers/yazi/yazi.nix + + ./imv/imv.nix + ./mpv/mpv.nix + ./obs/obs.nix + + ./terminal/alacritty.nix + ./terminal/fish.nix + ./terminal/git.nix + ./terminal/kitty.nix + ./terminal/starship.nix + ./terminal/zellij.nix + ./terminal/zsh.nix + + ./wm/bspwm.nix + ./wm/polybar.nix + ./wm/rofi.nix + ./wm/sxhkd.nix + + ./default-apps.nix + ./symlinks.nix + ]; +} \ No newline at end of file diff --git a/modules/home-manager/default-apps.nix b/modules/home-manager/default-apps.nix new file mode 100644 index 0000000..38831e7 --- /dev/null +++ b/modules/home-manager/default-apps.nix @@ -0,0 +1,120 @@ +# Команды для терминала +# Узнать тип файла - xdg-mime query filetype foo.pdf +# Узнать нынешнее дефолт приложения - xdg-mime query default application/pdf +# Узнать имя приложения. Для примера взять evince - fd evince.desktop / +# Выведет пути, по которым можно понять как называется приложение +# В список [] можно через пробел добавить другие варианты. Если первая прога не откроет, то попытается вторая +# Список mime types смотрел тут https://mimetype.io/all-types +# Нагуглить значение "x-scheme-handler" невозможно. Как я понял, это кастом типы + +############################################################################## +# Как система готова, то замени имена прог на реальные. Сейчас на абум стоят # +############################################################################## + +{ + xdg.mimeApps = { # Конфиг для `~/.config/mimeapps.list` + enable = true; + defaultApplications = { # Стандартные приложения для открытия нужного файла + # Browser + "application/x-extension-htm" = [ "librewolf.desktop" ]; + "application/x-extension-html" = [ "librewolf.desktop" ]; + "application/x-extension-shtml" = [ "librewolf.desktop" ]; + "application/x-extension-xht" = [ "librewolf.desktop" ]; + "application/x-extension-xhtml" = [ "librewolf.desktop" ]; + "application/xhtml+xml" = [ "librewolf.desktop" ]; + "x-scheme-handler/about" = [ "librewolf.desktop" ]; + "x-scheme-handler/chrome" = [ "librewolf.desktop" ]; + "x-scheme-handler/http" = [ "librewolf.desktop" ]; + "x-scheme-handler/https" = [ "librewolf.desktop" ]; + "x-scheme-handler/unknown" = [ "librewolf.desktop" ]; + # Images + "image/*" = [ "imv.desktop" "qview.desktop" ]; + "image/avif" = [ "imv.desktop" "qview.desktop" ]; + "image/gif" = [ "imv.desktop" "qview.desktop" ]; + "image/jpeg" = [ "imv.desktop" "qview.desktop" ]; # Обычный jpeg, прогрузка сверху вниз + "image/pjpeg" = [ "imv.desktop" "qview.desktop" ]; # Сначала размытый и постепенной лучше видно, для медленного инета + "image/apng" = [ "imv.desktop" "qview.desktop" ]; # Анимированный png + "image/png" = [ "imv.desktop" "qview.desktop" ]; + "image/svg+xml" = [ "imv.desktop" "qview.desktop" ]; + "image/webp" = [ "imv.desktop" "qview.desktop" ]; + "image/x-icon" = [ "imv.desktop" "qview.desktop" ]; + "image/vnd.microsoft.icon" = [ "imv.desktop" "qview.desktop" ]; + # Video + "video/*" = [ "mpv.desktop" ]; + "video/mp4" = [ "mpv.desktop" ]; + "video/mpeg" = [ "mpv.desktop" ]; + "video/quicktime" = [ "mpv.desktop" ]; + "video/webm" = [ "mpv.desktop" ]; + "video/x-matroska" = [ "mpv.desktop" ]; + # Audio + "audio/*" = [ "mpv.desktop" ]; + "audio/aac" = [ "mpv.desktop" ]; + "audio/flac" = [ "mpv.desktop" ]; + "audio/mp4" = [ "mpv.desktop" ]; + "audio/mpeg" = [ "mpv.desktop" ]; + "audio/ogg" = [ "mpv.desktop" ]; + "audio/opus" = [ "mpv.desktop" ]; + "audio/vnd.wav" = [ "mpv.desktop" ]; + "audio/webm" = [ "mpv.desktop" ]; + "audio/x-matroska" = [ "mpv.desktop" ]; + "audio/x-mpegurl" = [ "mpv.desktop" ]; # Для .m3u. Это файл-плейлист + "audio/x-opus+ogg" = [ "mpv.desktop" ]; # What's this? Why not "audio/ogg" and "audio/opus"? + # Text + "text/*" = [ "nvim.desktop" ]; # Надо ли заменять это и всё что ниже на NixVim? + "text/css" = [ "nvim.desktop" ]; + "text/csv" = [ "nvim.desktop" ]; + "text/html" = [ "nvim.desktop" "librewolf.desktop" ]; + "text/javascript" = [ "nvim.desktop" ]; + "text/markdown" = [ "nvim.desktop" ]; + "text/plain" = [ "nvim.desktop" ]; + "text/x-asm" = [ "nvim.desktop" ]; + "text/x-c" = [ "nvim.desktop" ]; + "text/x-python" = [ "nvim.desktop" ]; + "application/json" = [ "nvim.desktop" ]; + "application/x-sh" = [ "nvim.desktop" ]; + "application/x-shellscript" = [ "nvim.desktop" ]; + "application/xml" = [ "nvim.desktop" ]; + "application/yaml" = [ "nvim.desktop" ]; + # Мб потом добавить для docs варианты и разные виды архивов и ebook + # Other + "application/pdf" = [ "org.gnome.Evince.desktop" ]; + "application/x-zerosize" = [ "nvim.desktop" ]; # Файл нулевого размера + "application/zip" = [ "ark.desktop" ]; + "application/x-bittorrent" = [ "qbittorrent.desktop" ]; + "x-scheme-handler/magnet" = [ "qbittorrent.desktop" ]; + "inode/directory" = [ "thunar.desktop" ]; + "x-scheme-handler/mailto" = [ "thunderbird.desktop" ]; + "x-scheme-handler/jetbrains" = [ "jetbrains-toolbox.desktop" ]; + }; + associations.added = { # Дополнительные приложения для нужного файла. Будет в меню "Открыть с помощью" + # Images + "image/*" = [ "imv.desktop" "qview.desktop" ]; + "image/avif" = [ "imv.desktop" "qview.desktop" ]; + "image/gif" = [ "imv.desktop" "qview.desktop" ]; + "image/jpeg" = [ "imv.desktop" "qview.desktop" ]; # Обычный jpeg, прогрузка сверху вниз + "image/pjpeg" = [ "imv.desktop" "qview.desktop" ]; # Сначала размытый и постепенной лучше видно, для медленного инета + "image/apng" = [ "imv.desktop" "qview.desktop" ]; # Анимированный png + "image/png" = [ "imv.desktop" "qview.desktop" ]; + "image/svg+xml" = [ "imv.desktop" "qview.desktop" ]; + "image/webp" = [ "imv.desktop" "qview.desktop" ]; + "image/x-icon" = [ "imv.desktop" "qview.desktop" ]; + "image/vnd.microsoft.icon" = [ "imv.desktop" "qview.desktop" ]; + # Text + "text/*" = [ "nvim.desktop" "code.desktop" "codium.desktop" ]; # Надо ли заменять nvim и всё что ниже на NixVim? + "text/css" = [ "nvim.desktop" "code.desktop" "codium.desktop" ]; + "text/csv" = [ "nvim.desktop" "code.desktop" "codium.desktop" ]; + "text/html" = [ "nvim.desktop" "code.desktop" "codium.desktop" "librewolf.desktop" "firefox.desktop" "chromium.desktop" ]; + "text/javascript" = [ "nvim.desktop" "code.desktop" "codium.desktop" ]; + "text/markdown" = [ "nvim.desktop" "code.desktop" "codium.desktop" ]; + "text/plain" = [ "nvim.desktop" "code.desktop" "codium.desktop" ]; + "text/x-asm" = [ "nvim.desktop" "code.desktop" "codium.desktop" ]; + "text/x-c" = [ "nvim.desktop" "code.desktop" "codium.desktop" ]; + "text/x-python" = [ "nvim.desktop" "code.desktop" "codium.desktop" ]; + "application/json" = [ "nvim.desktop" "code.desktop" "codium.desktop" "librewolf.desktop" "firefox.desktop" "chromium.desktop" ]; + "application/x-sh" = [ "nvim.desktop" "code.desktop" "codium.desktop" ]; + "application/x-shellscript" = [ "nvim.desktop" "code.desktop" "codium.desktop" ]; + "application/xml" = [ "nvim.desktop" "code.desktop" "codium.desktop" ]; + "application/yaml" = [ "nvim.desktop" "code.desktop" "codium.desktop" ]; + }; + }; +} \ No newline at end of file diff --git a/modules/home-manager/file-managers/ranger/commands.py b/modules/home-manager/file-managers/ranger/commands.py new file mode 100644 index 0000000..f618a67 --- /dev/null +++ b/modules/home-manager/file-managers/ranger/commands.py @@ -0,0 +1,136 @@ +from __future__ import (absolute_import, division, print_function) + +import os +import subprocess +from ranger.api.commands import Command +from ranger.container.file import File +from ranger.ext.get_executables import get_executables + + +class YankContent(Command): + """ + Copy the content of image file and text file with xclip + """ + + def execute(self): + if 'xclip' not in get_executables(): + self.fm.notify('xclip is not found.', bad=True) + return + + arg = self.rest(1) + if arg: + if not os.path.isfile(arg): + self.fm.notify('{} is not a file.'.format(arg)) + return + file = File(arg) + else: + file = self.fm.thisfile + if not file.is_file: + self.fm.notify('{} is not a file.'.format(file.relative_path)) + return + + relative_path = file.relative_path + cmd = ['xclip', '-selection', 'clipboard'] + if not file.is_binary(): + with open(file.path, 'rb') as fd: + subprocess.check_call(cmd, stdin=fd) + elif file.image: + cmd += ['-t', file.mimetype, file.path] + subprocess.check_call(cmd) + self.fm.notify('Content of {} is copied to x clipboard'.format(relative_path)) + else: + self.fm.notify('{} is not an image file or a text file.'.format(relative_path)) + + def tab(self, tabnum): + return self._tab_directory_content() + + +class YankContentWl(Command): + """ + Copy the content of image file and text file with wl-clipboard + """ + + def execute(self): + if "wl-copy" not in get_executables(): + self.fm.notify("wl-clipboard is not found.", bad=True) + return + + arg = self.rest(1) + if arg: + if not os.path.isfile(arg): + self.fm.notify("{} is not a file".format(arg)) + return + file = File(arg) + else: + file = self.fm.thisfile + if not file.is_file: + self.fm.notify("{} is not a file".format(file.relative_path)) + return + if file.is_binary or file.image: + subprocess.check_call("wl-copy" + " < " + file.path, shell=True) + else: + self.fm.notify("{} is not an image file or a text file".format(file.relative_path)) + + +class fzf_select(Command): + """ + :fzf_select + Find a file using fzf. + With a prefix argument to select only directories. + + See: https://github.com/junegunn/fzf + """ + + def execute(self): + import subprocess + import os + from ranger.ext.get_executables import get_executables + + if 'fzf' not in get_executables(): + self.fm.notify('Could not find fzf in the PATH.', bad=True) + return + + fd = None + if 'fdfind' in get_executables(): + fd = 'fdfind' + elif 'fd' in get_executables(): + fd = 'fd' + + if fd is not None: + hidden = ('--hidden' if self.fm.settings.show_hidden else '') + exclude = "--no-ignore-vcs --exclude '.git' --exclude '*.py[co]' --exclude '__pycache__'" + only_directories = ('--type directory' if self.quantifier else '') + fzf_default_command = '{} --follow {} {} {} --color=always'.format( + fd, hidden, exclude, only_directories + ) + else: + hidden = ('-false' if self.fm.settings.show_hidden else r"-path '*/\.*' -prune") + exclude = r"\( -name '\.git' -o -name '*.py[co]' -o -fstype 'dev' -o -fstype 'proc' \) -prune" + only_directories = ('-type d' if self.quantifier else '') + fzf_default_command = 'find -L . -mindepth 1 {} -o {} -o {} -print | cut -b3-'.format( + hidden, exclude, only_directories + ) + + env = os.environ.copy() + env['FZF_DEFAULT_COMMAND'] = fzf_default_command + env['FZF_DEFAULT_OPTS'] = '--height=40% --layout=reverse --ansi --preview="{}"'.format(''' + ( + batcat --color=always {} || + bat --color=always {} || + cat {} || + tree -ahpCL 3 -I '.git' -I '*.py[co]' -I '__pycache__' {} + ) 2>/dev/null | head -n 100 + ''') + + fzf = self.fm.execute_command('fzf --no-multi', env=env, + universal_newlines=True, stdout=subprocess.PIPE) + stdout, _ = fzf.communicate() + if fzf.returncode == 0: + selected = os.path.abspath(stdout.strip()) + if os.path.isdir(selected): + self.fm.cd(selected) + else: + self.fm.select_file(selected) + + + diff --git a/modules/home-manager/file-managers/ranger/ranger.nix b/modules/home-manager/file-managers/ranger/ranger.nix new file mode 100644 index 0000000..4bba285 --- /dev/null +++ b/modules/home-manager/file-managers/ranger/ranger.nix @@ -0,0 +1,79 @@ +{ pkgs, ... }: { + programs.ranger = { # Файловый менеджер в терминале + enable = true; + + extraPackages = with pkgs; [ # Я так понимаю это список пакетов, которые я хочу добавить к ranger + # Preview + ueberzugpp # Preview images + imagemagick # Preview and auto-rotate images + librsvg # Preview SVG + ffmpeg_7 # Preview videos + ffmpegthumbnailer # Preview videos + bat # Syntax highlighting of code + unrar # Preview archives + lynx # Preview html pages + poppler # Preview PDF + djvulibre # Preview djvu + calibre # Preview ebooks (or epub-thumbnailer) + catdoc # Preview XLS as csv conversion + exiftool # Information about media files + odt2txt # For OpenDocument text files + jq # Preview JSON (А зачем? Есть же bat, который красиво код показывает) + sqlite3 # Listing tables in SQLite database + sqlite-utils # Fancier box drawing (optional) + fontforge # Preview font + openscad # 3D model previews (`stl`, `off`, `dxf`, `scad`, `csg`) + drawio # Preview draw.io diagram + pandoc # Preview DOCX, ePub, FB2, odt, ods, odp, sxw, html (using markdown) + + # Plugins + fd # for file searching + fzf # for quick file subtree navigation + zoxide # for historical directories navigation + xclip # for system clipboard support on x11 + #wl-clipboard # for system clipboard support on wayland + ]; + + plugins = [ + { + # :extract [DIRECTORY]: extracting files to a current or specified directory (optional). + # :extract_raw [FLAGS]: extracting files with specific flags (optional). + # :extract_to_dirs [FLAGS]: extracting each archive to a separate directory. E.g.: 1.zip to dir 1, 2.zip to dir 2, etc. + # :compress [FLAGS] [FILENAME.EXT]: compressing selected/marked files/directories to an archive. + # If an archive filename is not specified, it will be named after a parent dir. + name = "ranger-archives"; + src = builtins.fetchGit { + url = "https://github.com/maximtrp/ranger-archives"; + rev = "b4e136b24fdca7670e0c6105fb496e5df356ef25"; + }; + } + { # Нечёткий поиск по каталогу + name = "ranger-fzf-filter"; + src = builtins.fetchGit { + url = "https://github.com/MuXiu1997/ranger-fzf-filter"; + rev = "bf16de2e4ace415b685ff7c58306d0c5146f9f43"; + }; + } + { # Иконки для файлов. Требует nerd шрифт + name = "ranger-devicons"; + src = builtins.fetchGit { + url = "https://github.com/alexanderjeurissen/ranger_devicons"; + rev = "a8d626485ca83719e1d8d5e32289cd96a097c861"; + }; + } + # { # Другой вариант иконок. Красивее для файлов, хуже для каталогов. Требует изменить default_linemode в rc.conf + # name = "ranger-devicons2"; + # src = builtins.fetchGit { + # url = "https://github.com/cdump/ranger-devicons2"; + # rev = "9606009aa01743768b0f27de0a841f7d8fe196c5"; + # }; + # } + ]; + }; + + home.file = { + ".config/ranger/rc.conf" = ./rc.conf; + ".config/ranger/rifle.conf" = ./rifle.conf; + ".config/ranger/scope.sh" = ./scope.sh; + }; +} \ No newline at end of file diff --git a/modules/home-manager/file-managers/ranger/rc.conf b/modules/home-manager/file-managers/ranger/rc.conf new file mode 100644 index 0000000..ebce892 --- /dev/null +++ b/modules/home-manager/file-managers/ranger/rc.conf @@ -0,0 +1,333 @@ +# ===================================================================================== +# == Настройки. Писать комментарии после настройки нельзя, только в отдельной строке == +# ===================================================================================== + +# Which viewmode should be used? Possible values are: +# miller: Use miller columns which show multiple levels of the hierarchy +# multipane: Midnight-commander like multipane view showing all tabs next +# to each other +set viewmode miller +#set viewmode multipane + +# How many columns are there, and what are their relative widths? +set column_ratios 1,3,4 + +# Which files should be hidden? (regular expression) +set hidden_filter ^\.|\.(?:pyc|pyo|bak|swp)$|^lost\+found$|^__(py)?cache__$ + +# Show hidden files? You can toggle this by typing 'zh' +set show_hidden false + +# Ask for a confirmation when running the "delete" command? +# Valid values are "always", "never", "multiple" (default) +# With "multiple", ranger will ask only if you delete multiple files at once. +set confirm_on_delete always + +# Use non-default path for file preview script? +# ranger ships with scope.sh, a script that calls external programs (see +# README.md for dependencies) to preview images, archives, etc. +set preview_script ~/.config/ranger/scope.sh + +# Use the external preview script or display simple plain text or image previews? +set use_preview_script true + +# Automatically count files in the directory, even before entering them? +set automatically_count_files true + +# Open all images in this directory when running certain image viewers +# like feh or sxiv? You can still open selected files by marking them. +set open_all_images true + +# Be aware of version control systems and display information. +set vcs_aware false + +# State of the four backends git, hg, bzr, svn. The possible states are +# disabled, local (only show local info), enabled (show local and remote +# information). +set vcs_backend_git enabled +set vcs_backend_hg disabled +set vcs_backend_bzr disabled +set vcs_backend_svn disabled + +# Truncate the long commit messages to this length when shown in the statusbar. +set vcs_msg_length 50 + +# Use one of the supported image preview protocols +set preview_images true + +# Set the preview image method. Supported methods: +# В стоке "w3m" через "w3mimgpreview". Не тестил +# Для alacritty надо "ueberzug". Пишут X11 only, но на wayland тоже работало, пусть и с визуал багами +# Для kitty можно поставить "kitty". Пишут "tmux is unsupported" +set preview_images_method ueberzug + +# Delay in seconds before displaying an image with the w3m method. +# Increase it in case of experiencing display corruption. +set w3m_delay 0.02 + +# Manually adjust the w3mimg offset when using a terminal which needs this +set w3m_offset 0 + +# Default iTerm2 font size (see: preview_images_method: iterm2) +set iterm2_font_width 8 +set iterm2_font_height 11 + +# Use a unicode "..." character to mark cut-off filenames? +set unicode_ellipsis false + +# BIDI support - try to properly display file names in RTL languages (Hebrew, Arabic). +# Requires the python-bidi pip package +set bidi_support false + +# Show dotfiles in the bookmark preview box? +set show_hidden_bookmarks true + +# Which colorscheme to use? These colorschemes are available by default: +# default, jungle, snow, solarized +set colorscheme default + +# Preview files on the rightmost column? +# And collapse (shrink) the last column if there is nothing to preview? +set preview_files true +set preview_directories true +set collapse_preview true + +# Wrap long lines in plain text previews? +set wrap_plaintext_previews false + +# Save the console history on exit? +set save_console_history true + +# Draw the status bar on top of the browser window (default: bottom) +set status_bar_on_top false + +# Draw a progress bar in the status bar which displays the average state of all +# currently running tasks which support progress bars? +set draw_progress_bar_in_status_bar true + +# Draw borders around columns? (separators, outline, both, or none) +# Separators are vertical lines between columns. +# Outline draws a box around all the columns. +# Both combines the two. +set draw_borders both + +# Display the directory name in tabs? +set dirname_in_tabs true + +# Enable the mouse support? +set mouse_enabled true + +# Display the file size in the main column or status bar? +set display_size_in_main_column true +set display_size_in_status_bar true + +# Display the free disk space in the status bar? +set display_free_space_in_status_bar true + +# Display files tags in all columns or only in main column? +set display_tags_in_all_columns true + +# Set a title for the window? Updates both `WM_NAME` and `WM_ICON_NAME` +set update_title true + +# Set the tmux/screen window-name to "ranger"? +set update_tmux_title true + +# Shorten the title if it gets long? The number defines how many +# directories are displayed at once, 0 turns off this feature. +set shorten_title 3 + +# Show hostname in titlebar? +set hostname_in_titlebar true + +# Abbreviate $HOME with ~ in the titlebar (first line) of ranger? +set tilde_in_titlebar false + +# How many directory-changes or console-commands should be kept in history? +set max_history_size 20 +set max_console_history_size 50 + +# Try to keep so much space between the top/bottom border when scrolling: +set scroll_offset 8 + +# Flush the input after each key hit? (Noticeable when ranger lags) +set flushinput true + +# Padding on the right when there's no preview? +# This allows you to click into the space to run the file. +set padding_right true + +# Save bookmarks (used with mX and `X) instantly? +# This helps to synchronize bookmarks between multiple ranger +# instances but leads to *slight* performance loss. +# When false, bookmarks are saved when ranger is exited. +set autosave_bookmarks true + +# Save the "`" bookmark to disk. This can be used to switch to the last +# directory by typing "``". +set save_backtick_bookmark true + +# You can display the "real" cumulative size of directories by using the +# command :get_cumulative_size or typing "dc". The size is expensive to +# calculate and will not be updated automatically. You can choose +# to update it automatically though by turning on this option: +set autoupdate_cumulative_size false + +# Turning this on makes sense for screen readers: +set show_cursor false + +# One of: size, natural, basename, atime, ctime, mtime, type, random +set sort natural + +# Additional sorting options +set sort_reverse false +set sort_case_insensitive true +set sort_directories_first true +set sort_unicode false + +# Enable this if key combinations with the Alt Key don't work for you. +# (Especially on xterm) +set xterm_alt_key false + +# Whether to include bookmarks in cd command +set cd_bookmarks true + +# Changes case sensitivity for the cd command tab completion +set cd_tab_case sensitive + +# Use fuzzy tab completion with the "cd" command. For example, +# ":cd /u/lo/b" expands to ":cd /usr/local/bin". +set cd_tab_fuzzy false + +# Avoid previewing files larger than this size, in bytes. Use a value of 0 to +# disable this feature. +set preview_max_size 0 + +# The key hint lists up to this size have their sublists expanded. +# Otherwise the submaps are replaced with "...". +set hint_collapse_threshold 10 + +# Add the highlighted file to the path in the titlebar +set show_selection_in_titlebar true + +# The delay that ranger idly waits for user input, in milliseconds, with a +# resolution of 100ms. Lower delay reduces lag between directory updates but +# increases CPU load. +set idle_delay 2000 + +# When the metadata manager module looks for metadata, should it only look for +# a ".metadata.json" file in the current directory, or do a deep search and +# check all directories above the current one as well? +set metadata_deep_search false + +# Clear all existing filters when leaving a directory +set clear_filters_on_dir_change false + +# Disable displaying line numbers in main column. +# Possible values: false, absolute, relative. +set line_numbers false + +# When line_numbers=relative show the absolute line number in the +# current line. +set relative_current_zero false + +# Start line numbers from 1 instead of 0 +set one_indexed false + +# Save tabs on exit +set save_tabs_on_exit true + +# Enable scroll wrapping - moving down while on the last item will wrap around to +# the top and vice versa. +set wrap_scroll false + +# Set the global_inode_type_filter to nothing. Possible options: d, f and l for +# directories, files and symlinks respectively. +set global_inode_type_filter + +# This setting allows to freeze the list of files to save I/O bandwidth. It +# should be 'false' during start-up, but you can toggle it by pressing F. +set freeze_files false + +# Print file sizes in bytes instead of the default human-readable format. +set size_in_bytes false + +# Warn at startup if RANGER_LEVEL env var is greater than 0, in other words +# give a warning when you nest ranger in a subshell started by ranger. +# Special value "error" makes the warning more visible. +set nested_ranger_warning true + +# Чтоб иконки у файлов работали +default_linemode devicons + +# Другой вариант иконок. Красивее для файлов, хуже для каталогов +#default_linemode devicons2 + +# =================================================================== +# == Local Options +# =================================================================== +# You can set local options that only affect a single directory. + +# Examples: +# setlocal path=~/downloads sort mtime + +# =================================================================== +# == Command Aliases in the Console +# =================================================================== + +alias e edit +alias q quit +alias q! quit! +alias qa quitall +alias qa! quitall! +alias qall quitall +alias qall! quitall! +alias setl setlocal + +alias filter scout -prts +alias find scout -aets +alias mark scout -mr +alias unmark scout -Mr +alias search scout -rs +alias search_inc scout -rts +alias travel scout -aefklst + +# =================================================================== +# == Бинды. Мои настройки добавляются к стоковым, так что дублировать их не обязательно +# == Мои настройки перебивают стоковые, если занять ту же кнопку +# == Некоторые бинды не работают при обычном написании. Тогда надо писать код бинда +# == Чтоб узнать код бинда, пиши в терминал это и жми нужное сочетание клавиш +# == /usr/share/doc/ranger/tools/print_keys.py +# == Default config https://github.com/ranger/ranger/blob/master/ranger/config/rc.conf +# =================================================================== + +# map console delete + +# Alt Down. Скролить превью по одной строке вниз +map <538> scroll_preview 1 +# Alt Up. Скролить превью по одной строке вверх +map <579> scroll_preview -1 +# Alt Ctrl Down. Скролить превью по 10 строк вниз +map <542> scroll_preview 10 +# Alt Ctrl Up. Скролить превью по 10 строк вверх +map <583> scroll_preview -10 +# Shift Down. Пол экрана вниз +map <336> move down=0.5 pages=True +# Shift Up. Пол экрана вверх +map <337> move up=0.5 pages=True +# Alt Right. Переключение между вкладками +map <573> tab_move 1 +# Alt Left. Переключение между вкладками +map <558> tab_move -1 + +# Copy to clipboard on X11 +map yx YankContent + +# Copy to clipboard on Wayland +map yw YankContentWl + +# Find a file using fzf +map fzf_select + +# fzf filter +map f console fzf_filter%space diff --git a/modules/home-manager/file-managers/ranger/rifle.conf b/modules/home-manager/file-managers/ranger/rifle.conf new file mode 100644 index 0000000..35f66a7 --- /dev/null +++ b/modules/home-manager/file-managers/ranger/rifle.conf @@ -0,0 +1,284 @@ +# vim: ft=cfg +# +# This is the configuration file of "rifle", ranger's file executor/opener. +# Each line consists of conditions and a command. For each line the conditions +# are checked and if they are met, the respective command is run. +# +# Syntax: +# , , ... = command +# +# The command can contain these environment variables: +# $1-$9 | The n-th selected file +# $@ | All selected files +# +# If you use the special command "ask", rifle will ask you what program to run. +# +# Prefixing a condition with "!" will negate its result. +# These conditions are currently supported: +# match | The regexp matches $1 +# ext | The regexp matches the extension of $1 +# mime | The regexp matches the mime type of $1 +# name | The regexp matches the basename of $1 +# path | The regexp matches the absolute path of $1 +# has | The program is installed (i.e. located in $PATH) +# env | The environment variable "variable" is non-empty +# file | $1 is a file +# directory | $1 is a directory +# number | change the number of this command to n +# terminal | stdin, stderr and stdout are connected to a terminal +# X | A graphical environment is available (darwin, Xorg, or Wayland) +# +# There are also pseudo-conditions which have a "side effect": +# flag | Change how the program is run. See below. +# label