Compare commits

...

30 commits
main ... gnome

Author SHA1 Message Date
Leonardo Eugênio 5bccabc8c8 update 2024-09-15 19:50:52 -03:00
Leonardo Eugênio 9f05154dad home: remove engrampa 2024-09-13 19:52:58 -03:00
Leonardo Eugênio 8d37bc0c88 update 2024-09-11 20:26:53 -03:00
Leonardo Eugênio ba07cf6a42 gnome: show controller battery in top bar 2024-09-11 20:26:37 -03:00
Leonardo Eugênio 0a4cabca4b monolith: don't use controller touchpads as mice 2024-09-11 20:26:08 -03:00
Leonardo Eugênio b2bdcb1724 helix: minor updates 2024-09-06 00:10:22 -03:00
Leonardo Eugênio 16d3af4edb update 2024-09-05 22:14:22 -03:00
Leonardo Eugênio 8e839d9174 monolith: undervolt to -120 2024-09-05 22:14:15 -03:00
Leonardo Eugênio d710bed16a firefox: improve theme 2024-09-05 22:13:38 -03:00
Leonardo Eugênio d6d5643040 Revert "monolith: switch to latest kernel"
This reverts commit 42de0ba722.
2024-09-02 19:13:59 -03:00
Leonardo Eugênio 99168284c6 update 2024-08-30 19:25:43 -03:00
Leonardo Eugênio 42de0ba722 monolith: switch to latest kernel 2024-08-30 19:25:36 -03:00
Leonardo Eugênio 03fd8951d8 krita: fix missing thumbnails 2024-08-30 18:29:12 -03:00
Leonardo Eugênio 6cc1f8a381 firefox: hide private browsing icon 2024-08-29 12:55:50 -03:00
Leonardo Eugênio b6799321c1 hardware: remove controller hacks 2024-08-28 19:56:54 -03:00
Leonardo Eugênio 14d4d41b48 update 2024-08-28 10:52:38 -03:00
Leonardo Eugênio 139d76bca8 environment: set codium as default editor 2024-08-28 10:52:32 -03:00
Leonardo Eugênio 65edfe5a9a gnome: install draw-on-your-screen2 2024-08-23 23:55:33 -03:00
lelgenio a28e50f48a syncthing: restore syncthing 2024-08-23 16:15:23 -03:00
Leonardo Eugênio 8e028e7066 vscode: update config 2024-08-23 14:12:47 -03:00
Leonardo Eugênio 79d96e3c60 vscode: fix nix formatter 2024-08-22 18:05:40 -03:00
Leonardo Eugênio 7d6c0d50d7 vscode: fix typescript and other extensions 2024-08-22 18:05:18 -03:00
Leonardo Eugênio 92c5040b91 fish: remove useless init commands 2024-08-21 11:48:45 -03:00
Leonardo Eugênio 59c5099cd6 monolith: enable auto updates 2024-08-20 19:43:49 -03:00
Leonardo Eugênio c6c4417aeb update 2024-08-20 19:39:53 -03:00
Leonardo Eugênio a7770ae62e scripts: cleanup old scripts 2024-08-20 19:21:57 -03:00
Leonardo Eugênio 2e2f2239a5 tree-wide: remove sway related config 2024-08-20 19:16:39 -03:00
Leonardo Eugênio 7780de1f47 variables: switch to gnome 2024-08-20 14:16:08 -03:00
Leonardo Eugênio b094f8ea74 firefox: update gnome theme 2024-08-20 14:15:58 -03:00
Leonardo Eugênio 9ffd7e1175 firefox: remove extensions 2024-08-20 14:15:46 -03:00
118 changed files with 170 additions and 7683 deletions

View file

@ -176,11 +176,11 @@
]
},
"locked": {
"lastModified": 1723685519,
"narHash": "sha256-GkXQIoZmW2zCPp1YFtAYGg/xHNyFH/Mgm79lcs81rq0=",
"lastModified": 1724769572,
"narHash": "sha256-K+HQbC2/hnGngIB019mX6f4XUrf7dB1eBfiUHW4Vx48=",
"owner": "nix-community",
"repo": "disko",
"rev": "276a0d055a720691912c6a34abb724e395c8e38a",
"rev": "b89a61129f3976d6440e2356ac5d3e30930f7012",
"type": "github"
},
"original": {
@ -414,11 +414,11 @@
]
},
"locked": {
"lastModified": 1723352546,
"narHash": "sha256-WTIrvp0yV8ODd6lxAq4F7EbrPQv0gscBnyfn559c3k8=",
"lastModified": 1724576102,
"narHash": "sha256-uM7n5nNL6fmA0bwMJBNll11f4cMWOFa2Ni6F5KeIldM=",
"owner": "Mic92",
"repo": "nix-index-database",
"rev": "ec78079a904d7d55e81a0468d764d0fffb50ac06",
"rev": "e333d62b70b179da1dd78d94315e8a390f2d12e5",
"type": "github"
},
"original": {
@ -456,11 +456,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1723556749,
"narHash": "sha256-+CHVZnTnIYRLYsARInHYoWkujzcRkLY/gXm3s5bE52o=",
"lastModified": 1726320982,
"narHash": "sha256-RuVXUwcYwaUeks6h3OLrEmg14z9aFXdWppTWPMTwdQw=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "4a92571f9207810b559c9eac203d1f4d79830073",
"rev": "8f7492cce28977fbf8bd12c72af08b1f6c7c3e49",
"type": "github"
},
"original": {
@ -469,6 +469,21 @@
"type": "indirect"
}
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1726334142,
"narHash": "sha256-SxGeAYrGoCnaGkQHNzGvExpgJv1pfS5J2pMX7zlwWxE=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "d9d07251f12399413e6d33d5875a6f1994ef75a7",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixpkgs-unstable",
"type": "indirect"
}
},
"plymouth-themes": {
"flake": false,
"locked": {
@ -512,6 +527,7 @@
"nix-index-database": "nix-index-database",
"nixos-mailserver": "nixos-mailserver",
"nixpkgs": "nixpkgs",
"nixpkgs-unstable": "nixpkgs-unstable",
"plymouth-themes": "plymouth-themes",
"ranger-icons": "ranger-icons",
"tlauncher": "tlauncher",

View file

@ -75,9 +75,7 @@
pkgs = import inputs.nixpkgs nixpkgsConfig;
lib = inputs.nixpkgs.lib;
packages = import ./pkgs { inherit pkgs inputs; };
old_overlays = (import ./overlays { inherit packages inputs; });
old_overlays = (import ./overlays { inherit inputs; });
specialArgs = {
inherit inputs;
@ -87,8 +85,6 @@
{ nixpkgs.pkgs = pkgs; }
./system/configuration.nix
./system/secrets.nix
./system/greetd.nix
{ login-manager.greetd.enable = desktop == "sway"; }
inputs.agenix.nixosModules.default
inputs.dzgui-nix.nixosModules.default
@ -124,7 +120,6 @@
./hosts/monolith
./system/monolith-gitlab-runner.nix
./system/monolith-forgejo-runner.nix
./system/nix-serve.nix
./system/steam.nix
] ++ common_modules;
};
@ -172,7 +167,7 @@
modules = [ ./user/home.nix ];
};
packages.${system} = pkgs // packages;
packages.${system} = pkgs;
formatter.${system} = pkgs.nixfmt-rfc-style;
};

View file

@ -146,9 +146,10 @@ in
virtualisation.virtualbox.host.enable = true;
services.udev.extraRules = ''
# Fix broken suspend with Logitech USB dongle
# `lsusb | grep Logitech` will return "vendor:product"
ACTION=="add" SUBSYSTEM=="usb" ATTR{idVendor}=="046d" ATTR{idProduct}=="c547" ATTR{power/wakeup}="disabled"
# Disable using controller touchpad as mouse
# https://wiki.archlinux.org/title/Gamepad#libinput
ATTRS{name}=="Wireless Controller Touchpad", ENV{LIBINPUT_IGNORE_DEVICE}="1"
# Force all disks to use mq-deadline scheduler
# For some reason "noop" is used by default which is kinda bad when io is saturated
ACTION=="add|change", KERNEL=="sd[a-z]*[0-9]*|mmcblk[0-9]*p[0-9]*|nvme[0-9]*n[0-9]*p[0-9]*", ATTR{../queue/scheduler}="mq-deadline"
@ -173,4 +174,16 @@ in
# size = (1024 * 16) + (1024 * 2); # RAM size + 2 GB
# }
# ];
system.autoUpgrade = {
enable = true;
dates = "04:40";
operation = "switch";
flags = [
"--update-input"
"nixpkgs"
"--print-build-logs"
];
flake = "/home/lelgenio/projects/nixos-config#monolith";
};
}

View file

@ -6,7 +6,7 @@ let
echo "manual" > power_dpm_force_performance_level
echo "1" > pp_power_profile_mode
test -e pp_od_clk_voltage
echo "vo -100" > pp_od_clk_voltage
echo "vo -120" > pp_od_clk_voltage
echo "c" > pp_od_clk_voltage
'';
in

View file

@ -1,10 +1,10 @@
{ inputs, packages, ... }:
{ inputs, ... }:
rec {
all = [
scripts
themes
(import ../pkgs)
new-packages
patches
lib_extended
disko
];
@ -34,28 +34,12 @@ rec {
}
);
new-packages = (
final: prev:
packages
// {
dhist = inputs.dhist.packages.${prev.system}.dhist;
demoji = inputs.demoji.packages.${prev.system}.default;
tlauncher = inputs.tlauncher.packages.${prev.system}.tlauncher;
wl-crosshair = inputs.wl-crosshair.packages.${prev.system}.default;
}
);
patches = (
final: prev: {
mySway = prev.sway.override {
withBaseWrapper = true;
withGtkWrapper = true;
sway-unwrapped = prev.sway-unwrapped.overrideAttrs (old: {
patches = old.patches ++ [ ../patches/sway/fix-hide_cursor-clearing-focus.patch ];
});
};
}
);
new-packages = final: prev: {
dhist = inputs.dhist.packages.${prev.system}.dhist;
demoji = inputs.demoji.packages.${prev.system}.default;
tlauncher = inputs.tlauncher.packages.${prev.system}.tlauncher;
wl-crosshair = inputs.wl-crosshair.packages.${prev.system}.default;
};
lib_extended = (
final: prev: {

View file

@ -1,19 +0,0 @@
commit 9c516cc61775a88312280f7732328d5fdf7af825
Author: lelgenio <lelgenio@disroot.org>
Date: Mon May 22 11:30:01 2023 -0300
fix: limit lowest value for corner-radious at 0
diff --git a/src/_sass/_variables.scss b/src/_sass/_variables.scss
index 9915a22..6e87a4f 100644
--- a/src/_sass/_variables.scss
+++ b/src/_sass/_variables.scss
@@ -24,7 +24,7 @@ $large-icon-size: 32px;
//
$window-radius: $default_corner + $space-size;
-$corner-radius: if($compact == 'false', $default_corner, $default_corner - 2px);
+$corner-radius: if($compact == 'false', $default_corner, max(0, $default_corner - 2px));
$material-radius: $default_corner / 2 + 4px;
$menu-radius: $default_corner / 4 + $space-size + 2px;
$popup-radius: $default_corner + $space-size + 2px;

View file

@ -1,24 +0,0 @@
From b21dc487ac4bfc086cf295e06b8d8765a99e7266 Mon Sep 17 00:00:00 2001
From: lelgenio <lelgenio@disroot.org>
Date: Thu, 24 Jun 2021 22:36:10 -0300
Subject: [PATCH] Fix #6297
This makes it so that `seat hide_cursor` no longer clears cursor focus when hidding.
Clearing focus casuses problems whenever keyboard and mouse are to be used in conjunction.
---
sway/input/cursor.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/sway/input/cursor.c b/sway/input/cursor.c
index 96b5b93514..99fe3b4e3f 100644
--- a/sway/input/cursor.c
+++ b/sway/input/cursor.c
@@ -236,7 +236,6 @@ void cursor_update_image(struct sway_cursor *cursor,
static void cursor_hide(struct sway_cursor *cursor) {
wlr_cursor_set_image(cursor->cursor, NULL, 0, 0, 0, 0, 0, 0);
cursor->hidden = true;
- wlr_seat_pointer_notify_clear_focus(cursor->seat->wlr_seat);
}
static int hide_notify(void *data) {

View file

@ -1,64 +0,0 @@
{
lib,
mkYarnPackage,
fetchFromGitHub,
fetchYarnDeps,
testers,
writeText,
runCommand,
blade-formatter,
}:
mkYarnPackage rec {
pname = "blade-formatter";
version = "1.38.2";
src = fetchFromGitHub {
owner = "shufo";
repo = pname;
rev = "v${version}";
hash = "sha256-JvILLw7Yp4g/dSsYtZ2ylmlXfS9t+2KADlBrYOJWTpg=";
};
packageJSON = ./package.json;
offlineCache = fetchYarnDeps {
yarnLock = "${src}/yarn.lock";
hash = "sha256-UFDxw3fYMzSUhZw+TCEh/dN7OioKI75LzKSnEwGPKDA=";
};
postBuild = "yarn build";
passthru.tests = {
version = testers.testVersion {
package = blade-formatter;
command = "blade-formatter --version";
};
simple = testers.testEqualContents {
assertion = "blade-formatter formats a basic blade file";
expected = writeText "expected" ''
@if (true)
Hello world!
@endif
'';
actual =
runCommand "actual"
{
nativeBuildInputs = [ blade-formatter ];
base = writeText "base" ''
@if( true ) Hello world! @endif
'';
}
''
blade-formatter $base > $out
'';
};
};
meta = with lib; {
description = "Laravel Blade template formatter";
homepage = "https://github.com/shufo/blade-formatter";
license = licenses.mit;
maintainers = with maintainers; [ lelgenio ];
};
}

View file

@ -1,120 +0,0 @@
{
"name": "blade-formatter",
"engines": {
"node": ">= 14.0.0"
},
"keywords": [
"php",
"formatter",
"laravel"
],
"version": "1.38.2",
"description": "An opinionated blade template formatter for Laravel",
"main": "./dist/bundle.cjs",
"types": "./dist/types/main.d.ts",
"type": "module",
"exports": {
".": {
"import": "./dist/bundle.js",
"require": "./dist/bundle.cjs",
"default": "./dist/bundle.js"
},
"./*": "./*"
},
"scripts": {
"build": "cross-env NODE_ENV=production node esbuild.js && cross-env NODE_ENV=production ESM_BUILD=true node esbuild.js",
"prepublish": "tsc src/main.ts --declaration --emitDeclarationOnly --outDir ./dist/types || true",
"watch": "node esbuild.js",
"test": "yarn run build && node --experimental-vm-modules node_modules/.bin/jest",
"lint": "eslint src -c .eslintrc.json --ext ts",
"fix": "prettier {src,__tests__}/**/*.ts --write",
"check_formatted": "prettier **/*.ts -c",
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0",
"prepare": "husky install",
"bin": "cross-env ./bin/blade-formatter.cjs"
},
"bin": {
"blade-formatter": "bin/blade-formatter.cjs"
},
"author": "Shuhei Hayashibara",
"license": "MIT",
"dependencies": {
"@prettier/plugin-php": "^0.19.7",
"@shufo/tailwindcss-class-sorter": "3.0.1",
"aigle": "^1.14.1",
"ajv": "^8.9.0",
"chalk": "^4.1.0",
"concat-stream": "^2.0.0",
"detect-indent": "^6.0.0",
"find-config": "^1.0.0",
"glob": "^8.0.1",
"html-attribute-sorter": "^0.4.3",
"ignore": "^5.1.8",
"js-beautify": "^1.14.8",
"lodash": "^4.17.19",
"php-parser": "3.1.5",
"prettier": "^2.2.0",
"tailwindcss": "^3.1.8",
"vscode-oniguruma": "1.7.0",
"vscode-textmate": "^7.0.1",
"xregexp": "^5.0.1",
"yargs": "^17.3.1"
},
"devDependencies": {
"@babel/core": "^7.6.4",
"@babel/plugin-transform-modules-commonjs": "^7.16.5",
"@babel/preset-env": "^7.13.12",
"@babel/preset-typescript": "^7.16.5",
"@types/concat-stream": "^2.0.0",
"@types/find-config": "^1.0.1",
"@types/fs-extra": "^11.0.0",
"@types/glob": "^8.0.0",
"@types/jest": "^29.0.0",
"@types/js-beautify": "^1.13.3",
"@types/lodash": "^4.14.178",
"@types/mocha": "^10.0.0",
"@types/node": "^18.0.0",
"@types/xregexp": "^4.4.0",
"@typescript-eslint/eslint-plugin": "^5.8.1",
"@typescript-eslint/parser": "^5.8.1",
"app-root-path": "^3.0.0",
"babel-jest": "^29.0.0",
"codecov": "^3.8.3",
"cross-env": "^7.0.3",
"esbuild": "^0.19.0",
"esbuild-node-externals": "^1.4.1",
"eslint": "^8.5.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-airbnb-typescript": "^17.0.0",
"eslint-config-prettier": "^9.0.0",
"eslint-import-resolver-typescript": "^3.0.0",
"eslint-plugin-import": "^2.25.3",
"eslint-plugin-jest": "^26.0.0",
"eslint-plugin-prettier": "^5.0.0",
"fs-extra": "^11.0.0",
"husky": "^8.0.0",
"jest": "^29.0.0",
"lint-staged": ">=10",
"source-map-loader": "^4.0.0",
"ts-jest": "^29.0.0",
"ts-loader": "^9.2.6",
"ts-migrate": "^0.1.27",
"ts-node": "^10.4.0",
"typescript": "^5.0.0"
},
"repository": {
"type": "git",
"url": "https://github.com/shufo/blade-formatter.git"
},
"files": [
"dist",
"src",
"bin",
"wasm",
"syntaxes",
"CHANGELOG.md"
],
"lint-staged": {
"*.ts": "yarn run fix"
}
}

View file

@ -1,38 +0,0 @@
{
lib,
rustPlatform,
fetchFromGitHub,
pkg-config,
openssl,
zlib,
stdenv,
Security ? null,
}:
rustPlatform.buildRustPackage rec {
pname = "cargo-checkmate";
version = "0.1.10";
src = fetchFromGitHub {
owner = "cargo-checkmate";
repo = pname;
rev = "v${version}";
hash = "sha256-I8l/r26cDdimjgy/+IsasF4iHX09UGjVj0Yf6ScI3wQ=";
};
cargoSha256 = "sha256-hOB84u55ishahIFSqBnqccqH3OlC9J8mCYzsd23jTyA=";
nativeBuildInputs = [ pkg-config ];
buildInputs = [ openssl ] ++ lib.optionals stdenv.isDarwin [ Security ];
meta = with lib; {
description = "Check all the things.";
longDescriptin = ''
Perform a series of useful checks out of the box. cargo-checkmate
ensures your project builds, tests pass, has good format, doesn't
have dependencies with known vulnerabilities, and so on.
'';
homepage = "https://github.com/cargo-checkmate/cargo-checkmate";
license = with licenses; [ mit ];
};
}

View file

@ -1,13 +1,7 @@
# Custom packages, that can be defined similarly to ones from nixpkgs
# You can build them using 'nix build .#example' or (legacy) 'nix-build -A example'
{ pkgs, inputs }:
rec {
blade-formatter = pkgs.callPackage ./blade-formatter { };
cargo-checkmate = pkgs.callPackage ./cargo-checkmate.nix { };
lipsum = pkgs.callPackage ./lipsum.nix { };
emmet-cli = pkgs.callPackage ./emmet-cli.nix { };
material-wifi-icons = pkgs.callPackage ./material-wifi-icons.nix { };
gnome-pass-search-provider = pkgs.callPackage ./gnome-pass-search-provider.nix { };
kak-tree-sitter = pkgs.callPackage ./kak-tree-sitter.nix { };
final: prev:
let
inherit (final) callPackage;
in
{
draw-on-your-screen2 = callPackage ./draw-on-your-screen2 { };
}

View file

@ -0,0 +1,21 @@
{ fetchFromGitHub, stdenv }:
stdenv.mkDerivation {
pname = "draw-on-your-screen";
version = "unstable-2024-06-18";
src = fetchFromGitHub {
owner = "zhrexl";
repo = "DrawOnYourScreen2";
rev = "9b5c6633a1c2b8c5b35bac45276ad1302542ab9b";
hash = "sha256-J4ljx3HBe+86PGOIIgabtj8AuUAf88/bpTfRXowUng4=";
};
installPhase = ''
mkdir -p $out/share/gnome-shell/extensions/draw-on-your-screen2@zhrexl.github.com
cp -r ./* $out/share/gnome-shell/extensions/draw-on-your-screen2@zhrexl.github.com
mkdir -p $out/share/glib-2.0/
cp -r ./schemas/ $out/share/glib-2.0/
'';
}

View file

@ -1,27 +0,0 @@
{
lib,
buildNpmPackage,
fetchFromGitHub,
}:
buildNpmPackage rec {
pname = "emmet-cli";
version = "0.0.1";
src = fetchFromGitHub {
owner = "Delapouite";
repo = "emmet-cli";
rev = "407b0e8c59f65f205967d6be71105e0bd2001d62";
hash = "sha256-8lDgD1eIc2r5aB2baaiHKbkFdAxErX5p96MNqztR9rg=";
};
npmDepsHash = "sha256-Utgk/Cw83ffGr2/4aNkp3n3wSOojLZLA7OR+OakYBC0=";
dontNpmBuild = true;
meta = {
description = "Emmet command line interface";
homepage = "https://github.com/Delapouite/emmet-cli";
mainProgram = "emmet";
};
}

View file

@ -1,64 +0,0 @@
{
stdenv,
fetchFromGitHub,
python3Packages,
wrapGAppsHook,
gtk3,
gobject-introspection,
gnome,
}:
let
inherit (python3Packages)
dbus-python
pygobject3
fuzzywuzzy
levenshtein
;
in
stdenv.mkDerivation rec {
pname = "gnome-pass-search-provider";
version = "1.4.0";
src = fetchFromGitHub {
owner = "jle64";
repo = "gnome-pass-search-provider";
rev = version;
hash = "sha256-PDR8fbDoT8IkHiTopQp0zd4DQg7JlacA6NdKYKYmrWw=";
};
nativeBuildInputs = [
python3Packages.wrapPython
wrapGAppsHook
];
propagatedBuildInputs = [
dbus-python
pygobject3
fuzzywuzzy
levenshtein
gtk3
gobject-introspection
];
env = {
LIBDIR = builtins.placeholder "out" + "/lib";
DATADIR = builtins.placeholder "out" + "/share";
};
postPatch = ''
substituteInPlace conf/org.gnome.Pass.SearchProvider.service.{dbus,systemd} \
--replace-fail "/usr/lib" "$LIBDIR"
'';
installPhase = ''
bash ./install.sh
'';
postFixup = ''
makeWrapperArgs=( "''${gappsWrapperArgs[@]}" )
wrapPythonProgramsIn "$out/lib" "$out $propagatedBuildInputs"
'';
}

View file

@ -1,34 +0,0 @@
{
lib,
stdenv,
rustPlatform,
fetchFromSourcehut,
makeWrapper,
}:
rustPlatform.buildRustPackage rec {
pname = "kak-tree-sitter";
version = "1.1.2";
src = fetchFromSourcehut {
owner = "~hadronized";
repo = "kak-tree-sitter";
rev = "kak-tree-sitter-v${version}";
hash = "sha256-wBWfSyR8LGtug/mCD0bJ4lbdN3trIA/03AnCxZoEOSA=";
};
cargoSha256 = "sha256-OQPUWqJAts8DbFNSsC/CmMCbuZ9TVxRTR05O7oiodKI=";
nativeBuildInputs = [ makeWrapper ];
postFixup = ''
wrapProgram "$out/bin/ktsctl" \
--suffix PATH : ${stdenv.cc}
'';
meta = with lib; {
description = "Server that interfaces tree-sitter with kakoune";
homepage = "https://git.sr.ht/~hadronized/kak-tree-sitter";
license = with licenses; [ mit ];
};
}

View file

@ -1,32 +0,0 @@
{
stdenv,
fetchFromGitHub,
pkg-config,
vala,
wrapGAppsHook,
}:
stdenv.mkDerivation rec {
pname = "lipsum";
version = "0.0.1";
src = fetchFromGitHub {
owner = "hannenz";
repo = "lipsum";
rev = "0fb31e6ede10fbd78d7652f5fb21670cddd8e3ed";
hash = "sha256-a6uv0tJulN9cAGWxvQr8B0PUJEY8Rx4e759xzS66Xlo=";
};
nativeBuildInputs = [
pkg-config
vala
wrapGAppsHook
];
makeFlags = [ "PRG=${pname}" ];
installPhase = ''
install -Dm 755 "$pname" "$out/bin/$pname"
install -Dm 755 "./data/de.hannenz.lipsum.gschema.xml" "$out/share/glib-2.0/schemas/de.hannenz.lipsum.gschema.xml"
glib-compile-schemas "$out/share/glib-2.0/schemas/"
'';
}

View file

@ -1,16 +0,0 @@
{ stdenv, fetchFromGitHub }:
stdenv.mkDerivation rec {
pname = "material-wifi-icons";
version = "0.0.1";
src = fetchFromGitHub {
owner = "dcousens";
repo = "material-wifi-icons";
rev = "2daf6b3d96d65beb2a3e37a9a53556aab3826d97";
hash = "sha256-KykU5J7SdpBDG+6rkD//XeHd+6pK3qabe+88RduhwKc=";
};
installPhase = ''
install -D material-wifi.ttf $out/share/fonts/${pname}
'';
}

View file

@ -1,12 +0,0 @@
#!/bin/sh
exec diffr \
--colors 'refine-added:foreground:green:underline' \
--colors 'refine-added:background:none' \
--colors 'refine-removed:foreground:red:underline' \
--colors 'refine-removed:background:none' \
--colors 'added:foreground:green' \
--colors 'added:background:none' \
--colors 'removed:foreground:red' \
--colors 'removed:background:none' \
"$@"

View file

@ -1,30 +0,0 @@
{ pkgs, ... }:
pkgs.writeShellScriptBin "_gpg-unlock" ''
${pkgs.gnupg}/bin/gpg-connect-agent reloadagent /bye
set -e
test -f "$HOME/.config/.preset-password" || {
${pkgs.libnotify}/bin/notify-send "No preset password found"
exit 0;
}
get_keygrip() {
${pkgs.gnupg}/bin/gpg --list-secret-keys --with-keygrip |
${pkgs.gawk}/bin/awk '
/^ssb/ {
ssb=1
}
/Keygrip/{
if (ssb) print $3
}'
}
keygrip=$(get_keygrip)
test -n "$keygrip" || exit 0
${pkgs.coreutils}/bin/cat "$HOME/.config/.preset-password" |
${pkgs.coreutils}/bin/base64 -d |
${pkgs.gnupg}/libexec/gpg-preset-passphrase --preset "$keygrip"
''

View file

@ -1,11 +0,0 @@
#!/bin/sh
swayidlectl() {
systemctl --user $1 swayidle.service
}
if swayidlectl status > /dev/null; then
swayidlectl stop
else
swayidlectl start
fi

View file

@ -1,10 +0,0 @@
#!/bin/sh
for path
do
test -f "$path" &&
path=$(dirname "$path")
cd "$path"
terminal
done

View file

@ -1,27 +0,0 @@
#!/bin/sh
list_paired_controllers() {
bluetoothctl devices Paired | grep 'Controller' | cut -d' ' -f2
}
count_connected_controllers() {
bluetoothctl devices Connected | grep 'Controller' | wc -l
}
try_to_connect_to_all_controllers() {
list_paired_controllers | while read paired_controller; do
echo "Trying to connect to controller $paired_controller"
bluetoothctl connect "$paired_controller"
done
}
while true; do
echo "looping"
if test "$(count_connected_controllers)" -ne 0 ; then
echo "there is a controller connected, not attempting to connect to any other"
sleep 10s
continue
fi
sleep 1s
try_to_connect_to_all_controllers
done

View file

@ -1,53 +0,0 @@
#!/usr/bin/env fish
# wrapper around bemenu
# bmenu * - use as dmenu, -p for custom prompt (man bemenu)
# bmenu run - select from .desktop files and run it
# bmenu start - internal option
if test "$argv[1]" = "run"
test -n "$argv[2]" && set t "$argv[2]" || set t "terminal"
test -n "$i3SOCK" && set wrapper 'i3-msg exec --'
test -n "$SWAYSOCK" && set wrapper 'swaymsg exec --'
exec j4-dmenu-desktop \
--dmenu="bmenu start -p Iniciar:" \
--term "$t" \
--wrapper="$wrapper" \
--no-generic
end
if test -n "$SWAYSOCK"
swaymsg -t get_outputs |
jq -r 'map(.focused)|reverse|index(true)' |
read focused_output
test -n "$focused_output"
and set focused_output "-m $focused_output"
end
set -l config "$HOME/.config/bmenu.conf"
if test -f $config
source $config
end
exec dhist wrap -- bemenu \
$focused_output\
--ignorecase\
--border 2\
--center\
--width-factor 0.5\
--no-overlap\
--list 30\
--prefix '>'\
--bdr "$bdr"\
--fn "$fn"\
--tb "$tb" --tf "$tf" \
--fb "$fb" --ff "$ff" \
--nb "$nb" --nf "$nf" \
--ab "$ab" --af "$af" \
--hb "$hb" --hf "$hf" \
$argv
# vim: ft=fish

View file

@ -1,47 +0,0 @@
#!/bin/sh
set -e -u
end(){
rm -r -- "$(dirname -- "$namebase")"
[ $# -ne 0 ] && echo $@ >&2
exit $#
}
if [ $# -ne 0 ] ; then
for i in "$@" ; do
printf "%s\n" "$i"
done | "$0"
exit $?
fi
namebase="$(mktemp -d)/blkrn"
echo '# Modify filenames without removing any line, quitting aborts' \
> "$namebase.2"
tee -- "$namebase.1" >> "$namebase.2"
exec </dev/tty >/dev/tty ||
end 'Interactive terminal needed'
"$EDITOR" -- "$namebase.2"
sed -i -- '1d' "$namebase.2"
! diff -- "$namebase.1" "$namebase.2" &> /dev/null || end "no changes"
[ `wc -l < "$namebase.1"` -eq `wc -l < "$namebase.2"` ] || end "Wrong number of lines"
{
echo '# Please review/modify this script or empty it to do nothing'
echo 'run(){'
echo ' mkdir -p "$(dirname "$2")"'
echo ' mv -T -- "$1" "$2"'
echo '}'
while read -r l1 <&3 && read -r l2 <&4; do
[ "$l1" = "$l2" ] || printf "%s\n%s\n" "$l1" "$l2"
done 3<"$namebase.1" 4<"$namebase.2" |
sed 's/\([\\"$`]\)/\\\1/g;s/^.*$/"&"/' |
xargs -d"\n" -L2 echo 'run'
} > "$namebase.sh"
"$EDITOR" -- "$namebase.sh"
sh -e -- "$namebase.sh"
end # exit normaly

View file

@ -1,10 +0,0 @@
#!/bin/sh
set -xe
grim -g "$(slurp -b aabbcc00 -p)" - |
convert - txt:- |
grep -oE '#[0-9A-Fa-f]{6}' |
wl-copy -n
notify-send "$(wl-paste)" "Copied to clipboard"

View file

@ -18,126 +18,17 @@
--suffix PATH : ${lib.makeBinPath runtimeInputs}
'';
createScripts = lib.mapAttrs (name: deps: wrapScript name ./${name} deps);
myPass = final.pass.withExtensions (ex: with ex; [ pass-otp ]);
in
with final;
createScripts {
br = [ ];
bmenu = [
bemenu
dhist
fish
j4-dmenu-desktop
jq
sway
];
down_meme = [
wl-clipboard
yt-dlp
libnotify
];
wl-copy-file = [
wl-clipboard
fish
];
_diffr = [ diffr ];
_thunar-terminal = [ terminal ];
_sway_idle_toggle = [ swayidle ];
kak-pager = [
fish
_diffr
];
kak-man-pager = [ kak-pager ];
helix-pager = [
fish
_diffr
];
helix-man-pager = [ helix-pager ];
musmenu = [
mpc-cli
wdmenu
trash-cli
xdg-user-dirs
libnotify
sd
wl-clipboard
];
showkeys = [ ]; # This will not work unless programs.wshowkeys is enabled systemwide
terminal = [ alacritty ];
playerctl-status = [ playerctl ];
pass-export = [
pass2csv
gnupg
sd
];
wpass = [
wdmenu
fd
myPass
sd
wl-clipboard
wtype
];
screenshotsh = [
capitaine-cursors
grim
slurp
jq
sway
wl-clipboard
xdg-user-dirs
];
volumesh = [
pulseaudio
libnotify
];
pulse_sink = [
pulseaudio
pamixer
wdmenu
];
color_picker = [
grim
slurp
wl-clipboard
libnotify
imagemagick
];
dzadd = [
procps
libnotify
wdmenu
jq
mpv
pqiv
python3Packages.deemix
mpc-cli
mpdDup
];
mpdDup = [
mpc-cli
perl
];
readQrCode = [
grim
zbar
wl-clipboard
];
auto_connect_gamepad = [
bluez
coreutils
gnugrep
];
powerplay-led-idle = [
bash
libinput
libratbag
];
}
// lib.mapAttrs importScript {
wdmenu = ./wdmenu.nix;
wlauncher = ./wlauncher.nix;
_gpg-unlock = ./_gpg-unlock.nix;
}
)

View file

@ -1,19 +0,0 @@
#!/bin/sh
DIR=$(mktemp -d)
cd "$DIR"
yt-dlp --merge-output-format mp4 "$(wl-paste)"
FILENAME="$(ls | head -n1)"
mkdir -p "$HOME/Downloads/Memes"
cp "$FILENAME" "$HOME/Downloads/Memes/$FILENAME"
wl-copy-file "$HOME/Downloads/Memes/$FILENAME"
notify-send "Meme downloaded" "$FILENAME"
rm -rf "$DIR"

View file

@ -1,176 +0,0 @@
#!/bin/sh
set -ex
tmpf=$(mktemp /tmp/dzadd.XXXXXX)
clean() {
test "$?" -eq "0" ||
notify-send "Exiting with error"
set +e
kill "$mpvPid"
rm -f "$tmpf"
}
trap clean EXIT
main() {
sType=$(printf "Track\nAlbum\nArtist" | wdmenu | tr '[:upper:]' '[:lower:]')
test -n "$sType" || exit 1
query=$(echo -n | wdmenu | sed 's/[^ a-z0-9]//g;s/ /+/g')
test -n "$query" || exit 1
case "$sType" in
track)
deezer_category="track"
jqFilter='.data[]| "\(.title) - \(.album.title) - \(.artist.name) |\(.id)"'
;;
album)
deezer_category="album"
jqFilter='.data[]| "\(.nb_tracks) - \(.title) - \(.artist.name) |\(.id)"'
;;
artist)
deezer_category="artist"
jqFilter='.data[]| "\(.nb_fan) - \(.name) |\(.id)"'
;;
top50)
deezer_category="artist"
jqFilter='.data[]| "\(.nb_fan) - \(.name) |\(.id)"'
;;
*)
exit 1
;;
esac
curl -m30 -s "api.deezer.com/search/${deezer_category}?q=${query}" |
sed 's/|//g' |
jq -r "$jqFilter" >"$tmpf"
pick_song
}
pick_song() {
choice=$(cat "$tmpf" | cut -d\| -f1 | wdmenu)
choice=$(grep "$choice" "$tmpf" | head -n 1)
choiceId=$(printf "%s" "$choice" | cut -d\| -f2)
case "$sType" in
top50)
choiceUrl="http://deezer.com/${deezer_category}/${choiceId}/top?=limit=50"
;;
*)
choiceUrl="http://deezer.com/${deezer_category}/${choiceId}"
;;
esac
pick_action "$choiceUrl"
}
pick_action() {
choiceUrl="$1"
COMMON_CHOISES="View Image\nDownload\nCopy URL\nAnother"
choice=$(printf "Preview\n${COMMON_CHOISES}" | wdmenu)
case "$choice" in
"Preview")
common_preview
;;
"View Image")
common_art
;;
"Download")
common_download
;;
"Copy URL")
wl-copy
;;
"Another")
pick_song
;;
*)
exit 1
;;
esac
}
common_preview() {
case "$sType" in
track)
;;
album)
preview_suffix=tracks
;;
artist)
preview_suffix=top
;;
top50)
preview_suffix=top
;;
*)
exit 1
;;
esac
choicePreview=$(
curl -m30 -s "http://api.deezer.com/${deezer_category}/${choiceId}/${preview_suffix}" |
jq -r '.preview, .data[0].preview | select(. != null)'
)
mpv --quiet --volume=50 --no-resume-playback "$choicePreview" &
mpvPid="$!"
choice=$(printf "$COMMON_CHOISES" | wdmenu -p 'Download?')
kill "$mpvPid" || true
}
common_art() {
case "$sType" in
track)
image_filter='.album.cover_big'
;;
album)
image_filter='.cover_big'
;;
artist)
image_filter='.picture_big'
;;
top50)
image_filter='.picture_big'
;;
*)
exit 1
;;
esac
curl -m30 -s "api.deezer.com/${deezer_category}/${choiceId}" |
jq -r "$image_filter" |
xargs curl -m30 -s |
pqiv -
pick_action
}
common_download() {
notify-send "Starting Download"
deemix "$choiceUrl" </dev/null &&
notify-send "Download Successful" ||
notify-send "Download Failed"
mpc add /
mpdDup
}
main

View file

@ -1,3 +0,0 @@
#!/bin/sh
col -b -x | hx

View file

@ -1,28 +0,0 @@
#!/usr/bin/env fish
if test (count $argv) -ne 0
for i in $argv
cat "$i"
end | eval (status filename)
exit 0
end
set term_line_count (tput lines)
while read line
set -a input_lines "$line"
set input_line_count (printf "%s\n" $input_lines | wc -l)
if test "$term_line_count" -lt "$input_line_count"
begin
printf "%s\n" $input_lines
cat
end | hx
exit 0
end
end
printf "%s\n" $input_lines

View file

@ -1,8 +0,0 @@
#!/bin/sh
kak -e '
map global normal q :q<ret>;
set buffer filetype man;
rmhl global/number-lines;
set global scrolloff 10,0
'

View file

@ -1,33 +0,0 @@
#!/usr/bin/env fish
if test (count $argv) -ne 0
for i in $argv
cat "$i"
end | eval (status filename)
exit 0
end
set term_line_count (tput lines)
while read line
set -a input_lines "$line"
set input_line_count (printf "%s\n" $input_lines | wc -l)
if test "$term_line_count" -lt "$input_line_count"
begin
printf "%s\n" $input_lines
cat
end | kak -e '
exec <a-o>
map global normal q :q<ret>;
rmhl global/number-lines;
set global scrolloff 10,0;
'
exit 0
end
end
printf "%s\n" $input_lines

View file

@ -1,5 +0,0 @@
#!/bin/sh
mpc playlist -f '%position%\t%file%' |
sort -k 2 |
perl -ne 'm/(.*)\t(.*)/; print "$1\n" if $2 eq $prev; $prev=$2' |
mpc del

View file

@ -1,111 +0,0 @@
#!/bin/sh
set -e
menu=wdmenu
search() {
tabs 8
mpc playlist --format '%artist% : %title%@pos:%position%' |
sed '/^ : \t/d'|
column -ts"@" |
$menu |
grep -o 'pos:.*' |
cut -d: -f2 |
xargs -r mpc play
}
get_current() {
music_root=$(xdg-user-dir MUSIC || echo "$HOME/Music")
current_file=$(mpc current -f %file%)
echo "${music_root}/${current_file}"
}
delete() {
current=$(get_current)
answer=$(printf "nothing\n$current" | $menu -p"delete?")
if test "$answer" = "$current"; then
trash "$answer"
mpc --quiet next
mpc --quiet update
path=$(echo $answer | sd "$HOME" '~')
notify-send "Removed Music" "$path"
fi
}
yank() {
current=$(get_current)
# Some programs need you to pass a path, not the contents
wl-copy --type 'text/uri-list' "file:///${current}"
notify-send "Yanked Music" "$(echo $current | sd "$HOME" "~")"
}
padd() {
get_current
cd "$music_root"
choice=$(fd -E '*.lrc' -E '*.m3u8' | sort | $menu -p "Add Songs(Use Ctrl):")
mpc add "$choice" &&
notify-send "Added Music" "$(echo $choice | sd "$HOME" "~")" ||
notify-send "Failed to Add Music" "$(echo $choice | sd "$HOME" "~")"
mpdDup
}
pclear() {
mpc clear &&
notify-send "Cleared Playlist" ||
notify-send "Failed Clear Playlist"
}
psave() {
name=$(mpc playlist | $menu -p 'Save Playlist(Use Shift): ')
mpc save "$name" &&
notify-send "Created playlist" "$name" ||
notify-send "Failed to Create Playlist" "$name"
}
pload() {
name=$(mpc lsplaylists | $menu -p 'Load Playlist: ')
mpc clear
mpc load "$name" &&
notify-send "Loaded playlist" "$name" ||
notify-send "Failed to Load Playlist" "$name"
}
pdelete() {
name=$(mpc lsplaylists | $menu -p 'Delete Playlist: ')
mpc delete "$name" &&
notify-send "Deleted playlist" "$name" ||
notify-send "Failed to Delete Playlist" "$name"
}
usage() {
cmdname=$(basename "$0")
echo "Commands:"
echo " $cmdname search -- Search and play songs."
echo " $cmdname delete -- Prompt to delete the current song."
echo " $cmdname yank -- Copy current music to clipboard."
echo "Playlist Commands:"
echo " $cmdname padd -- Add song"
echo " $cmdname pclear -- Clear"
echo " $cmdname psave -- Save"
echo " $cmdname pload -- Load"
echo " $cmdname pdelete -- Delete"
}
case "$1" in
delete | search | yank | padd | pclear | psave | pload | pdelete)
"$1"
;;
*)
usage
test -n "$1"
echo "Unreconized option: $1"
;;
esac

View file

@ -1,13 +0,0 @@
#!/bin/sh
if test -z "$PASSWORD_STORE_DIR"; then
PASSWORD_STORE_DIR="$HOME/.password-store"
fi
pass2csv "$PASSWORD_STORE_DIR" "$HOME/passwords.csv" \
-f User '(user|login)(:\s*)?' \
-f TOTP 'otpauth(:)?' \
-f URL 'url(:\s*)?'
# Fix TOTP format for keepass
sd '"//totp/.*?secret=(.*?)(&.*?)?"' '"$1"' "$HOME/passwords.csv"

View file

@ -1,10 +0,0 @@
#!/bin/sh
PLAYERCTL="playerctl --ignore-player=mpd"
test "$(LC_ALL=C $PLAYERCTL status)" = "Playing" \
&& printf " %s" "$($PLAYERCTL metadata title)" \
&& test -n "$($PLAYERCTL metadata artist)" \
&& printf " - %s" "$($PLAYERCTL metadata artist)"
echo ""

View file

@ -1,26 +0,0 @@
#!/bin/sh
list_sinks() {
env LC_ALL=C pactl list sinks
}
desc=$(
list_sinks |
grep -ie "description:" |
cut -d: -f2 |
sed 's/^ //g;s/ $//g;' |
wdmenu -i -p "Output:"
)
device=$(
list_sinks |
grep -C2 "Description: $desc"|
grep Name |
cut -d: -f2 |
xargs
)
vol=$(pamixer --get-volume)
pactl set-default-sink "$device"
pamixer --set-volume "$vol"

View file

@ -1,18 +0,0 @@
#!/bin/sh
set -o pipefail
main() {
if wl-paste | zbarimg -q --raw - | wl-copy
then
notify-send "Copied" "QrCode was copied to clipboard"
rm "$LOGFILE"
else
notify-send "Failed to read QrCode" "Log file is '$LOGFILE'"
fi
}
LOGFILE=$(mktemp /tmp/qrcode-XXXXXXXX.log)
main > "$LOGFILE" 2>&1

View file

@ -1,49 +0,0 @@
#!/bin/sh
export XCURSOR_SIZE=40
export XCURSOR_THEME='capitaine-cursors-light'
screenshot="grim"
copy="wl-copy -t image/png"
if which xdg-user-dir >/dev/null 2>&1; then
DESTFOLDER="$(xdg-user-dir PICTURES)"
else
for i in Images Imagens Pictures Fotos ""; do
DESTFOLDER="$HOME/$i"
test -d "$DESTFOLDER" &&
break
done
fi
DESTFOLDER="$DESTFOLDER/Screenshots"
mkdir -p "$DESTFOLDER"
DESTFILE="$DESTFOLDER/$(date +'%Y-%m-%d-%H%M%S_screenshot.png')"
case $1 in
def)
# Screenshot to file
$screenshot "$DESTFILE"
echo "$DESTFILE"
;;
area)
# Screen area to file
$screenshot -g "$(slurp -d -b 30303088)" "$DESTFILE"
echo "$DESTFILE"
;;
area-clip)
# Screen area to clipboard
$screenshot -g "$(slurp -d -b 30303088)" - | $copy
;;
clip)
# Focused monitor to clipboard
cur_output=$(swaymsg -t get_outputs |
jq -r '.[] | select(.focused) | .name')
test -n "$cur_output" &&
$screenshot -o "$cur_output" - | $copy ||
$screenshot - | $copy
;;
esac

View file

@ -1,10 +0,0 @@
#!/bin/sh
pidof wshowkeys && pkill wshowkeys ||
exec wshowkeys \
-a bottom -a right \
-F 'Inter 20' \
-b 202020AA \
-s DD5050 \
-t 1 \
-m 100

View file

@ -1,18 +0,0 @@
#!/bin/sh
CLASS="terminal"
while test $# -gt 0;do
case $1 in
-c|--class)
shift
CLASS=$1
shift
;;
*)
break
;;
esac
done
exec alacritty --class "$CLASS" "$@"

View file

@ -1,139 +0,0 @@
#!/bin/sh
set -xe
# depends on: awk, pactl, pacmd, notify-send
MAX_VOL=150
STEP=10
notify() {
volume=$(get_vol_$TARGET)
if is_muted_$TARGET; then
s="Muted"
else
s="Volume"
fi
s=$(echo "${TARGET} ${s}" | sed 's/^\(.\)/\U\1/')
notify-send "${s}" "${volume}%" \
--app-name=volumesh \
--hint=int:value:"$volume"
}
round() {
awk '{
print int($1/'$STEP')*'$STEP';
}'
}
round_vol() {
rounded=$(get_vol_$TARGET | round)
newvol=$(min $MAX_VOL $rounded)
}
min() {
printf '%i\n' ${@} | sort -n | head -n1
}
# Pulse{{{
get_vol_system() {
pamixer --get-volume
}
is_muted_system() {
test "$(pamixer --get-mute)" = "true" >/dev/null
}
change_vol_system() {
pamixer "-$1" "$(min 120 $2)"
round_vol
pamixer --set-volume "${newvol}"
if
test -n "$VOLUME_CHANGE_SOUND"
then
paplay "$VOLUME_CHANGE_SOUND"
fi
}
toggle_mute_system() {
pactl set-sink-mute @DEFAULT_SINK@ toggle
}
#}}}
# Mpd {{{
get_vol_mpd() {
env LC_ALL=C mpc vol |
sed -e 's/^.*://g' -e 's/%.*$//g' -e 's/ //g'
}
is_muted_mpd() {
env LC_ALL=C mpc status | grep '\[paused\]' 1>/dev/null
}
change_vol_mpd() {
case $1 in
d)
op="-";;
i)
op="+";;
esac
mpc vol "${op}${2}" &>/dev/null
round_vol
mpc vol "${newvol}" &>/dev/null
}
toggle_mute_mpd() {
mpc toggle
}
#}}}
usage() {
local CNAME=$(basename $0)
echo "${CNAME} [-m][-di <amount>]"
echo "${CNAME} [-m][-t]"
echo ""
echo "Options:"
echo " -m --mpd Target mpd instead of PulseAudio"
echo " -i --increase <amount> of volume to increase"
echo " -d --decrease <amount> of volume to decrease"
echo " -t --toggle Mute/Unmute target"
echo " -h --help Show This help message"
exit "$1"
}
TARGET=system
while [ $# -gt 0 ]; do
case $1 in
-m | --mpd)
TARGET=mpd
shift
;;
-i | --increase)
shift
change_vol_$TARGET i $1
shift
;;
-d | --decrease)
shift
change_vol_$TARGET d $1
shift
;;
-t | --toggle)
toggle_mute_$TARGET
shift
;;
-h | --help)
usage 0
;;
*)
usage 1
;;
esac
done
notify
# vim: fdm=marker

View file

@ -1,4 +0,0 @@
{ pkgs, ... }:
pkgs.writeShellScriptBin "wdmenu" ''
exec bmenu "$@"
''

View file

@ -1,12 +0,0 @@
{ pkgs, ... }:
let
inherit (config.my) dmenu;
available_menus = {
bmenu = "bmenu run";
rofi = "rofi -show drun -sort";
};
menu_cmd = available_menus.${dmenu};
in
pkgs.writeShellScriptBin "wlauncher" ''
exec ${menu_cmd} "$@"
''

View file

@ -1,4 +0,0 @@
{ pkgs, ... }:
pkgs.writeShellScriptBin "wlauncher" ''
exec bmenu run "$@"
''

View file

@ -1,6 +0,0 @@
#!/bin/sh
./switch \
--option extra-substituters "http://nixcache.lelgenio.1337.cx:5000" \
--option extra-trusted-public-keys "nixcache.lelgenio.1337.cx:HZCwDaM39BOF+MLuviMQTUrz3rBWLTLV9H+GV4zcxVI=" \
"$@"

View file

@ -1,12 +1,11 @@
{ pkgs, ... }:
{
services.blueman.enable = true;
hardware.bluetooth = {
enable = true;
settings = {
General = {
DiscoverableTimeout = 0;
# Discoverable = true;
Discoverable = true;
AlwaysPairable = true;
};
Policy = {

View file

@ -1,18 +0,0 @@
{
pkgs,
lib,
config,
...
}:
{
services.cachix-watch-store = {
enable = true;
cacheName = "lelgenio";
cachixTokenFile = config.age.secrets.lelgenio-cachix.path;
};
systemd.services.cachix-watch-store-agent = {
serviceConfig.TimeoutStopSec = 3;
# If we don't do this, cachix tends to timeout
serviceConfig.KillMode = lib.mkForce "control-group";
};
}

View file

@ -9,11 +9,8 @@
}:
{
imports = [
./gamemode.nix
./cachix.nix
./media-packages.nix
./boot.nix
./thunar.nix
./nix.nix
./fonts.nix
./sound.nix

View file

@ -1,27 +0,0 @@
{
config,
pkgs,
inputs,
...
}:
{
programs.gamemode.enable = true;
programs.gamemode.enableRenice = true;
programs.gamemode.settings = {
general = {
renice = 10;
};
# Warning: GPU optimisations have the potential to damage hardware
gpu = {
apply_gpu_optimisations = "accept-responsibility";
gpu_device = 0;
amd_performance_level = "high";
};
custom = {
start = "${pkgs.libnotify}/bin/notify-send 'GameMode started'";
end = "${pkgs.libnotify}/bin/notify-send 'GameMode ended'";
};
};
}

View file

@ -42,6 +42,6 @@
chrome-gnome-shell
gnomeExtensions.quick-settings-audio-devices-hider
gnome-pass-search-provider
gnomeExtensions.dual-shock-4-battery-percentage
];
}

View file

@ -1,97 +0,0 @@
{
lib,
pkgs,
config,
...
}:
let
inherit (config.my)
key
accent
font
theme
desktop
;
cfg = config.login-manager.greetd;
in
{
options.login-manager.greetd = {
enable = lib.mkEnableOption "Use greetd as login manager";
};
config = lib.mkIf cfg.enable {
# Enable the X11 windowing system.
services.xserver.enable = false;
# enable sway window manager
programs.sway = {
enable = true;
package = pkgs.mySway;
wrapperFeatures.gtk = true;
};
services.dbus.enable = true;
programs.wshowkeys.enable = true;
xdg.portal = {
enable = true;
wlr.enable = true;
# Always pick the first monitor, this is fine since I only ever use a single monitor
wlr.settings.screencast.chooser_type = "none";
# gtk portal needed to make gtk apps happy
extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
};
services.greetd =
let
greetd_main_script = pkgs.writeShellScriptBin "main" ''
export XDG_CURRENT_DESKTOP=sway GTK_THEME="${theme.gtk_theme}" XCURSOR_THEME="${theme.cursor_theme}"
${pkgs.greetd.gtkgreet}/bin/gtkgreet -l -c ${desktop}
swaymsg exit
'';
swayConfig = pkgs.writeText "greetd-sway-config" ''
# `-l` activates layer-shell mode. Notice that `swaymsg exit` will run after gtkgreet.
exec "${greetd_main_script}/bin/main"
bindsym Mod4+shift+e exec swaynag \
-t warning \
-m 'What do you want to do?' \
-b 'Poweroff' 'systemctl poweroff' \
-b 'Reboot' 'systemctl reboot'
input "*" {
repeat_delay 200
repeat_rate 30
xkb_layout us(colemak)
xkb_numlock enabled
xkb_options lv3:lsgt_switch,grp:shifts_toggle
}
'';
in
{
enable = true;
settings = {
initial_session = {
command = desktop;
user = "lelgenio";
};
default_session = {
command = "${pkgs.sway}/bin/sway --config ${swayConfig}";
};
};
};
environment.systemPackages = with pkgs; [
sway
swaylock
swayidle
wayland
pkgs.xdg-desktop-portal
pkgs.xdg-desktop-portal-wlr
## Theme
capitaine-cursors
bibata-cursors
orchis_theme_compact
papirus_red
];
};
}

View file

@ -1,15 +0,0 @@
{ config, pkgs, ... }:
{
# Enable the X11 windowing system.
services.xserver.enable = true;
# Enable the KDE Desktop Environment.
services.xserver.displayManager.sddm.enable = true;
services.xserver.desktopManager.plasma5.enable = true;
# services.xserver.displayManager.autologin.user = "lelgenio";
programs.dconf.enable = true;
# environment.systemPackages = with pkgs;
# with gnome; [
# gnome-tweaks
# dconf-editor
# ];
}

View file

@ -13,22 +13,30 @@ in
};
config = lib.mkIf cfg.enable {
environment.systemPackages = with pkgs; [
down_meme
yt-dlp
ffmpeg
obs-studio
imagemagick
mpc-cli
helvum
gimp
inkscape
krita
kdePackages.breeze
kdePackages.kdenlive
pitivi
blender-hip
libreoffice
godot_4
(pkgs.writeTextFile {
name = "krita-thumbnails";
text = ''
[Thumbnailer Entry]
TryExec=unzip
Exec=sh -c "${pkgs.unzip}/bin/unzip -p %i preview.png > %o"
MimeType=application/x-krita;
'';
destination = "/share/thumbnailers/kra.thumbnailer";
})
];
};
}

View file

@ -1,12 +0,0 @@
{
config,
pkgs,
lib,
...
}:
{
services.nix-serve = {
enable = true;
secretKeyFile = config.age.secrets.monolith-nix-serve-privkey.path;
};
}

View file

@ -1,32 +0,0 @@
{
config,
pkgs,
inputs,
...
}:
{
programs.thunar = {
enable = true;
plugins = with pkgs.xfce; [
thunar-archive-plugin
thunar-volman
];
};
# Mount, trash, and other functionalities
services.gvfs.enable = true;
# Thumbnail support for images
services.tumbler.enable = true;
environment.systemPackages = [
(pkgs.writeTextFile {
name = "thumbs";
text = ''
[Thumbnailer Entry]
TryExec=unzip
Exec=sh -c "${pkgs.unzip}/bin/unzip -p %i preview.png > %o"
MimeType=application/x-krita;
'';
destination = "/share/thumbnailers/kra.thumbnailer";
})
];
}

View file

@ -1,179 +0,0 @@
{
config,
pkgs,
lib,
...
}:
let
inherit (config.my)
key
theme
accent
font
;
inherit (theme) color;
in
{
config = {
programs.alacritty = {
enable = true;
settings = {
font = {
size = font.size.small;
normal = {
family = font.mono;
};
};
colors = {
primary = {
background = "${color.bg}";
foreground = "${color.txt}";
};
cursor = {
text = "#000000";
cursor = "${accent.color}";
};
normal = {
black = "${color.normal.black}";
red = "${color.normal.red}";
green = "${color.normal.green}";
yellow = "${color.normal.yellow}";
blue = "${color.normal.blue}";
magenta = "${color.normal.magenta}";
cyan = "${color.normal.cyan}";
white = "${color.normal.white}";
};
draw_bold_text_with_bright_colors = false;
};
window = {
opacity = theme.opacity / 100.0;
dynamic_padding = true;
};
hints = {
alphabet = key.hints;
enabled = [
{
regex =
let
mimes = "(mailto:|gemini:|gopher:|https:|http:|news:|file:|git:|ssh:|ftp:)";
# I fucking hate regex, look at this bullshit
delimiters = ''^\\u0000-\\u001F\\u007F-\\u009F<>"\\s{-}\\^`'';
# Kakoune uses these characters to represent whitespace,
# but alacritty doesn't know about them
whitespace_characters = ''¬·'';
in
"${mimes}[${delimiters}${whitespace_characters}]+";
command = "xdg-open";
post_processing = true;
mouse = {
enabled = true;
mods = "None";
};
binding = {
key = "U";
mods = "Control|Shift";
};
}
];
};
mouse = {
hide_when_typing = true;
};
keyboard.bindings = [
{
key = lib.toUpper key.up;
mode = "Vi|~Search";
action = "Up";
}
{
key = lib.toUpper key.down;
mode = "Vi|~Search";
action = "Down";
}
{
key = lib.toUpper key.left;
mode = "Vi|~Search";
action = "Left";
}
{
key = lib.toUpper key.right;
mode = "Vi|~Search";
action = "Right";
}
{
key = lib.toUpper key.insertMode;
mode = "Vi|~Search";
action = "ScrollToBottom";
}
{
key = lib.toUpper key.insertMode;
mode = "Vi|~Search";
action = "ToggleViMode";
}
{
key = lib.toUpper key.next;
mode = "Vi|~Search";
action = "SearchNext";
}
{
key = lib.toUpper key.next;
mods = "Shift";
mode = "Vi|~Search";
action = "SearchPrevious";
}
{
key = "Up";
mods = "Control|Shift";
mode = "~Alt";
action = "ScrollLineUp";
}
{
key = "Down";
mods = "Control|Shift";
mode = "~Alt";
action = "ScrollLineDown";
}
{
key = "PageUp";
mods = "Control|Shift";
mode = "~Alt";
action = "ScrollHalfPageUp";
}
{
key = "PageDown";
mods = "Control|Shift";
mode = "~Alt";
action = "ScrollHalfPageDown";
}
{
key = "N";
mods = "Control|Shift";
action = "SpawnNewInstance";
}
# {%@@ if key.layout == "colemak" @@%}
{
key = "T";
mode = "Vi|~Search";
action = "SemanticRightEnd";
}
# {%@@ endif @@%}
];
};
};
home.sessionVariables = {
TERMINAL = "alacritty";
};
# Look at this fucking bullshit:
# https://gitlab.gnome.org/GNOME/glib/-/blob/20c4fcb2a7246a2b205649eae3ebda4296217afc/gio/gdesktopappinfo.c#L2702
# Theres a fucking hard coded list of terminals!
home.packages = with pkgs; [
(pkgs.writeShellScriptBin "gnome-terminal" ''
[ "$1" = "--" ] && shift
exec terminal -e "$@"
'')
];
};
}

View file

@ -1,26 +0,0 @@
{ pkgs, lib, ... }:
{
systemd.user.services = {
autoconnect-gamepad = {
Unit = {
Description = "Attempt to connect to game controllers";
PartOf = [ "graphical-session.target" ];
After = [ "graphical-session.target" ];
};
Service = {
ExecStart = lib.getExe pkgs.auto_connect_gamepad;
};
Install = {
WantedBy = [ "sway-session.target" ];
};
};
};
xdg.desktopEntries = {
disconnect-controller = {
name = "Disconnect Controller";
exec = "bluetoothctl disconnect 84:30:95:97:1A:79";
terminal = false;
};
};
}

View file

@ -6,41 +6,6 @@
}:
{
xdg.desktopEntries = {
kak = {
name = "Kakoune";
genericName = "Text Editor";
comment = "Edit text files";
exec = "kak %F";
terminal = true;
type = "Application";
icon = "kak.desktop";
categories = [
"Utility"
"TextEditor"
];
startupNotify = true;
mimeType = [
"text/english"
"text/plain"
"text/x-makefile"
"text/x-c++hdr"
"text/x-c++src"
"text/x-chdr"
"text/x-csrc"
"text/x-java"
"text/x-moc"
"text/x-pascal"
"text/x-tcl"
"text/x-tex"
"application/x-shellscript"
"text/x-c"
"text/x-c++"
];
settings = {
Keywords = "Text;editor;";
TryExec = "kak";
};
};
down_meme = {
name = "DownMeme";
genericName = "Download memes";

View file

@ -1,61 +0,0 @@
* {
all: unset; //Unsets everything so you can style everything from scratch
}
//Global Styles
.bar {
background-color: #202020;
color: #b0b4bc;
padding: 10px;
}
// Styles on classes (see eww.yuck for more information)
.sidestuff slider {
all: unset;
color: #cc5757;
}
.metric scale trough highlight {
all: unset;
background-color: #D35D6E;
color: #000000;
border-radius: 10px;
}
.metric scale trough {
all: unset;
background-color: #4e4e4e;
border-radius: 50px;
min-height: 3px;
min-width: 50px;
margin-left: 10px;
margin-right: 20px;
}
.metric scale trough highlight {
all: unset;
background-color: #D35D6E;
color: #000000;
border-radius: 10px;
}
.metric scale trough {
all: unset;
background-color: #4e4e4e;
border-radius: 50px;
min-height: 3px;
min-width: 50px;
margin-left: 10px;
margin-right: 20px;
}
.label-ram {
font-size: large;
}
.workspaces button:hover {
color: #D35D6E;
}
.workspaces button.active {
color: #D35D6E;
}

View file

@ -1,80 +0,0 @@
(defwidget bar []
(centerbox :orientation "h"
(workspaces)
(music)
(sidestuff)))
(defwidget sidestuff []
(box :class "sidestuff" :orientation "h" :space-evenly false :halign "end"
; (metric :label "🔊"
; :value volume
; :onchange "amixer -D pulse sset Master {}%")
(metric :label ""
:value {EWW_RAM.used_mem_perc}
:onchange "")
(metric :label "💾"
:value {round((1 - (EWW_DISK["/"].free / EWW_DISK["/"].total)) * 100, 0)}
:onchange "")
time))
(defwidget workspaces []
(box :class "workspaces"
:orientation "h"
:space-evenly true
:halign "start"
:spacing 10
(button :class "${active_workspace == 1 ? 'active' : '' }" :onclick "wmctrl -s 0" 1)
(button :class "${active_workspace == 2 ? 'active' : '' }" :onclick "wmctrl -s 1" 2)
(button :class "${active_workspace == 3 ? 'active' : '' }" :onclick "wmctrl -s 2" 3)
(button :class "${active_workspace == 4 ? 'active' : '' }" :onclick "wmctrl -s 3" 4)
(button :class "${active_workspace == 5 ? 'active' : '' }" :onclick "wmctrl -s 4" 5)
(button :class "${active_workspace == 6 ? 'active' : '' }" :onclick "wmctrl -s 5" 6)
(button :class "${active_workspace == 7 ? 'active' : '' }" :onclick "wmctrl -s 6" 7)
(button :class "${active_workspace == 8 ? 'active' : '' }" :onclick "wmctrl -s 7" 8)
(button :class "${active_workspace == 9 ? 'active' : '' }" :onclick "wmctrl -s 8" 9)))
(defwidget music []
(box :class "music"
:orientation "h"
:space-evenly false
:halign "center"
{music != "" ? "🎵${music}" : ""}))
(defwidget metric [label value onchange]
(box :orientation "h"
:class "metric"
:space-evenly false
(box :class "label" label)
(scale :min 0
:max 101
:active {onchange != ""}
:value value
:onchange onchange)))
(deflisten music :initial ""
"playerctl --follow metadata --format '{{ artist }} - {{ title }}' || true")
; (defpoll volume :interval "1s"
; "scripts/getvol")
(defpoll time :interval "10s"
"date '+%H:%M %b %d, %Y'")
(defpoll active_workspace :interval "10ms"
"hyprctl monitors -j | jq '.[]|.activeWorkspace.id'")
(defwindow bar
:monitor 0
:windowtype "dock"
:geometry (geometry :x "0%"
:y "0%"
:width "100%"
:height "10px"
:anchor "top center")
:reserve (struts :side "top" :distance "4%")
:exclusive true
(bar))

View file

@ -1,2 +0,0 @@
#!/bin/sh
printf "%.0f\n" $(free -m | grep Mem | awk '{print ($3/$2)*100}')

View file

@ -1,2 +0,0 @@
#!/bin/sh
amixer -D pulse sget Master | grep 'Left:' | awk -F'[][]' '{ print $2 }' | tr -d '%' | head -1

View file

@ -7,84 +7,12 @@
}:
let
inherit (config.my) desktop browser;
bugfixedFirefox = pkgs.firefox-devedition-unwrapped // {
requireSigning = false;
allowAddonSideload = true;
};
in
{
config = {
programs.firefox = {
enable = true;
package = pkgs.wrapFirefox bugfixedFirefox {
nixExtensions = [
(pkgs.fetchFirefoxAddon {
name = "darkreader";
url = "https://addons.mozilla.org/firefox/downloads/file/4205543/darkreader-4.9.73.xpi";
hash = "sha256-fDmf8yVhiGu4Da0Mr6+PYpeSsLcf8e/PEmZ+BaKzjxo=";
})
(pkgs.fetchFirefoxAddon {
name = "sponsorblock";
url = "https://addons.mozilla.org/firefox/downloads/file/4202411/sponsorblock-5.4.29.xpi";
hash = "sha256-7Xqc8cyQNylMe5/dgDOx1f2QDVmz3JshDlTueu6AcSg=";
})
(pkgs.fetchFirefoxAddon {
name = "tree-style-tab";
url = "https://addons.mozilla.org/firefox/downloads/file/4197314/tree_style_tab-3.9.19.xpi";
hash = "sha256-u2f0elVPj5N/QXa+5hRJResPJAYwuT9z0s/0nwmFtVo=";
})
(pkgs.fetchFirefoxAddon {
name = "ublock-origin";
url = "https://addons.mozilla.org/firefox/downloads/file/4290466/ublock_origin-1.58.0.xpi";
hash = "sha256-RwxWmUpxdNshV4rc5ZixWKXcCXDIfFz+iJrGMr0wheo=";
})
(pkgs.fetchFirefoxAddon {
name = "user_agent_string_switcher";
url = "https://addons.mozilla.org/firefox/downloads/file/4098688/user_agent_string_switcher-0.5.0.xpi";
hash = "sha256-ncjaPIxG1PBNEv14nGNQH6ai9QL4WbKGk5oJDbY+rjM=";
})
(pkgs.fetchFirefoxAddon {
name = "i-still-dont-care-about-cookies";
url = "https://github.com/OhMyGuus/I-Still-Dont-Care-About-Cookies/releases/download/v1.1.4/istilldontcareaboutcookies-1.1.4.xpi";
hash = "sha256-yt6yRiLTuaK4K/QwgkL9gCVGsSa7ndFOHqZvKqIGZ5U=";
})
(pkgs.fetchFirefoxAddon {
name = "vimium_ff";
url = "https://addons.mozilla.org/firefox/downloads/file/4191523/vimium_ff-2.0.6.xpi";
hash = "sha256-lKLX6IWWtliRdH1Ig33rVEB4DVfbeuMw0dfUPV/mSSI=";
})
(pkgs.fetchFirefoxAddon {
name = "invidious_redirect";
url = "https://addons.mozilla.org/firefox/downloads/file/4292924/invidious_redirect_2-1.16.xpi";
hash = "sha256-ApCc+MNmW9Wd/5seV6npePQVEaszT/rhD9EB7HGiUb8=";
})
(pkgs.fetchFirefoxAddon {
name = "mastodon_simplified_federation";
url = "https://addons.mozilla.org/firefox/downloads/file/4215691/mastodon_simplified_federation-2.2.xpi";
hash = "sha256-4iU25chpjsdsMTPaa0yQOTWc9V9q1qFz6YV0lYtNjLA=";
})
(pkgs.fetchFirefoxAddon {
name = "substitoot";
url = "https://addons.mozilla.org/firefox/downloads/file/4236602/substitoot-0.7.2.0.xpi";
hash = "sha256-1auSqEjkebwRSbmAVUsYwy77dl7TQCOnqgozpoVnqgI=";
})
# Locale
(pkgs.fetchFirefoxAddon {
name = "firefox_br";
url = "https://addons.mozilla.org/firefox/downloads/file/4144369/firefox_br-115.0.20230726.201356.xpi";
hash = "sha256-8zkqfdW0lX0b62+gAJeq4FFlQ06nXGFAexpH+wg2Cr0=";
})
(pkgs.fetchFirefoxAddon {
name = "corretor";
url = "https://addons.mozilla.org/firefox/downloads/file/1176165/corretor-65.2018.12.8.xpi";
hash = "sha256-/rFQtJHdgemMkGAd+KWuWxVA/BwSIkn6sk0XZE0LrGk=";
})
];
};
package = pkgs.firefox-devedition;
profiles = {
dev-edition-default = {
isDefault = true;
@ -132,44 +60,44 @@ in
''
else
''
/* Element | chrome://browser/content/browser.xhtml */
#navigator-toolbox {
display: grid;
grid-template-columns: 1fr 50px;
overflow: hidden;
}
/* Element | chrome://browser/content/browser.xhtml */
#nav-bar {
flex: 1;
width: 100%;
grid-column: 1 / 3;
grid-row: 1;
z-index: 0;
padding-right: 29px !important;
}
/* Element | chrome://browser/content/browser.xhtml */
/* Hide tabs and other items */
.toolbar-items {
display: none;
}
/* Element | chrome://browser/content/browser.xhtml */
#TabsToolbar {
max-width: 50px;
/* Make the url bar occupy the entire size of the container */
#nav-bar {
z-index: 1;
padding-right: 29px !important;
}
/* Element | chrome://browser/content/browser.xhtml */
/* shrink the tab bar to a small size, since it's only the window close button basically */
#titlebar {
position: absolute;
right: 0;
top: 10px;
max-width: 50px;
grid-area: 1 / 2;
z-index: 10;
}
/* Add a nice border to the top of the window */
#nav-bar {
border-top-left-radius: 10px;
border-top-right-radius: 10px;
}
/* Make the private browser indicator look nice, over the close-window button */
#private-browsing-indicator-with-label {
position: absolute;
top: 4px;
left: 15px;
z-index: 20;
pointer-events: none;
}
#private-browsing-indicator-with-label > label {
display: none;
}
'';
};
};

View file

@ -18,17 +18,9 @@ in
set -U fish_features stderr-nocaret qmark-noglob regex-easyesc ampersand-nobg-in-token
set_color red
if not test -d "$PASSWORD_STORE_DIR"
echo "Password Store not yet setup"
end
if not test -f "$HOME/.ssh/id_rsa"
echo "SSH keys not yet setup"
end
if command -qs rustup &> /dev/null
if not command -qs rustc; or not rustc --version &> /dev/null
rustup default stable &>/dev/null &
end
end
set_color normal
bind \cy 'commandline | wl-copy -n'
@ -40,12 +32,6 @@ in
};
shellAbbrs = {
off = "shutdown now";
v =
{
"helix" = "hx";
"kakoune" = "kak";
}
.${editor};
ns = "nix develop --command $SHELL";
wcf = "wl-copy-file";
c = "cargo";

View file

@ -28,11 +28,6 @@ in
autoSquash = true;
autoStash = true;
};
pager = {
log = "${pkgs._diffr}/bin/_diffr | ${pkgs.kak-pager}/bin/kak-pager";
show = "${pkgs._diffr}/bin/_diffr | ${pkgs.kak-pager}/bin/kak-pager";
diff = "${pkgs._diffr}/bin/_diffr | ${pkgs.kak-pager}/bin/kak-pager";
};
alias = {
graph = "log --graph --oneline --branches";
root = "rev-parse --show-toplevel";

View file

@ -40,6 +40,8 @@ lib.mkIf (config.my.desktop == "gnome") {
libsForQt5.qtstyleplugin-kvantum
qt6Packages.qt6ct
qt6Packages.qtstyleplugin-kvantum
draw-on-your-screen2
];
services.gpg-agent.pinentryPackage = pkgs.pinentry-gnome3;

View file

@ -1,47 +0,0 @@
{
config,
pkgs,
lib,
...
}:
{
config = {
services.gpg-agent = {
enable = true;
defaultCacheTtl = 604800;
maxCacheTtl = 604800;
extraConfig = ''
allow-preset-passphrase
'';
};
systemd.user.services = {
gpg_unlock = {
Unit = {
Description = "Unlock gpg keyring";
PartOf = [ "graphical-session.target" ];
After = [ "graphical-session.target" ];
};
Service = {
ExecStart = "${pkgs._gpg-unlock}/bin/_gpg-unlock";
};
};
};
systemd.user.timers = {
gpg_unlock = {
Unit = {
Description = "Unlock gpg keyring";
PartOf = [ "graphical-session.target" ];
After = [ "graphical-session.target" ];
};
Timer = {
OnBootSec = "0";
OnUnitActiveSec = "300";
Unit = "gpg_unlock.service";
};
Install = {
WantedBy = [ "sway-session.target" ];
};
};
};
};
}

View file

@ -56,6 +56,8 @@ in
# goto mode
g.n = "goto_line_start";
g.o = "goto_line_end";
# Formatting
"space".m = ":format";
};
keys.select = {
# basic movement
@ -68,6 +70,7 @@ in
L = "extend_search_prev";
# edits
s = "insert_mode";
S = "insert_at_line_start";
# open newline
h = "open_below";
H = "open_above";
@ -87,7 +90,7 @@ in
{
name = "nix";
auto-format = true;
formatter.command = "nixpkgs-fmt";
formatter.command = "nixfmt";
}
{
name = "rust";

View file

@ -8,37 +8,21 @@
}:
{
imports = [
./controller.nix
./waybar
./helix.nix
./kakoune
./vscode
./fish
./firefox.nix
./alacritty.nix
./git.nix
./ssh.nix
./gpg.nix
./rofi.nix
./mpv.nix
./mangohud.nix
./pipewire.nix
./mimeapps.nix
./desktop-entries.nix
./chat.nix
./syncthing.nix
./bmenu.nix
./fzf.nix
./ranger
./lf
./pass.nix
./pqiv.nix
./zathura.nix
./man.nix
./mpd.nix
./sway
./gnome.nix
./thunar.nix
./xdg-dirs.nix
inputs.nix-index-database.hmModules.nix-index
../settings
@ -57,9 +41,6 @@
home.packages = with pkgs; [
# home-manager
terminal # see flake.nix
pulse_sink
pulseaudio
## CLI
@ -72,8 +53,6 @@
p7zip
tealdeer
micro
_diffr
br # bulk rename
comma
@ -88,12 +67,8 @@
sd
ripgrep
translate-shell
lipsum
par
mate.engrampa
# gnome.nautilus
## games
# lutris-unwrapped
# steam # It's enabled in the system config
@ -133,7 +108,6 @@
clang-tools # c/c++ lsp server
rust-analyzer # rust analyzer
blade-formatter
nixfmt-rfc-style
];

View file

@ -1,225 +0,0 @@
{
pkgs,
lib,
color,
accent,
}:
let
colors = lib.mapAttrs (_: lib.replaceStrings [ "#" ] [ "rgb:" ]) {
accent_fg = accent.fg;
accent_color = accent.color;
bg_light = color.bg_light;
bg_dark = color.bg_dark;
nontxt = color.nontxt;
orange = color.normal.orange;
brown = color.normal.brown;
};
in
with colors;
''
crosshairs-enable
face global crosshairs_line default,${bg_dark}
face global crosshairs_column default+b
# For Code
face global value magenta
face global type yellow
face global variable blue
face global module ${brown}
face global function ${orange}
face global string green
face global keyword ${accent_color}
face global operator yellow
face global attribute cyan
face global comment ${bg_light}
face global documentation comment
face global meta +i@function
face global builtin blue
# For markup
face global title blue
face global header cyan
face global mono green
face global block magenta
face global link cyan
face global bullet cyan
face global list yellow
# builtin faces
face global Default default,default
face global PrimaryCursor ${accent_fg},${accent_color}+fg
face global PrimaryCursorEol PrimaryCursor
face global PrimarySelection default,${bg_light}+f
face global SecondaryCursor default,default+rfg
face global SecondaryCursorEol SecondaryCursor
face global SecondarySelection PrimarySelection
face global InactiveCursor ${accent_fg},${bg_light}+fg
face global MenuForeground ${accent_fg},${accent_color}
face global MenuBackground default,${bg_dark}
face global MenuInfo cyan
face global Information default,${bg_dark}
face global Error default,red+g
face global StatusLine %sh{
printf "rgb:"
head /dev/urandom |
base64 |
rg --text -o "${color.random_range}" |
head -n 6 |
sd '\n' ""
}
face global StatusLineMode StatusLine
face global StatusLineInfo StatusLine
face global StatusLineValue StatusLine
face global StatusCursor ${accent_fg},${accent_color}
face global Prompt yellow,default
try %{add-highlighter global/ show-matching}
face global MatchingChar ${accent_color},default+b
# Goodies
try %{add-highlighter global/number-lines number-lines -relative -hlcursor}
face global LineNumbers ${bg_light},default
face global LineNumberCursor default,${bg_dark}
face global LineNumbersWrapped red,default
try %{add-highlighter global/ show-whitespaces}
face global Whitespace ${nontxt},default+f
face global BufferPadding ${nontxt},default
## highlight trailing whitespace
# add-highlighter global/ regex '\h*$' 0:red,red+u
face global Reference default+bu
face global InlayHint ${bg_light}+buif
# Lsp
''
+ (lib.concatStringsSep "\n" (
lib.mapAttrsToList
(name: color: ''
face global HighlightDiagnostic${name} ${color},default+bu
face global Diagnostic${name} ${color},default+bu
face global TextDiagnostic${name} ${color},default+b
face global InlayDiagnostic${name} ${color},default+br
'')
{
Error = "red";
Warning = "yellow";
Hint = "blue";
}
))
+ ''
# Color palette
declare-option str red "red"
declare-option str mauve "magenta"
declare-option str maroon "rgb:ee99a0"
declare-option str pink "rgb:f5bde6"
declare-option str cyan "cyan"
declare-option str yellow "yellow"
declare-option str green "green"
declare-option str white "white"
declare-option str blue "blue"
declare-option str sky "rgb:91d7e3"
declare-option str lavender "rgb:b7bdf8"
declare-option str black1 "rgb:202020"
declare-option str black2 "rgb:272727"
declare-option str black3 "rgb:3a3a3a"
declare-option str orange ${orange}
declare-option str teal "rgb:8bd5ca"
declare-option str flamingo "rgb:f0c6c6"
declare-option str gray0 "rgb:606060"
declare-option str gray1 "rgb:737373"
declare-option str bright_red "%opt{red}+b"
declare-option str bright_green "%opt{green}+b"
declare-option str bright_yellow "%opt{yellow}+b"
declare-option str bright_blue "%opt{blue}+b"
declare-option str bright_cyan "%opt{cyan}+b"
declare-option str foreground %opt{white}
declare-option str background %opt{black2}
declare-option str overlay0 "rgb:878787"
declare-option str overlay1 "rgb:9a9a9a"
# Tree-sitter (<https://git.sr.ht/~hadronized/kak-tree-sitter>)
set-face global ts_attribute "%opt{cyan}"
set-face global ts_comment "%opt{overlay0}+i"
set-face global ts_conceal "%opt{mauve}+i"
set-face global ts_constant "%opt{orange}"
set-face global ts_constant_builtin_boolean "%opt{sky}"
set-face global ts_constant_character "%opt{yellow}"
set-face global ts_constant_macro "%opt{mauve}"
set-face global ts_constructor "%opt{cyan}"
set-face global ts_diff_plus "%opt{green}"
set-face global ts_diff_minus "%opt{red}"
set-face global ts_diff_delta "%opt{blue}"
set-face global ts_diff_delta_moved "%opt{mauve}"
set-face global ts_error "%opt{red}+b"
set-face global ts_function "%opt{blue}"
set-face global ts_function_builtin "%opt{blue}+i"
set-face global ts_function_macro "%opt{mauve}"
set-face global ts_hint "%opt{blue}+b"
set-face global ts_info "%opt{green}+b"
set-face global ts_keyword "%opt{mauve}"
set-face global ts_keyword_conditional "%opt{mauve}+i"
set-face global ts_keyword_control_conditional "%opt{mauve}+i"
set-face global ts_keyword_control_directive "%opt{mauve}+i"
set-face global ts_keyword_control_import "%opt{mauve}+i"
set-face global ts_keyword_directive "%opt{mauve}+i"
set-face global ts_keyword_storage "%opt{mauve}"
set-face global ts_keyword_storage_modifier "%opt{mauve}"
set-face global ts_keyword_storage_modifier_mut "%opt{mauve}"
set-face global ts_keyword_storage_modifier_ref "%opt{teal}"
set-face global ts_label "%opt{cyan}+i"
set-face global ts_markup_bold "%opt{orange}+b"
set-face global ts_markup_heading "%opt{red}"
set-face global ts_markup_heading_1 "%opt{red}"
set-face global ts_markup_heading_2 "%opt{mauve}"
set-face global ts_markup_heading_3 "%opt{green}"
set-face global ts_markup_heading_4 "%opt{yellow}"
set-face global ts_markup_heading_5 "%opt{pink}"
set-face global ts_markup_heading_6 "%opt{teal}"
set-face global ts_markup_heading_marker "%opt{orange}+b"
set-face global ts_markup_italic "%opt{pink}+i"
set-face global ts_markup_list_checked "%opt{green}"
set-face global ts_markup_list_numbered "%opt{blue}+i"
set-face global ts_markup_list_unchecked "%opt{teal}"
set-face global ts_markup_list_unnumbered "%opt{mauve}"
set-face global ts_markup_link_label "%opt{blue}"
set-face global ts_markup_link_url "%opt{teal}+u"
set-face global ts_markup_link_uri "%opt{teal}+u"
set-face global ts_markup_link_text "%opt{blue}"
set-face global ts_markup_quote "%opt{gray1}"
set-face global ts_markup_raw "%opt{green}"
set-face global ts_markup_strikethrough "%opt{gray1}+s"
set-face global ts_namespace "%opt{blue}+i"
set-face global ts_operator "%opt{sky}"
set-face global ts_property "%opt{sky}"
set-face global ts_punctuation "%opt{overlay1}"
set-face global ts_punctuation_special "%opt{sky}"
set-face global ts_special "%opt{blue}"
set-face global ts_spell "%opt{mauve}"
set-face global ts_string "%opt{green}"
set-face global ts_string_regex "%opt{orange}"
set-face global ts_string_regexp "%opt{orange}"
set-face global ts_string_escape "%opt{mauve}"
set-face global ts_string_special "%opt{blue}"
set-face global ts_string_special_path "%opt{orange}"
set-face global ts_string_special_symbol "%opt{mauve}"
set-face global ts_string_symbol "%opt{red}"
set-face global ts_tag "%opt{mauve}"
set-face global ts_tag_error "%opt{red}"
set-face global ts_text "%opt{white}"
set-face global ts_text_title "%opt{mauve}"
set-face global ts_type "%opt{yellow}"
set-face global ts_type_enum_variant "%opt{flamingo}"
set-face global ts_variable "%opt{blue}"
set-face global ts_variable_builtin "%opt{red}"
set-face global ts_variable_other_member "%opt{teal}"
set-face global ts_variable_parameter "%opt{maroon}+i"
set-face global ts_warning "%opt{orange}+b"
''

View file

@ -1,154 +0,0 @@
{
config,
pkgs,
lib,
...
}:
let
inherit (config.my)
dmenu
editor
theme
accent
;
inherit (theme) color;
inherit (pkgs) kakounePlugins;
inherit (pkgs.kakouneUtils) buildKakounePlugin;
in
{
imports = [ ./kak-tree-sitter.nix ];
config = {
programs.kakoune = {
enable = true;
plugins = with kakounePlugins; [
kak-ansi
active-window-kak
(buildKakounePlugin rec {
pname = "auto-pairs.kak";
version = "0.1";
src = pkgs.fetchFromGitHub {
owner = "alexherbo2";
repo = pname;
rev = "bfdcb8566076f653ec707f86207f83ea75173ce9";
sha256 = "sha256-MgqCuGj03ctKty2yQgQvy6qV/0s7euNwukhSjqauqW8=";
};
})
(buildKakounePlugin rec {
pname = "kakoune-mirror-colemak";
version = "0.1";
src = pkgs.fetchFromGitHub {
owner = "lelgenio";
repo = pname;
rev = "8f191172590d7615d0a56c857e9331ce69164670";
sha256 = "sha256-ERNtWOn8rq53YmByTQnwDObN7Fs5HYBwvNIyTJrj2hw=";
};
})
(buildKakounePlugin rec {
pname = "kakoune-palette";
version = "0.1";
src = pkgs.fetchFromGitHub {
owner = "delapouite";
repo = pname;
rev = "052cab5f48578679d94717ed5f62429be9865d5d";
sha256 = "sha256-fk0TL6qG3zX8cPp1xvhMw0/g9xSKKp04uyagaPq/Nd0=";
};
})
(buildKakounePlugin rec {
pname = "kak-crosshairs";
version = "0.1";
src = pkgs.fetchFromGitHub {
owner = "lelgenio";
repo = pname;
rev = "3a6bcd9b50737a9280de109e32048991a2f85f7c";
sha256 = "sha256-wZQ9tsAOqG4eW28DwJ6VcsR9gSrCGqFjbTARhvTLWTQ=";
};
})
(buildKakounePlugin rec {
pname = "kakoune-colemak-neio";
version = "0.1";
src = pkgs.fetchFromGitHub {
owner = "lelgenio";
repo = pname;
rev = "28b9aabafb8d422a4c52b2a15424056fb87c8d90";
sha256 = "sha256-d3OTjo02QFsbNqmgd28fHgSjPcdF8BJleCJGCyOFc18=";
};
})
(buildKakounePlugin rec {
pname = "kakoune-multi-file";
version = "0.1";
src = pkgs.fetchFromGitHub {
owner = "natasky";
repo = pname;
rev = "1cc6baeb14b773916eb9209469aa77b3cfa67a0a";
sha256 = "sha256-3PLxG9UtT0MMSibvTviXQIgTH3rApZ3WSbNCEH3c7HE=";
};
})
];
extraConfig =
lib.concatStringsSep "\n" (
map (lib.readFile) (
[
./filetypes.kak
./hooks.kak
./indent.kak
./keys.kak
./lsp-config.kak
./usermode.kak
./git-mode.kak
]
++ lib.optional (dmenu == "rofi") ./rofi-commands.kak
)
)
+ ''
try %{
eval %sh{ kak-tree-sitter -vvvv -dks --init $kak_session }
}
set global scrolloff 10,20
set global autoreload yes
set global startup_info_version 99999999
''
+ (import ./colors.nix {
inherit
pkgs
lib
color
accent
;
});
};
home.file = {
".config/kak-lsp/kak-lsp.toml".source = ./kak-lsp.toml;
};
home.packages = with pkgs; [
terminal
ranger
bmenu
kak-lsp
kak-tree-sitter
kak-pager
kak-man-pager
emmet-cli
nodePackages.prettier
aspell
aspellDicts.en
aspellDicts.pt_BR
];
home.activation = {
update_kakoune = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
$DRY_RUN_CMD timeout 1s kak -clear &&
$DRY_RUN_CMD timeout 1s kak -l | xargs -r -n1 timeout 1s kak -e "config-source;quit" -ui dummy -c ||
$DRY_RUN_CMD true
'';
};
home.sessionVariables = lib.mkIf (editor == "kakoune") {
EDITOR = "kak";
# Some plugins(kak_ansi) like to compile stuff
CC = "cc";
};
};
}

View file

@ -1,235 +0,0 @@
try %{
require-module python
add-highlighter shared/python/code/function regex '\b([a-zA-Z_][a-zA-Z0-9_]*)\s*\(' 1:function
}
hook global WinSetOption filetype=sh %{
set buffer formatcmd 'shfmt -s -ci -i "4"'
}
hook global WinSetOption filetype=c %{
set buffer formatcmd 'clang-format'
}
hook global WinSetOption filetype=nix %{
set buffer formatcmd 'nixfmt'
}
hook global BufCreate .*\.html %{
set buffer formatcmd 'prettier --parser html'
}
hook global BufCreate .*\.component\.html %{
set buffer filetype angular
}
hook global WinSetOption filetype=angular %[
set-option buffer extra_word_chars '_' '-'
require-module html
add-highlighter buffer/angular ref html
]
hook global BufCreate .*\.js %{
set buffer formatcmd 'prettier --parser babel'
}
hook global BufCreate .*\.vue %{
set buffer formatcmd 'prettier --parser vue'
hook buffer InsertCompletionHide {
execute-keys 'Ghs$1<ret>c'
}
}
hook global BufCreate .*\.jsonc %[ set buffer filetype jsonc ]
hook global BufCreate .*\.blade.php %[ set buffer filetype blade ]
hook global BufCreate .*\.less %[ set buffer filetype less ]
hook global BufCreate .*\.(tera|askama)\.?.* %[
require-module jinja
add-highlighter buffer/jinja ref jinja
]
hook global WinSetOption filetype=rust %[
require-module rust
add-highlighter window/rust-custom regions
require-module html
add-highlighter window/rust-custom/html region -recurse '\{' '(html|view)!\s*\{\K' '(?=\})' ref html
require-module sql
add-highlighter window/rust-custom/sql region 'r#"\K--\s*sql' '"#' group
add-highlighter window/rust-custom/sql/ fill white
add-highlighter window/rust-custom/sql/ ref sql
]
hook global WinSetOption filetype=sql %[
set buffer comment_line '--'
]
hook global WinSetOption filetype=jsonc %[
set buffer comment_line '//'
require-module json
add-highlighter buffer/jsonc regions
add-highlighter buffer/jsonc/base default-region ref json
add-highlighter buffer/jsonc/double_string region ["] ["] fill string
add-highlighter buffer/jsonc/line-comment region // $ fill comment
]
hook global WinSetOption filetype=blade %[
set buffer formatcmd 'blade-formatter \
--end-with-newline \
--indent-size "4" \
--wrap-line-length "80" \
--stdin'
set-option buffer extra_word_chars '_' '-'
hook window ModeChange pop:insert:.* -group blade-trim-indent blade-trim-indent
hook window InsertChar .* -group blade-indent blade-indent-on-char
hook window InsertChar \n -group blade-indent blade-indent-on-new-line
hook -once -always window WinSetOption filetype=.* %{ remove-hooks window blade-.+ }
require-module php
require-module javascript
add-highlighter buffer/blade regions
add-highlighter buffer/blade/base default-region group
add-highlighter buffer/blade/string region '"' '"' regions
add-highlighter buffer/blade/string/base default-region fill string
add-highlighter buffer/blade/string/expression region '\{\{(?!--)' '(?!--)\}\}' ref php
add-highlighter buffer/blade/string/raw-expression region '\{!!' '!!\}' ref php
add-highlighter buffer/blade/base/ ref html
add-highlighter buffer/blade/php region '@php' '@endphp' group
add-highlighter buffer/blade/php/ ref php
add-highlighter buffer/blade/php/ regex '@((end)?php)' 1:block
add-highlighter buffer/blade/js region '<script>' '</script>' group
add-highlighter buffer/blade/js/ ref javascript
add-highlighter buffer/blade/expression region '\{\{(?!--)' '(?!--)\}\}' ref php
add-highlighter buffer/blade/statement region -recurse '\(' '@(if|foreach|for|section|yield|include)\s*\(' '\)' ref php
add-highlighter buffer/blade/base/ regex '@(else(if)?|include|case|break)' 1:keyword
add-highlighter buffer/blade/base/ regex '@((end)?(if|isset|foreach|for|section|switch))' 1:keyword
add-highlighter buffer/blade/comment region '\{\{--' '--\}\}' fill comment
set-option buffer comment_block_begin '{{-- '
set-option buffer comment_block_end ' --}}'
map buffer user 'c' '<a-x>_: comment-block<ret><a-;>;' -docstring 'comment block'
]
try %§
define-command -hidden blade-trim-indent %{
# remove trailing white spaces
try %{ execute-keys -draft -itersel <a-x> s \h+$ <ret> d }
}
define-command -hidden blade-indent-on-char %<
evaluate-commands -draft -itersel %<
# align closer token to its opener when alone on a line
try %/ execute-keys -draft <a-h> <a-k> ^\h+[\]}]$ <ret> m s \A|.\z <ret> 1<a-&> /
>
>
define-command -hidden blade-indent-on-new-line %<
evaluate-commands -draft -itersel %<
# copy // comments or docblock * prefix and following white spaces
try %{ execute-keys -draft s [^/] <ret> k <a-x> s ^\h*\K(?://|[*][^/])\h* <ret> y gh j P }
# preserve previous line indent
try %{ execute-keys -draft <semicolon> K <a-&> }
# filter previous line
try %{ execute-keys -draft k : blade-trim-indent <ret> }
# indent after lines beginning / ending with opener token
try %_ execute-keys -draft k <a-x> <a-k> ^\h*[[{]|[[{]$ <ret> j <a-gt> _
# append " * " on lines starting a multiline /** or /* comment
try %{ execute-keys -draft k <a-x> s ^\h*/[*][* ]? <ret> j gi i <space>*<space> }
# deindent closer token(s) when after cursor
try %_ execute-keys -draft <a-x> <a-k> ^\h*[})] <ret> gh / [})] <ret> m <a-S> 1<a-&> _
>
>
§
hook global WinSetOption filetype=less %[
set buffer formatcmd 'prettier \
--tab-width "4" \
--print-width "80" \
--parser less'
set-option buffer extra_word_chars '_' '-'
set buffer comment_line '//'
set buffer comment_block_begin '/*'
set buffer comment_block_end '*/'
hook window ModeChange pop:insert:.* -group less-trim-indent less-trim-indent
hook window InsertChar \n -group less-indent less-indent-on-new-line
hook window InsertChar \} -group less-indent less-indent-on-closing-curly-brace
map buffer insert <c-k> '<esc>xs\$\d+<ret>) c'
hook -once -always window WinSetOption filetype=.* %{ remove-hooks window less-.+ }
add-highlighter buffer/less regions
add-highlighter buffer/less/code default-region group
add-highlighter buffer/less/line-comment region // $ fill comment
add-highlighter buffer/less/comment region /[*] [*]/ fill comment
add-highlighter buffer/less/double_string region ["] ["] fill string
add-highlighter buffer/less/single_string region ['] ['] fill string
add-highlighter buffer/less/code/ regex ([A-Za-z][A-Za-z0-9_-]*)\h*: 1:keyword
add-highlighter buffer/less/code/ regex ::?(\w+) 0:attribute
add-highlighter buffer/less/code/ regex !important 0:keyword
add-highlighter buffer/less/code/selector group
add-highlighter buffer/less/code/selector/ regex [A-Za-z][A-Za-z0-9_-]* 0:keyword
add-highlighter buffer/less/code/selector/ regex [*]|[#.][A-Za-z][A-Za-z0-9_-]* 0:variable
add-highlighter buffer/less/code/selector/ regex &([A-Za-z0-9_-]*) 1:variable
add-highlighter buffer/less/code/selector/ regex & 0:operator
add-highlighter buffer/less/code/selector/ regex (\.?[A-Za-z][A-Za-z0-9_-]*)\s*\( 1:function
add-highlighter buffer/less/code/ regex (\b(\d*\.)?\d+(ch|cm|em|ex|mm|pc|pt|px|rem|vh|vmax|vmin|vw|%|s|ms)?) 0:value 3:type
add-highlighter buffer/less/code/ regex (#)[0-9A-Fa-f]{3}([0-9A-Fa-f]{3}([0-9A-Fa-f]{2})?)?\b 0:value 1:operator
add-highlighter buffer/less/code/ regex (?i)\b(AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGray|DarkGrey|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGray|DarkSlateGrey|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGray|DimGrey|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gray|Grey|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGray|LightGrey|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGray|LightSlateGrey|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|RebeccaPurple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGray|SlateGrey|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)\b 0:value
add-highlighter buffer/less/code/ regex ([\w-_]+)\s*: 1:attribute
add-highlighter buffer/less/code/ regex @[\w\d-_]+ 0:variable
]
try %§
define-command -hidden less-trim-indent %{
# remove trailing white spaces
try %{ execute-keys -draft -itersel <a-x> s \h+$ <ret> d }
}
define-command -hidden less-indent-on-new-line %[
evaluate-commands -draft -itersel %[
# preserve previous line indent
try %[ execute-keys -draft <semicolon> K <a-&> ]
# filter previous line
try %[ execute-keys -draft k : less-trim-indent <ret> ]
# indent after lines ending with with {
try %[ execute-keys -draft k <a-x> <a-k> \{$ <ret> j <a-gt> ]
# deindent closing brace when after cursor
try %[ execute-keys -draft <a-x> <a-k> ^\h*\} <ret> gh / \} <ret> m <a-S> 1<a-&> ]
]
]
define-command -hidden less-indent-on-closing-curly-brace %[
evaluate-commands -draft -itersel %[
# align to opening curly brace when alone on a line
try %[ execute-keys -draft <a-h> <a-k> ^\h+\}$ <ret> m s \A|.\z <ret> 1<a-&> ]
]
]
§

View file

@ -1,134 +0,0 @@
try %{
# declare-user-mode surround
declare-user-mode git
}
map global user 'v' ': enter-user-mode git<ret>' -docstring 'git vcs mode'
map global user 'V' ': enter-user-mode -lock git<ret>' -docstring 'git vcs mode'
# show status
map global git 's' ': git status<ret>' -docstring 'status'
map global git 'S' '_: git show %val{selection} --<ret>' -docstring 'show'
map global git 'g' ': git-graph <ret>' -docstring 'graph all commits'
map global git 'G' ': git-graph-simpified <ret>' -docstring 'graph all branches'
map global git '<a-g>' ': git-graph-with-remotes<ret>' -docstring 'graph all branches and remotes'
map global git 'd' ': git diff %reg{%}<ret>' -docstring 'diff current'
map global git 'D' ': git diff<ret>' -docstring 'diff all'
map global git '<a-d>' ': git diff --staged<ret>' -docstring 'diff staged'
map global git 'n' ': git next-hunk <ret>' -docstring 'next git modification'
map global git 'p' ': git prev-hunk <ret>' -docstring 'previous git modification'
# make commits
map global git 'a' ': git add<ret>' -docstring 'add current'
map global git 'A' ': git add --all<ret>' -docstring 'add all'
map global git 'c' ': git commit -v<ret>' -docstring 'commit'
# discard work
map global git 'r' ': git checkout %reg{%}<ret>' -docstring 'restore current'
# deal with merges
map global git 'N' ': git-next-merge-conflict <ret>' -docstring 'next git merge conflict'
map global git 'P' ': git-prev-merge-conflict <ret>' -docstring 'previous git merge conflict'
map global git 'm' ': git-merge-head <ret>' -docstring 'merge using head'
map global git 'M' ': git-merge-new <ret>' -docstring 'merge using new'
map global git '<c-m>' ': git-merge-head-and-new <ret>' -docstring 'merge using both head and new'
map global git '<a-m>' ': git-merge-original <ret>' -docstring 'merge using original'
define-command -override git-next-merge-conflict %{
try %{
execute-keys /^<lt>{6,}.*?^<gt>{6,}.*?$<ret>
} catch %{
fail "No hunks found forward"
}
} -docstring "next git merge hunk"
define-command -override git-prev-merge-conflict %{
try %{
execute-keys <a-/>^<lt>{6,}.*?^<gt>{6,}.*?$<ret>
} catch %{
fail "No hunks found backwards"
}
} -docstring "previous git merge hunk"
define-command -override git-merge-head %{
evaluate-commands -draft %{
# delete head marker
execute-keys <a-/>^<lt>{4,}<ret>xd
try %{
# select original marker
execute-keys /^[|]{4,}<ret>
# extend to theirs marker
execute-keys ?^={4,}<ret>x
} catch %{
# select theirs marker
execute-keys /^={4,}<ret>x
}
# extend to end marker
execute-keys ?^<gt>{4,}<ret>xd
}
} -docstring "merge using head"
define-command -override git-merge-original %{
evaluate-commands -draft %{
# select head marker
execute-keys <a-/>^<lt>{4,}<ret>
# select to middle of conflict
execute-keys ?^[|]{4,}<ret>xd
# select theirs marker
execute-keys /^={4,}<ret>
# extend to end marker
execute-keys ?^<gt>{4,}<ret>xd
}
} -docstring "merge using original"
define-command -override git-merge-new %{
evaluate-commands -draft %{
# select head marker
execute-keys <a-/>^<lt>{4,}<ret>
# extend to theirs marker
execute-keys ?^={4,}\n<ret>d
# delete end marker
execute-keys /^<gt>{4,}<ret>xd
}
} -docstring "merge using new"
define-command -override git-merge-head-and-new %{
evaluate-commands -draft %{
# delete head marker
execute-keys <a-/>^<lt>{4,}<ret>xd
# select middle of conflict
execute-keys /^[|]{4,}<ret>x
# extendo to theirs marker
execute-keys ?^={4,}<ret>xd
# delete end marker
execute-keys /^<gt>{4,}<ret>xd
}
} -docstring "merge using head and new"
define-command -override git-graph %{
try %{ delete-buffer '*git-graph*' }
edit -scratch '*git-graph*'
execute-keys '<a-!> timeout 10s git graph --color=always --decorate --branches<ret>'
execute-keys 'gg'
try ansi-render
map buffer normal q ': delete-buffer!<ret>'
}
define-command -override git-graph-simpified %{
try %{ delete-buffer '*git-graph*' }
edit -scratch '*git-graph*'
execute-keys '<a-!> timeout 10s git graph --color=always --decorate --all --simplify-by-decoration<ret>'
execute-keys 'gg'
try ansi-render
map buffer normal q ': delete-buffer!<ret>'
}
define-command -override git-graph-with-remotes %{
try %{ delete-buffer '*git-graph*' }
edit -scratch '*git-graph*'
execute-keys '<a-!> timeout 10s git graph --color=always --decorate --all<ret>'
execute-keys 'gg'
try ansi-render
map buffer normal q ': delete-buffer!<ret>'
}

View file

@ -1,56 +0,0 @@
set global idle_timeout 500
enable-auto-pairs
hook global NormalIdle .* %{ evaluate-commands %sh{
hex_with_size() {
for i in 3 4 6 8; do
printf "[0-9a-f]{$i}|"
done
}
echo "$kak_selection" | grep -P "^#?($(hex_with_size))$" > /dev/null &&
echo 'palette-status'
} }
define-command -hidden -override git-try-show-diff %{
evaluate-commands -draft %sh{
test -f "$kak_buffile" || exit 0
cd $(dirname "$kak_buffile")
git rev-parse --git-dir > /dev/null &&
echo "git show-diff"
}
}
evaluate-commands %sh{
for hook in NormalIdle FocusIn FocusOut BufWritePost BufOpenFile; do
printf "hook global %s .* 'git-try-show-diff'\n" "$hook"
done
}
define-command -override diffr %{ try %{
execute-keys -draft 'ggxsdiff<ret>'
execute-keys -draft '%<a-;>J| _diffr<ret>'
ansi-render
} }
hook global BufOpenFile .* diffr
hook global BufOpenFile .* %{
modeline-parse
}
hook global BufOpenFile .*/COMMIT_EDITMSG %{
execute-keys -draft 'ge<a-!>git log -1000 --oneline<ret>'
write
}
hook global RegisterModified '"' %{ nop %sh{ {
printf %s "$kak_reg_dquote" | wl-copy -n
printf %s "$kak_reg_dquote" | xclip -i -selection clipboard
} > /dev/null 2>&1 < /dev/null & }} -group sync-clipboard
# Trim trailing whitespace
hook global BufWritePre .* %{ try %{
execute-keys -draft \%s\h+$<ret>d
} } -group remove-whitespace

View file

@ -1,33 +0,0 @@
# {{@@ header() @@}}
# _ __ _
# | |/ /__ _| | _____ _ _ _ __ ___
# | ' // _` | |/ / _ \| | | | '_ \ / _ \
# | . \ (_| | < (_) | |_| | | | | __/
# |_|\_\__,_|_|\_\___/ \__,_|_| |_|\___|
set global tabstop 4
hook global BufCreate .*\.py %{
set global indentwidth 4
}
hook global BufCreate .*\.nix %{
set global indentwidth 2
}
#################################################################
# Spaces
#################################################################
set global indentwidth 4
# use spaces insted of tabs
hook global BufCreate .* %{
hook buffer InsertChar \t %{
exec -draft -itersel h@
} -group replace-tabs-with-spaces
}
hook global WinSetOption filetype=makefile %{
remove-hooks buffer replace-tabs-with-spaces
}

View file

@ -1,155 +0,0 @@
snippet_support = false
verbosity = 2
[server]
# exit session if no requests were received during given period in seconds
# works only in unix sockets mode (-s/--session)
# set to 0 to disable
timeout = 1800 # seconds = 30 minutes
[language_server.angular]
filetypes = ["angular"]
roots = [".angular", ".git"]
command = "node"
args = [
"/home/lelgenio/.config/yarn/global/node_modules/@angular/language-server",
"--ngProbeLocations",
"/home/lelgenio/.config/yarn/global/node_modules",
"--tsProbeLocations",
"/home/lelgenio/.config/yarn/global/node_modules",
"--stdio",
]
[language_server.bash-language-server]
filetypes = ["sh"]
roots = [".git", ".hg"]
command = "bash-language-server"
args = ["start"]
[language_server.clangd]
filetypes = ["c", "cpp"]
roots = ["compile_commands.json", ".clangd", ".git", ".hg"]
command = "clangd"
[language_server.css-language-server]
filetypes = ["css"]
roots = ["package.json", ".git", ".hg"]
command = "vscode-css-languageserver"
args = ["--stdio"]
[language_server.less-language-server]
filetypes = ["less"]
roots = ["package.json", ".git", ".hg"]
command = "vscode-css-languageserver"
args = ["--stdio"]
[language_server.html-language-server]
filetypes = ["html"]
roots = ["package.json"]
command = "vscode-html-languageserver"
args = ["--stdio"]
settings_section = "_"
[language_server.html-language-server.settings._]
# quotePreference = "single"
# javascript.format.semicolons = "insert"
[language_server.typescript-language-server]
filetypes = ["javascript", "typescript"]
roots = ["package.json", "tsconfig.json", "jsconfig.json", ".git", ".hg"]
command = "typescript-language-server"
args = ["--stdio"]
settings_section = "_"
[language_server.typescript-language-server.settings._]
# quotePreference = "double"
# typescript.format.semicolons = "insert"
[language_server.json-language-server]
filetypes = ["json"]
roots = ["package.json"]
command = "vscode-json-languageserver"
args = ["--stdio"]
[language_server.nil]
filetypes = ["nix"]
command = "nil"
roots = ["flake.nix", "shell.nix", ".git"]
[language_server.nil.settings.nil]
formatting.command = [ "nixfmt" ]
[language_server.intelephense]
filetypes = ["php"]
roots = [".htaccess", "composer.json"]
command = "intelephense"
args = ["--stdio"]
settings_section = "intelephense"
[language_server.intelephense.settings.intelephense]
storagePath = "/tmp/intelephense"
format.braces = "k&r"
environment.includePaths = [
"./vendor",
"./vendor/autoload",
"./vendor/laravel/framework/",
"./vendor/laravel/framework/src/",
"./vendor/laravel/framework/src/Illuminate/"
]
files.exclude = [
"**/.git/**",
"**/.svn/**",
"**/.hg/**",
"**/.direnv/**",
"**/CVS/**",
"**/.DS_Store/**",
"**/node_modules/**",
"**/bower_components/**",
"**/resources/views/**"
]
[language_server.rust-analyzer]
filetypes = ["rust"]
roots = ["Cargo.toml"]
command = "sh"
args = [
"-c",
"""
if path=$(rustup which rust-analyzer 2>/dev/null); then
"$path"
else
rust-analyzer
fi
""",
]
[language_server.rust-analyzer.settings.rust-analyzer]
# See https://rust-analyzer.github.io/manual.html#configuration
# cargo.features = []
checkOnSave.command = "clippy"
hoverActions.enable = false # kak-lsp doesn't support this at the moment
[language_server.godot]
filetypes = ["gd", "gdscript", "gdscript3"]
roots = ["project.godot", ".git/"]
command = "nc"
args = [ "localhost", "6008"]
# Semantic tokens support
# See https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_semanticTokens
# for the default list of tokens and modifiers.
# However, many language servers implement their own values.
# Make sure to check the output of `lsp-capabilities` and each server's documentation and source code as well.
# Examples:
# - TypeScript: https://github.com/microsoft/vscode-languageserver-node/blob/main/client/src/common/semanticTokens.ts
# - Rust Analyzer: https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/syntax_highlighting.rs
[semantic_tokens]
faces = [
{face="documentation", token="comment", modifiers=["documentation"]},
{face="comment", token="comment"},
{face="function", token="function"},
{face="keyword", token="keyword"},
{face="module", token="namespace"},
{face="operator", token="operator"},
{face="string", token="string"},
{face="type", token="type"},
{face="default+d", token="variable", modifiers=["readonly"]},
{face="default+d", token="variable", modifiers=["constant"]},
{face="variable", token="variable"},
]

View file

@ -1,64 +0,0 @@
{ pkgs, lib, ... }:
let
hx-src = pkgs.helix.src;
kts-src = pkgs.kak-tree-sitter.src;
inherit (pkgs) fetchFromGitHub;
in
with pkgs.tree-sitter-grammars;
{
xdg.configFile."kak-tree-sitter/config.toml".text =
lib.foldlAttrs
(
acc: name: vals:
acc
+ ''
[language.${name}.grammar.source.local]
path = "${vals.parser}"
[language.${name}.grammar]
compile = "cc"
compile_args = ["-c", "-fpic", "../scanner.c", "../parser.c", "-I", ".."]
compile_flags = ["-O3"]
link = "cc"
link_args = ["-shared", "-fpic", "scanner.o", "parser.o", "-o", "typescript.so"]
link_flags = ["-O3"]
[language.${name}.queries.source.local]
path = "${vals.queries}"
[language.${name}.queries]
path = "${vals.queries}"
''
)
""
{
nix = {
parser = tree-sitter-nix + "/parser";
queries = tree-sitter-nix + "/queries";
};
scss = {
parser = tree-sitter-scss + "/parser";
queries = tree-sitter-scss + "/queries";
};
css = {
parser = tree-sitter-css + "/parser";
queries = tree-sitter-css + "/queries";
};
javascript = {
parser = tree-sitter-javascript + "/parser";
queries = tree-sitter-javascript + "/queries";
};
typescript = {
parser =
tree-sitter-typescript.overrideAttrs (old: {
src = fetchFromGitHub {
owner = "tree-sitter";
repo = "tree-sitter-typescript";
rev = "b1bf4825d9eaa0f3bdeb1e52f099533328acfbdf";
hash = "sha256-oZKit8kScXcOptmT2ckywL5JlAVe+wuwhuj6ThEI5OQ=";
};
})
+ "/parser";
queries = kts-src + "/runtime/queries/typescript";
};
};
}

View file

@ -1,20 +0,0 @@
# {{@@ header() @@}}
# _ __ _
# | |/ /__ _| | _____ _ _ _ __ ___
# | ' // _` | |/ / _ \| | | | '_ \ / _ \
# | . \ (_| | < (_) | |_| | | | | __/
# |_|\_\__,_|_|\_\___/ \__,_|_| |_|\___|
set global scrolloff 10,20
set global autoreload yes
set global startup_info_version 20200901
source "%val{config}/rc/plug.kak"
source "%val{config}/rc/keys.kak"
source "%val{config}/rc/usermode.kak"
source "%val{config}/rc/git-mode.kak"
source "%val{config}/rc/hooks.kak"
source "%val{config}/rc/filetypes.kak"
source "%val{config}/rc/indent.kak"
source "%val{config}/colors.kak"

View file

@ -1,39 +0,0 @@
# {{@@ header() @@}}
# For colemak, this is pretty confortable, C-n = down, C-u = up
map global normal <c-u> 10k
map global normal <c-n> 10j
# alt i makes searches case insensitive
map global prompt <a-i> '<c-a>(?i)<c-e>'
######################################################
# Emacs-like insert
######################################################
map global insert <c-b> "<a-;>h"
map global insert <c-f> "<a-;>l"
map global insert <a-b> "<a-;>b"
map global insert <a-f> "<a-;>w"
map global insert <c-a> "<a-;>gi"
map global insert <c-e> "<a-;>gh<a-;>gl<right>"
map global insert <c-w> "<a-;>b<a-;>d"
######################################################
# Other insert binds
######################################################
map global insert <a-k> "<esc>"
map global insert <c-t> "<esc>"
######################################################
# Objects
######################################################
map global object m %{c^[<lt>=|]{4\,}[^\n]*\n,^[<gt>=|]{4\,}[^\n]*\n<ret>} -docstring 'git conflict markers'
map global object M %{c^<lt>{4\,}[^\n]*\n,^<gt>{4\,}[^\n]*\n<ret>} -docstring 'git conflict'

View file

@ -1,62 +0,0 @@
try %{
eval %sh{kak-lsp --kakoune -s $kak_session} # Not needed if you load it with plug.kak.
}
map global normal <F2> ': lsp-rename-prompt<ret>'
set global lsp_hover_max_lines 10
set global lsp_auto_highlight_references true
set global lsp_inlay_diagnostic_sign "●"
set global lsp_diagnostic_line_error_sign "●"
hook global BufCreate .* %{try lsp-enable}
define-command -override -hidden lsp-next-placeholder-bind %{
map global normal <tab> ': try lsp-snippets-select-next-placeholders catch %{ execute-keys -with-hooks <lt>tab> }<ret>' -docstring 'Select next snippet placeholder'
map global insert <tab> '<a-;>: try lsp-snippets-select-next-placeholders catch %{ execute-keys -with-hooks <lt>tab> }<ret>' -docstring 'Select next snippet placeholder'
}
lsp-next-placeholder-bind
map global insert <c-o> "<esc>: lsp-code-action-sync Fill<ret>"
define-command -override -hidden lsp-enable-decals %{
lsp-inlay-diagnostics-enable global
lsp-inlay-hints-enable global
}
define-command -override -hidden lsp-disable-decals %{
lsp-inlay-diagnostics-disable global
lsp-inlay-hints-disable global
}
try lsp-enable-decals
hook global ModeChange '.*:insert:normal' %{lsp-enable-decals}
hook global ModeChange '.*:normal:insert' %{lsp-disable-decals}
hook global WinSetOption filetype=(c|cpp|rust) %{
hook window -group semantic-tokens BufReload .* lsp-semantic-tokens
hook window -group semantic-tokens NormalIdle .* lsp-semantic-tokens
hook window -group semantic-tokens InsertIdle .* lsp-semantic-tokens
hook -once -always window WinSetOption filetype=.* %{
remove-hooks window semantic-tokens
}
decl -hidden -docstring "Timestamp of the last check" int last_modified
hook window RawKey .* %{
eval %sh{
if [ "${kak_opt_last_modified}" != "${kak_timestamp}" ]; then
echo "unset-option buffer lsp_inlay_diagnostics"
echo "unset-option buffer lsp_inlay_hints"
fi
}
set current last_modified %val{timestamp}
}
}
declare-option -hidden str modeline_progress ""
define-command -hidden -params 6 -override lsp-handle-progress %{
set global modeline_progress %sh{
if ! "$6"; then
echo "$2${5:+" ($5%)"}${4:+": $4"}"
fi
}
}
set global modelinefmt "%%opt{modeline_progress} %opt{modelinefmt}"

View file

@ -1,46 +0,0 @@
define-command -override -hidden find_file \
%{ evaluate-commands %sh{
for line in `rofi -sort -show file-browser-extended -file-browser-depth 0 -file-browser-no-descend -file-browser-stdout -p "File: "`; do
echo "edit '$line'"
done
} }
define-command -override -hidden find_delete \
%{ nop %sh{
rofi -sort -show file-browser-extended -file-browser-depth 0 -file-browser-no-descend -file-browser-stdout | xargs -r trash
} }
define-command -override -hidden find_git_file \
%{ evaluate-commands %sh{
for line in `git ls-files | rofi -sort -show file-browser-extended -file-browser-depth 0 -file-browser-no-descend -file-browser-stdout -file-browser-stdin`; do
echo "edit -existing '$line'"
done
} }
define-command -override -hidden find_git_modified \
%{ evaluate-commands %sh{
for line in `git status --porcelain | sd '^.. ' ''| rofi -sort -show file-browser-extended -file-browser-no-descend -file-browser-stdout -file-browser-stdin`; do
echo "edit -existing '$line'"
done
} }
define-command -override -hidden find_dir \
%{ cd %sh{
for line in `fd --strip-cwd-prefix -Htd | rofi -sort -show file-browser-extended -file-browser-no-descend -file-browser-stdout -file-browser-stdin`; do
echo "edit '$line'"
done
} }
define-command -override -hidden find_buffer \
%{ evaluate-commands %sh{
for line in `printf "%s\n" $kak_buflist | wdmenu -i`; do
echo "buffer '$line'"
done
} }
define-command -override -hidden tree \
%{ evaluate-commands %sh{
for line in `rofi -sort -show file-browser-extended -file-browser-stdout`; do
echo "edit '$line'"
done
} }

View file

@ -1,138 +0,0 @@
try %{
# declare-user-mode surround
declare-user-mode find
}
map global user 'w' ': w<ret>' -docstring 'write buffer'
map global user 'u' ': config-source<ret>' -docstring 'source configuration'
map global user 'g' ': enter-user-mode lsp<ret>' -docstring 'lsp mode'
map global user 'z' ':zoxide ' -docstring 'zoxide'
map global user 'n' ': new<ret>' -docstring 'new window'
map global user 'e' 'x|emmet<ret>@' -docstring 'process line with emmet'
map global user 'm' ': try format-buffer catch lsp-formatting-sync<ret>' -docstring 'format document'
map global user 'M' ': try lsp-range-formatting-sync catch format-selections<ret>' -docstring 'format selection'
map global user 'c' ': comment-line<ret>' -docstring 'comment line'
map global user 'C' '_: comment-block<ret>' -docstring 'comment block'
map global user '=' 'kgh<a-i><space>yjghi<space><esc>h<a-i><space>Rgi' -docstring 'Copy previous line indentation '
map global user "s" ': enter-user-mode mirror<ret>' -docstring 'mirror mode'
map global user 'p' '! wl-paste -n<ret>' -docstring 'clipboard paste'
map global user 'P' '<a-o>j! wl-paste -n<ret>' -docstring 'clipboard paste on next line'
map global user 'R' '"_d! wl-paste -n <ret>' -docstring 'clipboard replace'
map global user 'y' ': copy-file-path<ret>' -docstring 'register name to clipboard'
map global user 'b' ': find_buffer<ret>' -docstring 'switch buffer'
map global user 'l' ': lsp-enable-decals<ret>' -docstring 'LSP enable decals'
map global user 'L' ': lsp-disable-decals<ret>' -docstring 'LSP disable decals'
map global user 'f' ': enter-user-mode find<ret>' -docstring 'find mode'
map global find 't' ': tree<ret>' -docstring 'file tree'
map global find 'f' ': find_file<ret>' -docstring 'file'
map global find 'l' ': find_line<ret>' -docstring 'jump to line'
map global find 'r' ': find_ripgrep<ret>' -docstring 'ripgrep all file'
map global find 'g' ': find_git_file<ret>' -docstring 'git files'
map global find 'm' ': find_git_modified<ret>' -docstring 'git modified files'
map global find 'c' ': find_dir<ret>' -docstring 'change dir'
map global find 'd' ': find_delete<ret>' -docstring 'file to delete'
map global user 'S' ': find_spell<ret>' -docstring 'pick language for spellchecking'
define-command -override -hidden find_spell \
%{ evaluate-commands %sh{
for line in `aspell dump dicts | wdmenu -i -p "Language: "`; do
echo "spell '$line'"
done
} }
define-command -override -hidden find_file \
%{ evaluate-commands %sh{
for line in `fd --strip-cwd-prefix -tf -HE .git | wdmenu -i -p "File: "`; do
echo "edit '$line'"
done
} }
define-command -override -hidden find_delete \
%{ nop %sh{
fd --strip-cwd-prefix -H -E .git -t f | wdmenu -i | xargs -r trash
} }
define-command -override -hidden find_git_file \
%{ evaluate-commands %sh{
for line in `git ls-files | wdmenu -i`; do
echo "edit -existing '$line'"
done
} }
define-command -override -hidden find_git_modified \
%{ evaluate-commands %sh{
for line in `git status --porcelain | sd '^.. ' ''| wdmenu -i`; do
echo "edit -existing '$line'"
done
} }
define-command -override -hidden find_dir \
%{ cd %sh{
for line in `fd --strip-cwd-prefix -Htd | wdmenu -i`; do
echo "edit '$line'"
done
} }
define-command -override -hidden find_buffer \
%{ evaluate-commands %sh{
for line in `printf "%s\n" $kak_buflist | wdmenu -i`; do
echo "buffer '$line'"
done
} }
define-command -override -hidden find_ripgrep \
%{ evaluate-commands %sh{
patter=$( wdmenu -i -p "Regex")
rg --column -n "$patter" | wdmenu -i |
perl -ne 'print "edit \"$1\" \"$2\" \"$3\" " if /(.+):(\d+):(\d+):/'
} }
define-command -override -hidden find_line \
%{ evaluate-commands -save-regs a %{
execute-keys %{Z%"ayz}
execute-keys %sh{
line=$(
printf "%s\n" "$kak_reg_a" |
nl -ba -w1 |
wdmenu -i -p "Line" |
cut -f1
)
test -n "$line" && echo "${line}gx"
}
} }
define-command -override -hidden tree \
%{ evaluate-commands %sh{
file=`mktemp`
terminal --class file_picker -e ranger --selectfile="$kak_buffile" --choosefiles="$file"
for line in `cat "$file"`; do
echo "edit '$line'"
done
rm "$file"
} }
define-command -override -params .. \
-shell-script-candidates 'zoxide query -l' \
zoxide %{
cd %sh{ zoxide query -- "$@" || echo "$@" }
echo %sh{ pwd | sed "s|$HOME|~|" }
}
define-command -override config-source %{
source "%val{config}/kakrc"
}
define-command -override copy-file-path %{
nop %sh{ {
wl-copy $kak_reg_percent
} >/dev/null 2>&1 </dev/null & }
}

View file

@ -1,174 +0,0 @@
# 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;36 # LINK
or 31;01 # ORPHAN
tw 34 # STICKY_OTHER_WRITABLE
ow 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
# 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

View file

@ -1,25 +0,0 @@
{
config,
pkgs,
lib,
inputs,
...
}:
{
programs.lf = {
enable = true;
keybindings = {
"n" = "updir";
"e" = "down";
"i" = "up";
"o" = "open";
};
settings = {
icons = true;
};
previewer.source = ./previewer;
};
xdg.configFile."lf/icons".source = ./icons;
xdg.configFile."lf/colors".source = ./colors;
}

View file

@ -1,357 +0,0 @@
# 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 

View file

@ -1,40 +0,0 @@
#!/usr/bin/env bash
MIME=$(mimetype --all --brief "$1")
#echo "$MIME"
case "$MIME" in
# .pdf
*application/pdf*)
pdftotext "$1" -
;;
# .7z
*application/x-7z-compressed*)
7z l "$1"
;;
# .tar .tar.Z
*application/x-tar*)
tar -tvf "$1"
;;
# .tar.*
*application/x-compressed-tar*|*application/x-*-compressed-tar*)
tar -tvf "$1"
;;
# .rar
*application/vnd.rar*)
unrar l "$1"
;;
# .zip
*application/zip*)
unzip -l "$1"
;;
# any plain text file that doesn't have a specific handler
*text/plain*)
# return false to always repaint, in case terminal size changes
bat --force-colorization --paging=never --style=changes,numbers \
--terminal-width $(($2 - 3)) "$1" && false
;;
*)
echo "unknown format"
;;
esac

View file

@ -5,39 +5,11 @@
inputs,
...
}:
let
inherit (config.my)
key
theme
color
accent
font
desktop
editor
;
pagers = rec {
kak = kakoune;
kakoune = {
PAGER = "${pkgs.kak-pager}/bin/kak-pager";
MANPAGER = "${pkgs.kak-man-pager}/bin/kak-man-pager";
SYSTEMD_PAGER = "${pkgs.kak-pager}/bin/kak-pager";
SYSTEMD_PAGERSECURE = "1";
};
hx = helix;
helix = {
PAGER = "${pkgs.kak-pager}/bin/kak-pager";
MANPAGER = "${pkgs.kak-man-pager}/bin/kak-man-pager";
SYSTEMD_PAGER = "${pkgs.kak-pager}/bin/kak-pager";
SYSTEMD_PAGERSECURE = "1";
};
};
in
{
config = {
programs.man = {
enable = true;
generateCaches = true;
};
home.sessionVariables = pagers.${editor};
};
}

View file

@ -1,35 +0,0 @@
{
lib,
pkgs,
config,
...
}:
{
config = lib.mkIf (config.my.desktop != "gnome") {
services.mpd = {
enable = true;
musicDirectory = config.home.homeDirectory + "/Música";
extraConfig = ''
restore_paused "yes"
auto_update "yes"
audio_output {
type "pulse"
name "My Pulse Output"
mixer_type "hardware"
}
filesystem_charset "UTF-8"
'';
};
services.mpdris2 = {
enable = true;
multimediaKeys = true;
notifications = true;
};
home.packages = with pkgs; [
musmenu
python3Packages.deemix
dzadd
mpdDup
];
};
}

View file

@ -1,28 +0,0 @@
{ pkgs, ... }:
{
config = {
programs.mpv = {
enable = true;
config = {
# ytdl-format='best';
# ytdl_path = "yt-dlp";
ytdl-format = "bestvideo[height<=1080][vcodec!=vp9]+bestaudio/best";
ytdl-raw-options = "cookies=~/.cache/cookies-youtube-com.txt,mark-watched=";
osd-fractions = true;
save-position-on-quit = true;
keep-open = true;
cache = true;
cache-pause-initial = true;
cache-pause-wait = 10;
hwdec = "auto";
};
scripts = with pkgs.mpvScripts; [
mpris
sponsorblock
thumbfast
];
};
};
}

View file

@ -1,32 +0,0 @@
{
config,
pkgs,
lib,
inputs,
...
}:
{
config = {
programs.password-store = {
enable = true;
package = pkgs.pass.withExtensions (ex: with ex; [ pass-otp ]);
};
services = {
pass-secret-service.enable = true;
git-sync = {
enable = true;
repositories.password-store = {
uri = "forgejo@lelgenio.xyz:lelgenio/password-store";
path = toString config.programs.password-store.settings.PASSWORD_STORE_DIR;
};
};
};
home.packages = with pkgs; [
wpass
_gpg-unlock
qtpass
readQrCode
pass-export
];
};
}

View file

@ -1,80 +0,0 @@
{
config,
pkgs,
lib,
inputs,
...
}:
let
inherit (config.my)
key
theme
color
accent
font
;
make_direction_binds = lib.imap0 (
idx: direction:
let
sign = if (idx < 2) then 1 else -1;
axis = if ((lib.mod idx 2) != 0) then "y" else "x";
in
''
${key.${direction}} { shift_${axis}(${toString (sign * 10)}) }
${lib.toUpper key.${direction}} { shift_${axis}(${toString (sign * 50)}) }
@MONTAGE{
${key.${direction}} {
montage_mode_shift_${axis}(${toString (sign * -1)})
}
}
''
);
in
{
xdg.configFile = {
"pqivrc".text = ''
[options]
sort=1
lazy-load=1
browse=1
hide-info-box=1
box-colors=${accent.fg}:${accent.color}
thumbnail-size=256x256
command-6=trash-put
command-8=|wl-copy
[keybindings]
Mouse-5 { shift_y(-10) }
Mouse-4 { shift_y(10) }
; n { goto_file_reh }
<bracketleft> { goto_file_relative(-1) }
<bracketright> { goto_file_relative(1); }
<Left> { goto_file_relative(-1) }
<Right> { goto_file_relative(1); }
${lib.concatStrings (make_direction_binds [
"left"
"up"
"right"
"down"
])}
${key.tabL} { goto_file_relative(-1) }
${key.tabR} { goto_file_relative(1); }
${key.insertMode} { toggle_info_box() }
d { send_keys(6) }
y { send_keys(8) }
${if (key.layout == "colemak") then "\n t { toggle_scale_mode(0) }\n " else ""}
# vim: ft=ini
'';
};
home.packages = with pkgs; [ pqiv ];
}

View file

@ -1,186 +0,0 @@
# This file is part of ranger, the console file manager.
# License: GNU GPL version 3, see the file "AUTHORS" for details.
from __future__ import (absolute_import, division, print_function)
from ranger.gui.colorscheme import ColorScheme
from ranger.gui.color import (
black, blue, cyan, green, magenta, red, white, yellow, default,
normal, bold, reverse, dim, BRIGHT,
default_colors,
)
class Default(ColorScheme):
progress_bar_color = blue
def use(self, context): # pylint: disable=too-many-branches,too-many-statements
fg, bg, attr = default_colors
if context.reset:
return default_colors
elif context.in_browser:
if context.selected:
attr = reverse
else:
attr = normal
if context.empty or context.error:
bg = red
if context.border:
fg = default
if context.media:
if context.image:
fg = yellow
else:
fg = magenta
if context.container:
fg = red
if context.directory:
attr |= bold
fg = red
# fg += BRIGHT
elif context.executable and not \
any((context.media, context.container,
context.fifo, context.socket)):
attr |= bold
fg = green
# fg += BRIGHT
if context.socket:
attr |= bold
fg = magenta
fg += BRIGHT
if context.fifo or context.device:
fg = yellow
if context.device:
attr |= bold
fg += BRIGHT
if context.link:
fg = cyan if context.good else magenta
if context.tag_marker and not context.selected:
attr |= bold
if fg in (red, magenta):
fg = white
else:
fg = red
fg += BRIGHT
if not context.selected:
fg = default
attr &= ~bold
if not context.selected and (context.cut or context.copied):
attr |= bold
fg = black
fg += BRIGHT
# If the terminal doesn't support bright colors, use dim white
# instead of black.
if BRIGHT == 0:
attr |= dim
fg = white
if context.main_column:
# Doubling up with BRIGHT here causes issues because it's
# additive not idempotent.
if context.selected:
attr |= bold
if context.marked:
attr |= bold
fg = yellow
if context.badinfo:
if attr & reverse:
bg = magenta
else:
fg = magenta
if context.inactive_pane:
fg = cyan
elif context.in_titlebar:
if context.hostname:
fg = red
elif context.directory:
fg = green
elif context.tab:
if context.good:
bg = green
elif context.link:
fg = cyan
attr |= bold
elif context.in_statusbar:
if context.permissions:
if context.good:
fg = cyan
elif context.bad:
fg = magenta
if context.marked:
attr |= bold | reverse
fg = yellow
fg += BRIGHT
if context.frozen:
attr |= bold | reverse
fg = cyan
fg += BRIGHT
if context.message:
if context.bad:
attr |= bold
fg = red
fg += BRIGHT
if context.loaded:
bg = self.progress_bar_color
if context.vcsinfo:
fg = blue
attr &= ~bold
if context.vcscommit:
fg = yellow
attr &= ~bold
if context.vcsdate:
fg = cyan
attr &= ~bold
if context.text:
if context.highlight:
attr |= reverse
if context.in_taskview:
if context.title:
fg = blue
if context.selected:
attr |= reverse
if context.loaded:
if context.selected:
fg = self.progress_bar_color
else:
bg = self.progress_bar_color
if context.vcsfile and not context.selected:
attr &= ~bold
if context.vcsconflict:
fg = magenta
elif context.vcsuntracked:
fg = cyan
elif context.vcschanged:
fg = red
elif context.vcsunknown:
fg = red
elif context.vcsstaged:
fg = green
elif context.vcssync:
fg = green
elif context.vcsignored:
fg = default
elif context.vcsremote and not context.selected:
attr &= ~bold
if context.vcssync or context.vcsnone:
fg = green
elif context.vcsbehind:
fg = red
elif context.vcsahead:
fg = blue
elif context.vcsdiverged:
fg = magenta
elif context.vcsunknown:
fg = red
return fg, bg, attr

View file

@ -1,28 +0,0 @@
{
config,
pkgs,
lib,
inputs,
...
}:
{
xdg.configFile = {
"ranger/rc.conf".source = ./rc.conf;
"ranger/rifle.conf".source = ./rifle.conf;
"ranger/scope.sh".source = ./scope.sh;
"ranger/colorschemes/mycolorscheme.py".source = ./colorscheme.py;
"ranger/plugins/ranger_devicons".source = inputs.ranger-icons;
};
home.packages = with pkgs; [
ranger
xdg-utils
wl-clipboard
highlight # syntax highlight
poppler_utils # pdf preview
ffmpeg # audio preview
ffmpegthumbnailer # video preview
fontforge # font preview
imagemagick
];
}

View file

@ -1,644 +0,0 @@
# {{@@ header() @@}}
# _ __ __ _ _ __ __ _ ___ _ __
# | '__/ _` | '_ \ / _` |/ _ \ '__|
# | | | (_| | | | | (_| | __/ |
# |_| \__,_|_| |_|\__, |\___|_|
# |___/
# == Options{{{
# Use miller columns which show multiple levels of the hierarchy
set viewmode miller
# How many columns are there, and what are their relative widths?
set column_ratios 2,4,2
# 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 multiple
# 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 true
# 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
# set preview_images true
# set preview_images_method sixel
# Use a unicode "..." character to mark cut-off filenames?
set unicode_ellipsis 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 mycolorscheme
# 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
# 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 none
# 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?
set update_title false
# Set the title to "ranger" in the tmux program?
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 true
# 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<tab>" 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 relative
# 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 false
# Enable scroll wrapping - moving down while on the last item will wrap around to
# the top and vice versa.
set wrap_scroll true
# 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
# }}}
# == Local Options{{{
#
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
# }}}
# == Define keys for the browser{{{
# ===================================================================
# Basic
map Q quitall!
map q quit
copymap q ZZ ZQ
map R reload_cwd
map F set freeze_files!
map <C-r> reset
map <C-l> redraw_window
map <C-c> abort
map <esc> change_mode normal
map ~ set viewmode!
map ? help
map W display_log
map w taskview_open
map X shell $SHELL
map : console
map ; console
map ! console shell%space
map @ console -p6 shell %%s
map # console shell -p%space
map s console shell%space
map r chain draw_possible_programs; console open_with%%space
map f console find%space
map cd console cd%space
map <C-p> chain console; eval fm.ui.console.history_move(-1)
# Change the line mode
map Mf linemode filename
map Mi linemode fileinfo
map Mm linemode mtime
map Mp linemode permissions
map Ms linemode sizemtime
map Mt linemode metatitle
# Tagging / Marking
map t tag_toggle
map ut tag_remove
map "<any> tag_toggle tag=%any
map <Space> mark_files toggle=True
map v mark_files all=True toggle=True
map uv mark_files all=True val=False
map b bulkrename
map V toggle_visual_mode
map uV toggle_visual_mode reverse=True
# For the nostalgics: Midnight Commander bindings
map <F1> help
map <F2> rename_append
map <F3> display_file
map <F4> edit
map <F5> copy
map <F6> cut
map <F7> console mkdir%space
map <F8> console delete
map <F10> exit
# In case you work on a keyboard with dvorak layout
map <UP> move up=1
map <DOWN> move down=1
map <LEFT> move left=1
map <RIGHT> move right=1
map <HOME> move to=0
map <END> move to=-1
map <PAGEDOWN> move down=1 pages=True
map <PAGEUP> move up=1 pages=True
map <CR> move right=1
#map <DELETE> console delete
map <INSERT> console touch%space
# VIM-like
copymap <LEFT> n
copymap <UP> i
copymap <DOWN> e
copymap <RIGHT> o
copymap <HOME> gg
copymap <END> G
copymap <PAGEDOWN> <C-F>
copymap <PAGEUP> <C-B>
map T move down=0.5 pages=True
map N move up=0.5 pages=True
copymap T <C-D>
copymap N <C-U>
# Jumping around
map H history_go -1
map S history_go 1
map ] move_parent 1
map [ move_parent -1
map } traverse
map { traverse_backwards
map ) jump_non
map gh cd ~
map ge cd /etc
map gu cd /usr
map gd cd /dev
map gl cd -r .
map gL cd -r %f
map go cd /opt
map gv cd /var
map gm cd /media
map gi eval fm.cd('/run/media/' + os.getenv('USER'))
map gM cd /mnt
map gs cd /srv
map gp cd /tmp
map gr cd /
map gR eval fm.cd(ranger.RANGERDIR)
map g/ cd /
map g? cd /usr/share/doc/ranger
# External Programs
map E edit
map du shell -p du --max-depth=1 -h --apparent-size
map dU shell -p du --max-depth=1 -h --apparent-size | sort -rh
map yp yank path
map yd yank dir
map yn yank name
map y. yank name_without_extension
# Filesystem Operations
map = chmod
map cw console rename%space
map a rename_append
map A eval fm.open_console('rename ' + fm.thisfile.relative_path.replace("%", "%%"))
map I eval fm.open_console('rename ' + fm.thisfile.relative_path.replace("%", "%%"), position=7)
map pp paste
map po paste overwrite=True
map pP paste append=True
map pO paste overwrite=True append=True
map pl paste_symlink relative=False
map pL paste_symlink relative=True
map phl paste_hardlink
map pht paste_hardlinked_subtree
map D console delete
map dd cut
map ud uncut
map da cut mode=add
map dr cut mode=remove
map dt cut mode=toggle
map yy copy
map uy uncut
map ya copy mode=add
map yr copy mode=remove
map yt copy mode=toggle
# Temporary workarounds
map dgg eval fm.cut(dirarg=dict(to=0), narg=quantifier)
map dG eval fm.cut(dirarg=dict(to=-1), narg=quantifier)
map dj eval fm.cut(dirarg=dict(down=1), narg=quantifier)
map dk eval fm.cut(dirarg=dict(up=1), narg=quantifier)
map ygg eval fm.copy(dirarg=dict(to=0), narg=quantifier)
map yG eval fm.copy(dirarg=dict(to=-1), narg=quantifier)
map yj eval fm.copy(dirarg=dict(down=1), narg=quantifier)
map yk eval fm.copy(dirarg=dict(up=1), narg=quantifier)
# Searching
map / console search%space
map l search_next
map L search_next forward=False
map ct search_next order=tag
map cs search_next order=size
map ci search_next order=mimetype
map cc search_next order=ctime
map cm search_next order=mtime
map ca search_next order=atime
# Tabs
map <C-n> tab_new
map <C-w> tab_close
map <TAB> tab_move 1
map <S-TAB> tab_move -1
map <A-Right> tab_move 1
map <A-Left> tab_move -1
map gt tab_move 1
map gT tab_move -1
map gn tab_new
map gc tab_close
map uq tab_restore
map <a-1> tab_open 1
map <a-2> tab_open 2
map <a-3> tab_open 3
map <a-4> tab_open 4
map <a-5> tab_open 5
map <a-6> tab_open 6
map <a-7> tab_open 7
map <a-8> tab_open 8
map <a-9> tab_open 9
map <a-r> tab_shift 1
map <a-l> tab_shift -1
# Sorting
map sr set sort_reverse!
map sz set sort=random
map ss chain set sort=size; set sort_reverse=False
map sb chain set sort=basename; set sort_reverse=False
map sn chain set sort=natural; set sort_reverse=False
map sm chain set sort=mtime; set sort_reverse=False
map sc chain set sort=ctime; set sort_reverse=False
map sa chain set sort=atime; set sort_reverse=False
map st chain set sort=type; set sort_reverse=False
map se chain set sort=extension; set sort_reverse=False
map sS chain set sort=size; set sort_reverse=True
map sB chain set sort=basename; set sort_reverse=True
map sN chain set sort=natural; set sort_reverse=True
map sM chain set sort=mtime; set sort_reverse=True
map sC chain set sort=ctime; set sort_reverse=True
map sA chain set sort=atime; set sort_reverse=True
map sT chain set sort=type; set sort_reverse=True
map sE chain set sort=extension; set sort_reverse=True
map dc get_cumulative_size
# Settings
map zc set collapse_preview!
map zd set sort_directories_first!
map zh set show_hidden!
map <C-h> set show_hidden!
copymap <C-h> <backspace>
copymap <backspace> <backspace2>
map zI set flushinput!
map zi set preview_images!
map zm set mouse_enabled!
map zp set preview_files!
map zP set preview_directories!
map zs set sort_case_insensitive!
map zu set autoupdate_cumulative_size!
map zv set use_preview_script!
map zf console filter%space
copymap zf zz
# Filter stack
map .n console filter_stack add name%space
map .m console filter_stack add mime%space
map .d filter_stack add type d
map .f filter_stack add type f
map .l filter_stack add type l
map .| filter_stack add or
map .& filter_stack add and
map .! filter_stack add not
map .r console filter_stack rotate
map .c filter_stack clear
map .* filter_stack decompose
map .p filter_stack pop
map .. filter_stack show
# Bookmarks
map `<any> enter_bookmark %any
map '<any> enter_bookmark %any
map m<any> set_bookmark %any
map um<any> unset_bookmark %any
map m<bg> draw_bookmarks
copymap m<bg> um<bg> `<bg> '<bg>
# Generate all the chmod bindings with some python help:
eval for arg in "rwxXst": cmd("map +u{0} shell -f chmod u+{0} %s".format(arg))
eval for arg in "rwxXst": cmd("map +g{0} shell -f chmod g+{0} %s".format(arg))
eval for arg in "rwxXst": cmd("map +o{0} shell -f chmod o+{0} %s".format(arg))
eval for arg in "rwxXst": cmd("map +a{0} shell -f chmod a+{0} %s".format(arg))
eval for arg in "rwxXst": cmd("map +{0} shell -f chmod u+{0} %s".format(arg))
eval for arg in "rwxXst": cmd("map -u{0} shell -f chmod u-{0} %s".format(arg))
eval for arg in "rwxXst": cmd("map -g{0} shell -f chmod g-{0} %s".format(arg))
eval for arg in "rwxXst": cmd("map -o{0} shell -f chmod o-{0} %s".format(arg))
eval for arg in "rwxXst": cmd("map -a{0} shell -f chmod a-{0} %s".format(arg))
eval for arg in "rwxXst": cmd("map -{0} shell -f chmod u-{0} %s".format(arg))
# }}}
# Define keys for the console{{{
#
# Basic
#
cmap <tab> eval fm.ui.console.tab()
cmap <s-tab> eval fm.ui.console.tab(-1)
cmap <ESC> eval fm.ui.console.close()
cmap <CR> eval fm.ui.console.execute()
cmap <C-l> redraw_window
copycmap <ESC> <C-c>
copycmap <CR> <C-j>
# Move around
#
cmap <up> eval fm.ui.console.history_move(-1)
cmap <down> eval fm.ui.console.history_move(1)
cmap <left> eval fm.ui.console.move(left=1)
cmap <right> eval fm.ui.console.move(right=1)
cmap <home> eval fm.ui.console.move(right=0, absolute=True)
cmap <end> eval fm.ui.console.move(right=-1, absolute=True)
cmap <a-b> eval fm.ui.console.move_word(left=1)
cmap <a-f> eval fm.ui.console.move_word(right=1)
copycmap <a-b> <a-left>
copycmap <a-f> <a-right>
# Line Editing
#
cmap <backspace> eval fm.ui.console.delete(-1)
cmap <delete> eval fm.ui.console.delete(0)
cmap <C-w> eval fm.ui.console.delete_word()
cmap <A-d> eval fm.ui.console.delete_word(backward=False)
cmap <C-k> eval fm.ui.console.delete_rest(1)
cmap <C-u> eval fm.ui.console.delete_rest(-1)
cmap <C-y> eval fm.ui.console.paste()
# Note: There are multiple ways to express backspaces. <backspace> (code 263)
# and <backspace2> (code 127). To be sure, use both.
copycmap <backspace> <backspace2>
# This special expression allows typing in numerals:
cmap <allow_quantifiers> false
# }}}
# Pager Keybindings {{{
# Movement
pmap <down> pager_move down=1
pmap <up> pager_move up=1
pmap <left> pager_move left=4
pmap <right> pager_move right=4
pmap <home> pager_move to=0
pmap <end> pager_move to=-1
pmap <pagedown> pager_move down=1.0 pages=True
pmap <pageup> pager_move up=1.0 pages=True
pmap <C-d> pager_move down=0.5 pages=True
pmap <C-u> pager_move up=0.5 pages=True
copypmap <UP> n <C-p>
copypmap <DOWN> t <C-n> <CR>
copypmap <LEFT> h
copypmap <RIGHT> s
copypmap <HOME> g
copypmap <END> G
copypmap <C-d> d
copypmap <C-u> u
copypmap <PAGEDOWN> l f <C-F> <Space>
copypmap <PAGEUP> p b <C-B>
# }}}
# Basic{{{
pmap <C-l> redraw_window
pmap <ESC> pager_close
copypmap <ESC> q Q i <F3>
pmap E edit_file
# }}}
# Taskview Keybindings
# Movement{{{
tmap <up> taskview_move up=1
tmap <down> taskview_move down=1
tmap <home> taskview_move to=0
tmap <end> taskview_move to=-1
tmap <pagedown> taskview_move down=1.0 pages=True
tmap <pageup> taskview_move up=1.0 pages=True
tmap <C-d> taskview_move down=0.5 pages=True
tmap <C-u> taskview_move up=0.5 pages=True
copytmap <UP> n <C-p>
copytmap <DOWN> t <C-n> <CR>
copytmap <HOME> g
copytmap <END> G
copytmap <C-u> u
copytmap <PAGEDOWN> n f <C-F> <Space>
copytmap <PAGEUP> p b <C-B>
# }}}
# Changing priority and deleting tasks{{{
tmap T eval -q fm.ui.taskview.task_move(-1)
tmap N eval -q fm.ui.taskview.task_move(0)
tmap dd eval -q fm.ui.taskview.task_remove()
tmap <pagedown> eval -q fm.ui.taskview.task_move(-1)
tmap <pageup> eval -q fm.ui.taskview.task_move(0)
tmap <delete> eval -q fm.ui.taskview.task_remove()
# }}}
# Basic
tmap <C-l> redraw_window
tmap <ESC> taskview_close
copytmap <ESC> q Q w <C-c>
# a plugin that adds file glyphs / icon support to Ranger:
# https://github.com/alexanderjeurissen/ranger_devicons
default_linemode devicons
# vim: commentstring=#\ %s

View file

@ -1,301 +0,0 @@
# 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:
# <condition1> , <condition2> , ... = 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 <regexp> | The regexp matches $1
# ext <regexp> | The regexp matches the extension of $1
# mime <regexp> | The regexp matches the mime type of $1
# name <regexp> | The regexp matches the basename of $1
# path <regexp> | The regexp matches the absolute path of $1
# has <program> | The program is installed (i.e. located in $PATH)
# env <variable> | The environment variable "variable" is non-empty
# file | $1 is a file
# directory | $1 is a directory
# number <n> | 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 <flags> | Change how the program is run. See below.
# label <label> | Assign a label or name to the command so it can
# | be started with :open_with <label> in ranger
# | or `rifle -p <label>` in the standalone executable.
# else | Always true.
#
# Flags are single characters which slightly transform the command:
# f | Fork the program, make it run in the background.
# | New command = setsid $command >& /dev/null &
# r | Execute the command with root permissions
# | New command = sudo $command
# t | Run the program in a new terminal. If $TERMCMD is not defined,
# | rifle will attempt to extract it from $TERM.
# | New command = $TERMCMD -e $command
# Note: The "New command" serves only as an illustration, the exact
# implementation may differ.
# Note: When using rifle in ranger, there is an additional flag "c" for
# only running the current file even if you have marked multiple files.
#-------------------------------------------
# Websites
#-------------------------------------------
# Rarely installed browsers get higher priority; It is assumed that if you
# install a rare browser, you probably use it. Firefox/konqueror/w3m on the
# other hand are often only installed as fallback browsers.
ext x?html?, has surf, X, flag f = surf -- file://"$1"
ext x?html?, has vimprobable, X, flag f = vimprobable -- "$@"
ext x?html?, has vimprobable2, X, flag f = vimprobable2 -- "$@"
ext x?html?, has qutebrowser, X, flag f = qutebrowser -- "$@"
ext x?html?, has dwb, X, flag f = dwb -- "$@"
ext x?html?, has jumanji, X, flag f = jumanji -- "$@"
ext x?html?, has luakit, X, flag f = luakit -- "$@"
ext x?html?, has uzbl, X, flag f = uzbl -- "$@"
ext x?html?, has uzbl-tabbed, X, flag f = uzbl-tabbed -- "$@"
ext x?html?, has uzbl-browser, X, flag f = uzbl-browser -- "$@"
ext x?html?, has uzbl-core, X, flag f = uzbl-core -- "$@"
ext x?html?, has midori, X, flag f = midori -- "$@"
ext x?html?, has opera, X, flag f = opera -- "$@"
ext x?html?, has firefox, X, flag f = firefox -- "$@"
ext x?html?, has seamonkey, X, flag f = seamonkey -- "$@"
ext x?html?, has iceweasel, X, flag f = iceweasel -- "$@"
ext x?html?, has chromium-browser, X, flag f = chromium-browser -- "$@"
ext x?html?, has chromium, X, flag f = chromium -- "$@"
ext x?html?, has google-chrome, X, flag f = google-chrome -- "$@"
ext x?html?, has epiphany, X, flag f = epiphany -- "$@"
ext x?html?, has konqueror, X, flag f = konqueror -- "$@"
ext x?html?, has elinks, terminal = elinks "$@"
ext x?html?, has links2, terminal = links2 "$@"
ext x?html?, has links, terminal = links "$@"
ext x?html?, has lynx, terminal = lynx -- "$@"
ext x?html?, has w3m, terminal = w3m "$@"
#-------------------------------------------
# Misc
#-------------------------------------------
# Define the "editor" for text files as first action
mime ^text, label editor = ${VISUAL:-$EDITOR} -- "$@"
mime ^text, label pager = $PAGER -- "$@"
!mime ^text, label editor, ext xml|json|csv|tex|py|pl|rb|rs|js|sh|php|dart = ${VISUAL:-$EDITOR} -- "$@"
!mime ^text, label pager, ext xml|json|csv|tex|py|pl|rb|rs|js|sh|php|dart = $PAGER -- "$@"
ext 1 = man "$1"
ext s[wmf]c, has zsnes, X = zsnes "$1"
ext s[wmf]c, has snes9x-gtk,X = snes9x-gtk "$1"
ext nes, has fceux, X = fceux "$1"
ext exe, has wine = wine "$1"
name ^[mM]akefile$ = make
#--------------------------------------------
# Scripts
#-------------------------------------------
ext py = python -- "$1"
ext pl = perl -- "$1"
ext rb = ruby -- "$1"
ext js = node -- "$1"
ext sh = sh -- "$1"
ext php = php -- "$1"
ext dart = dart run -- "$1"
#--------------------------------------------
# Audio without X
#-------------------------------------------
mime ^audio|ogg$, terminal, has mpv = mpv -- "$@"
mime ^audio|ogg$, terminal, has mplayer2 = mplayer2 -- "$@"
mime ^audio|ogg$, terminal, has mplayer = mplayer -- "$@"
ext midi?, terminal, has wildmidi = wildmidi -- "$@"
#--------------------------------------------
# Video/Audio with a GUI
#-------------------------------------------
mime ^video|^audio, has gmplayer, X, flag f = gmplayer -- "$@"
mime ^video|^audio, has smplayer, X, flag f = smplayer "$@"
mime ^video, has mpv, X, flag f = mpv -- "$@"
mime ^video, has mpv, X, flag f = mpv --fs -- "$@"
mime ^video, has mplayer2, X, flag f = mplayer2 -- "$@"
mime ^video, has mplayer2, X, flag f = mplayer2 -fs -- "$@"
mime ^video, has mplayer, X, flag f = mplayer -- "$@"
mime ^video, has mplayer, X, flag f = mplayer -fs -- "$@"
mime ^video|^audio, has vlc, X, flag f = vlc -- "$@"
mime ^video|^audio, has totem, X, flag f = totem -- "$@"
mime ^video|^audio, has totem, X, flag f = totem --fullscreen -- "$@"
mime ^audio, has audacity, X, flag f = audacity -- "$@"
ext aup, has audacity, X, flag f = audacity -- "$@"
#--------------------------------------------
# Video without X
#-------------------------------------------
mime ^video, terminal, !X, has mpv = mpv -- "$@"
mime ^video, terminal, !X, has mplayer2 = mplayer2 -- "$@"
mime ^video, terminal, !X, has mplayer = mplayer -- "$@"
#-------------------------------------------
# Documents
#-------------------------------------------
ext pdf, has llpp, X, flag f = llpp "$@"
ext pdf, has zathura, X, flag f = zathura -- "$@"
ext pdf, has mupdf, X, flag f = mupdf "$@"
ext pdf, has mupdf-x11,X, flag f = mupdf-x11 "$@"
ext pdf, has apvlv, X, flag f = apvlv -- "$@"
ext pdf, has xpdf, X, flag f = xpdf -- "$@"
ext pdf, has evince, X, flag f = evince -- "$@"
ext pdf, has atril, X, flag f = atril -- "$@"
ext pdf, has okular, X, flag f = okular -- "$@"
ext pdf, has epdfview, X, flag f = epdfview -- "$@"
ext pdf, has qpdfview, X, flag f = qpdfview "$@"
ext pdf, has open, X, flag f = open "$@"
ext sc, has sc, = sc -- "$@"
ext docx?, has catdoc, terminal = catdoc -- "$@" | $PAGER
ext sxc|xlsx?|xlt|xlw|gnm|gnumeric, has gnumeric, X, flag f = gnumeric -- "$@"
ext sxc|xlsx?|xlt|xlw|gnm|gnumeric, has kspread, X, flag f = kspread -- "$@"
ext pptx?|od[dfgpst]|docx?|sxc|xlsx?|xlt|xlw|gnm|gnumeric, has libreoffice, X, flag f = libreoffice "$@"
ext pptx?|od[dfgpst]|docx?|sxc|xlsx?|xlt|xlw|gnm|gnumeric, has soffice, X, flag f = soffice "$@"
ext pptx?|od[dfgpst]|docx?|sxc|xlsx?|xlt|xlw|gnm|gnumeric, has ooffice, X, flag f = ooffice "$@"
ext djvu, has zathura,X, flag f = zathura -- "$@"
ext djvu, has evince, X, flag f = evince -- "$@"
ext djvu, has atril, X, flag f = atril -- "$@"
ext djvu, has djview, X, flag f = djview -- "$@"
ext epub, has ebook-viewer, X, flag f = ebook-viewer -- "$@"
ext epub, has zathura, X, flag f = zathura -- "$@"
ext epub, has mupdf, X, flag f = mupdf -- "$@"
ext mobi, has ebook-viewer, X, flag f = ebook-viewer -- "$@"
ext cb[rz], has qcomicbook, X, flag f = qcomicbook "$@"
ext cb[rz], has mcomix, X, flag f = mcomix -- "$@"
ext cb[rz], has zathura, X, flag f = zathura -- "$@"
ext cb[rz], has atril, X, flag f = atril -- "$@"
ext sla, has scribus, X, flag f = scribus -- "$@"
#-------------------------------------------
# Images
#-------------------------------------------
mime ^image, has viewnior, X, flag f = viewnior -- "$@"
mime ^image/svg, has inkscape, X, flag f = inkscape -- "$@"
mime ^image/svg, has display, X, flag f = display -- "$@"
mime ^image, has imv, X, flag f = imv -- "$@"
mime ^image, has pqiv, X, flag f = pqiv -- "$@"
mime ^image, has sxiv, X, flag f = sxiv -- "$@"
mime ^image, has feh, X, flag f, !ext gif = feh -- "$@"
mime ^image, has mirage, X, flag f = mirage -- "$@"
mime ^image, has ristretto, X, flag f = ristretto "$@"
mime ^image, has eog, X, flag f = eog -- "$@"
mime ^image, has eom, X, flag f = eom -- "$@"
mime ^image, has nomacs, X, flag f = nomacs -- "$@"
mime ^image, has geeqie, X, flag f = geeqie -- "$@"
mime ^image, has gpicview, X, flag f = gpicview -- "$@"
mime ^image, has gwenview, X, flag f = gwenview -- "$@"
mime ^image, has xviewer, X, flag f = xviewer -- "$@"
mime ^image, has mcomix, X, flag f = mcomix -- "$@"
mime ^image, has gimp, X, flag f = gimp -- "$@"
mime ^image, has krita, X, flag f = krita -- "$@"
ext kra, has krita, X, flag f = krita -- "$@"
ext xcf, X, flag f = gimp -- "$@"
#-------------------------------------------
# Archives
#-------------------------------------------
# avoid password prompt by providing empty password
ext 7z, has 7z = 7z -p l "$@" | $PAGER
# This requires atool
ext ace|ar|arc|bz2?|cab|cpio|cpt|deb|dgc|dmg|gz, has atool = atool --list --each -- "$@" | $PAGER
ext iso|jar|msi|pkg|rar|shar|tar|tgz|xar|xpi|xz|zip, has atool = atool --list --each -- "$@" | $PAGER
ext 7z|ace|ar|arc|bz2?|cab|cpio|cpt|deb|dgc|dmg|gz, has atool = atool --extract --each -- "$@"
ext iso|jar|msi|pkg|rar|shar|tar|tgz|xar|xpi|xz|zip, has atool = atool --extract --each -- "$@"
# Listing and extracting archives without atool:
ext tar|gz|bz2|xz, has tar = tar vvtf "$1" | $PAGER
ext tar|gz|bz2|xz, has tar = for file in "$@"; do tar vvxf "$file"; done
ext bz2, has bzip2 = for file in "$@"; do bzip2 -dk "$file"; done
ext zip, has unzip = unzip -l "$1" | less
ext zip, has unzip = for file in "$@"; do unzip -d "${file%.*}" "$file"; done
ext ace, has unace = unace l "$1" | less
ext ace, has unace = for file in "$@"; do unace e "$file"; done
ext rar, has unrar = unrar l "$1" | less
ext rar, has unrar = for file in "$@"; do unrar x "$file"; done
ext rar|zip, has qcomicbook, X, flag f = qcomicbook "$@"
ext rar|zip, has mcomix, X, flag f = mcomix -- "$@"
ext rar|zip, has zathura, X, flag f = zathura -- "$@"
#-------------------------------------------
# Fonts
#-------------------------------------------
mime ^font, has fontforge, X, flag f = fontforge "$@"
#-------------------------------------------
# Flag t fallback terminals
#-------------------------------------------
# Rarely installed terminal emulators get higher priority; It is assumed that
# if you install a rare terminal emulator, you probably use it.
# gnome-terminal/konsole/xterm on the other hand are often installed as part of
# a desktop environment or as fallback terminal emulators.
mime ^ranger/x-terminal-emulator, has terminology = terminology -e "$@"
mime ^ranger/x-terminal-emulator, has kitty = kitty -- "$@"
mime ^ranger/x-terminal-emulator, has alacritty = alacritty -e "$@"
mime ^ranger/x-terminal-emulator, has sakura = sakura -e "$@"
mime ^ranger/x-terminal-emulator, has lilyterm = lilyterm -e "$@"
#mime ^ranger/x-terminal-emulator, has cool-retro-term = cool-retro-term -e "$@"
mime ^ranger/x-terminal-emulator, has termite = termite -x '"$@"'
#mime ^ranger/x-terminal-emulator, has yakuake = yakuake -e "$@"
mime ^ranger/x-terminal-emulator, has guake = guake -ne "$@"
mime ^ranger/x-terminal-emulator, has tilda = tilda -c "$@"
mime ^ranger/x-terminal-emulator, has st = st -e "$@"
mime ^ranger/x-terminal-emulator, has terminator = terminator -x "$@"
mime ^ranger/x-terminal-emulator, has urxvt = urxvt -e "$@"
mime ^ranger/x-terminal-emulator, has pantheon-terminal = pantheon-terminal -e "$@"
mime ^ranger/x-terminal-emulator, has lxterminal = lxterminal -e "$@"
mime ^ranger/x-terminal-emulator, has mate-terminal = mate-terminal -x "$@"
mime ^ranger/x-terminal-emulator, has xfce4-terminal = xfce4-terminal -x "$@"
mime ^ranger/x-terminal-emulator, has konsole = konsole -e "$@"
mime ^ranger/x-terminal-emulator, has gnome-terminal = gnome-terminal -- "$@"
mime ^ranger/x-terminal-emulator, has xterm = xterm -e "$@"
#-------------------------------------------
# Misc
#-------------------------------------------
label wallpaper, number 11, mime ^image, has feh, X = feh --bg-scale "$1"
label wallpaper, number 12, mime ^image, has feh, X = feh --bg-tile "$1"
label wallpaper, number 13, mime ^image, has feh, X = feh --bg-center "$1"
label wallpaper, number 14, mime ^image, has feh, X = feh --bg-fill "$1"
#-------------------------------------------
# Generic file openers
#-------------------------------------------
label open, has xdg-open = xdg-open "$@"
label open, has open = open -- "$@"
# Define the editor for non-text files + pager as last action
!mime ^text, !ext xml|json|csv|tex|py|pl|rb|rs|js|sh|php|dart = ask
label editor, !mime ^text, !ext xml|json|csv|tex|py|pl|rb|rs|js|sh|php|dart = ${VISUAL:-$EDITOR} -- "$@"
label pager, !mime ^text, !ext xml|json|csv|tex|py|pl|rb|rs|js|sh|php|dart = $PAGER -- "$@"
######################################################################
# The actions below are left so low down in this file on purpose, so #
# they are never triggered accidentally. #
######################################################################
# Execute a file as program/script.
mime application/x-executable = "$1"
# Move the file to trash using trash-cli.
label trash, has trash-put = trash-put -- "$@"
label trash = mkdir -p -- "${XDG_DATA_HOME:-$HOME/.local/share}/ranger/trash"; mv -- "$@" "${XDG_DATA_HOME:-$HOME/.local/share}/ranger/trash"

View file

@ -1,388 +0,0 @@
#!/usr/bin/env bash
set -o noclobber -o noglob -o nounset -o pipefail
IFS=$'\n'
## If the option `use_preview_script` is set to `true`,
## then this script will be called and its output will be displayed in ranger.
## ANSI color codes are supported.
## STDIN is disabled, so interactive scripts won't work properly
## This script is considered a configuration file and must be updated manually.
## It will be left untouched if you upgrade ranger.
## Because of some automated testing we do on the script #'s for comments need
## to be doubled up. Code that is commented out, because it's an alternative for
## example, gets only one #.
## Meanings of exit codes:
## code | meaning | action of ranger
## -----+------------+-------------------------------------------
## 0 | success | Display stdout as preview
## 1 | no preview | Display no preview at all
## 2 | plain text | Display the plain content of the file
## 3 | fix width | Don't reload when width changes
## 4 | fix height | Don't reload when height changes
## 5 | fix both | Don't ever reload
## 6 | image | Display the image `$IMAGE_CACHE_PATH` points to as an image preview
## 7 | image | Display the file directly as an image
## Script arguments
FILE_PATH="${1}" # Full path of the highlighted file
PV_WIDTH="${2}" # Width of the preview pane (number of fitting characters)
## shellcheck disable=SC2034 # PV_HEIGHT is provided for convenience and unused
PV_HEIGHT="${3}" # Height of the preview pane (number of fitting characters)
IMAGE_CACHE_PATH="${4}" # Full path that should be used to cache image preview
PV_IMAGE_ENABLED="${5}" # 'True' if image previews are enabled, 'False' otherwise.
FILE_EXTENSION="${FILE_PATH##*.}"
FILE_EXTENSION_LOWER="$(printf "%s" "${FILE_EXTENSION}" | tr '[:upper:]' '[:lower:]')"
## Settings
HIGHLIGHT_SIZE_MAX=262143 # 256KiB
HIGHLIGHT_TABWIDTH="${HIGHLIGHT_TABWIDTH:-8}"
HIGHLIGHT_STYLE="${HIGHLIGHT_STYLE:-pablo}"
HIGHLIGHT_OPTIONS="--replace-tabs=${HIGHLIGHT_TABWIDTH} --style=${HIGHLIGHT_STYLE} ${HIGHLIGHT_OPTIONS:-}"
PYGMENTIZE_STYLE="${PYGMENTIZE_STYLE:-autumn}"
OPENSCAD_IMGSIZE="${RNGR_OPENSCAD_IMGSIZE:-1000,1000}"
OPENSCAD_COLORSCHEME="${RNGR_OPENSCAD_COLORSCHEME:-Tomorrow Night}"
handle_extension() {
case "${FILE_EXTENSION_LOWER}" in
## Archive
a|ace|alz|arc|arj|bz|bz2|cab|cpio|deb|gz|jar|lha|lz|lzh|lzma|lzo|\
rpm|rz|t7z|tar|tbz|tbz2|tgz|tlz|txz|tZ|tzo|war|xpi|xz|Z|zip)
atool --list -- "${FILE_PATH}" && exit 5
bsdtar --list --file "${FILE_PATH}" && exit 5
exit 1;;
rar)
## Avoid password prompt by providing empty password
unrar lt -p- -- "${FILE_PATH}" && exit 5
exit 1;;
7z)
## Avoid password prompt by providing empty password
7z l -p -- "${FILE_PATH}" && exit 5
exit 1;;
## PDF
pdf)
## Preview as text conversion
pdftotext -l 10 -nopgbrk -q -- "${FILE_PATH}" - | \
fmt -w "${PV_WIDTH}" && exit 5
mutool draw -F txt -i -- "${FILE_PATH}" 1-10 | \
fmt -w "${PV_WIDTH}" && exit 5
exiftool "${FILE_PATH}" && exit 5
exit 1;;
## BitTorrent
torrent)
transmission-show -- "${FILE_PATH}" && exit 5
exit 1;;
## OpenDocument
odt|sxw)
## Preview as text conversion
odt2txt "${FILE_PATH}" && exit 5
## Preview as markdown conversion
pandoc -s -t markdown -- "${FILE_PATH}" && exit 5
exit 1;;
ods|odp)
## Preview as text conversion (unsupported by pandoc for markdown)
odt2txt "${FILE_PATH}" && exit 5
exit 1;;
## XLSX
xlsx)
## Preview as csv conversion
## Uses: https://github.com/dilshod/xlsx2csv
xlsx2csv -- "${FILE_PATH}" && exit 5
exit 1;;
## HTML
htm|html|xhtml)
## Preview as text conversion
w3m -dump "${FILE_PATH}" && exit 5
lynx -dump -- "${FILE_PATH}" && exit 5
elinks -dump "${FILE_PATH}" && exit 5
pandoc -s -t markdown -- "${FILE_PATH}" && exit 5
;;
## JSON
json)
jq --color-output . "${FILE_PATH}" && exit 5
python -m json.tool -- "${FILE_PATH}" && exit 5
;;
## Jupyter Notebooks
ipynb)
jupyter nbconvert --to markdown "${FILE_PATH}" --stdout | env COLORTERM=8bit bat --color=always --style=plain --language=markdown && exit 5
jupyter nbconvert --to markdown "${FILE_PATH}" --stdout && exit 5
jq --color-output . "${FILE_PATH}" && exit 5
python -m json.tool -- "${FILE_PATH}" && exit 5
;;
## Direct Stream Digital/Transfer (DSDIFF) and wavpack aren't detected
## by file(1).
dff|dsf|wv|wvc)
mediainfo "${FILE_PATH}" && exit 5
exiftool "${FILE_PATH}" && exit 5
;; # Continue with next handler on failure
esac
}
handle_image() {
## Size of the preview if there are multiple options or it has to be
## rendered from vector graphics. If the conversion program allows
## specifying only one dimension while keeping the aspect ratio, the width
## will be used.
local DEFAULT_SIZE="1920x1080"
local mimetype="${1}"
case "${mimetype}" in
## SVG
image/svg+xml|image/svg)
rsvg-convert --keep-aspect-ratio --width "${DEFAULT_SIZE%x*}" "${FILE_PATH}" -o "${IMAGE_CACHE_PATH}.png" \
&& mv "${IMAGE_CACHE_PATH}.png" "${IMAGE_CACHE_PATH}" \
&& exit 6
exit 1;;
## DjVu
# image/vnd.djvu)
# ddjvu -format=tiff -quality=90 -page=1 -size="${DEFAULT_SIZE}" \
# - "${IMAGE_CACHE_PATH}" < "${FILE_PATH}" \
# && exit 6 || exit 1;;
## Image
image/*)
local orientation
orientation="$( identify -format '%[EXIF:Orientation]\n' -- "${FILE_PATH}" )"
## If orientation data is present and the image actually
## needs rotating ("1" means no rotation)...
if [[ -n "$orientation" && "$orientation" != 1 ]]; then
## ...auto-rotate the image according to the EXIF data.
convert -- "${FILE_PATH}" -auto-orient "${IMAGE_CACHE_PATH}" && exit 6
fi
## `w3mimgdisplay` will be called for all images (unless overridden
## as above), but might fail for unsupported types.
exit 7;;
## Video
video/*)
# Get embedded thumbnail
ffmpeg -i "${FILE_PATH}" -map 0:v -map -0:V -c copy "${IMAGE_CACHE_PATH}" && exit 6
# Get frame 10% into video
ffmpegthumbnailer -i "${FILE_PATH}" -o "${IMAGE_CACHE_PATH}" -s 0 && exit 6
exit 1;;
## Audio
audio/*)
# Get embedded thumbnail
ffmpeg -i "${FILE_PATH}" -map 0:v -map -0:V -c copy \
"${IMAGE_CACHE_PATH}" && exit 6;;
## PDF
application/pdf)
pdftoppm -f 1 -l 1 \
-scale-to-x "${DEFAULT_SIZE%x*}" \
-scale-to-y -1 \
-singlefile \
-jpeg -tiffcompression jpeg \
-- "${FILE_PATH}" "${IMAGE_CACHE_PATH%.*}" \
&& exit 6 || exit 1;;
## ePub, MOBI, FB2 (using Calibre)
# application/epub+zip|application/x-mobipocket-ebook|\
# application/x-fictionbook+xml)
# # ePub (using https://github.com/marianosimone/epub-thumbnailer)
# epub-thumbnailer "${FILE_PATH}" "${IMAGE_CACHE_PATH}" \
# "${DEFAULT_SIZE%x*}" && exit 6
# ebook-meta --get-cover="${IMAGE_CACHE_PATH}" -- "${FILE_PATH}" \
# >/dev/null && exit 6
# exit 1;;
## Font
application/font*|application/*opentype)
preview_png="/tmp/$(basename "${IMAGE_CACHE_PATH%.*}").png"
if fontimage -o "${preview_png}" \
--pixelsize "120" \
--fontname \
--pixelsize "80" \
--text " ABCDEFGHIJKLMNOPQRSTUVWXYZ " \
--text " abcdefghijklmnopqrstuvwxyz " \
--text " 0123456789.:,;(*!?') ff fl fi ffi ffl " \
--text " The quick brown fox jumps over the lazy dog. " \
"${FILE_PATH}";
then
convert -- "${preview_png}" "${IMAGE_CACHE_PATH}" \
&& rm "${preview_png}" \
&& exit 6
else
exit 1
fi
;;
## Preview archives using the first image inside.
## (Very useful for comic book collections for example.)
# application/zip|application/x-rar|application/x-7z-compressed|\
# application/x-xz|application/x-bzip2|application/x-gzip|application/x-tar)
# local fn=""; local fe=""
# local zip=""; local rar=""; local tar=""; local bsd=""
# case "${mimetype}" in
# application/zip) zip=1 ;;
# application/x-rar) rar=1 ;;
# application/x-7z-compressed) ;;
# *) tar=1 ;;
# esac
# { [ "$tar" ] && fn=$(tar --list --file "${FILE_PATH}"); } || \
# { fn=$(bsdtar --list --file "${FILE_PATH}") && bsd=1 && tar=""; } || \
# { [ "$rar" ] && fn=$(unrar lb -p- -- "${FILE_PATH}"); } || \
# { [ "$zip" ] && fn=$(zipinfo -1 -- "${FILE_PATH}"); } || return
#
# fn=$(echo "$fn" | python -c "from __future__ import print_function; \
# import sys; import mimetypes as m; \
# [ print(l, end='') for l in sys.stdin if \
# (m.guess_type(l[:-1])[0] or '').startswith('image/') ]" |\
# sort -V | head -n 1)
# [ "$fn" = "" ] && return
# [ "$bsd" ] && fn=$(printf '%b' "$fn")
#
# [ "$tar" ] && tar --extract --to-stdout \
# --file "${FILE_PATH}" -- "$fn" > "${IMAGE_CACHE_PATH}" && exit 6
# fe=$(echo -n "$fn" | sed 's/[][*?\]/\\\0/g')
# [ "$bsd" ] && bsdtar --extract --to-stdout \
# --file "${FILE_PATH}" -- "$fe" > "${IMAGE_CACHE_PATH}" && exit 6
# [ "$bsd" ] || [ "$tar" ] && rm -- "${IMAGE_CACHE_PATH}"
# [ "$rar" ] && unrar p -p- -inul -- "${FILE_PATH}" "$fn" > \
# "${IMAGE_CACHE_PATH}" && exit 6
# [ "$zip" ] && unzip -pP "" -- "${FILE_PATH}" "$fe" > \
# "${IMAGE_CACHE_PATH}" && exit 6
# [ "$rar" ] || [ "$zip" ] && rm -- "${IMAGE_CACHE_PATH}"
# ;;
esac
# openscad_image() {
# TMPPNG="$(mktemp -t XXXXXX.png)"
# openscad --colorscheme="${OPENSCAD_COLORSCHEME}" \
# --imgsize="${OPENSCAD_IMGSIZE/x/,}" \
# -o "${TMPPNG}" "${1}"
# mv "${TMPPNG}" "${IMAGE_CACHE_PATH}"
# }
case "${FILE_EXTENSION_LOWER}" in
## 3D models
## OpenSCAD only supports png image output, and ${IMAGE_CACHE_PATH}
## is hardcoded as jpeg. So we make a tempfile.png and just
## move/rename it to jpg. This works because image libraries are
## smart enough to handle it.
# csg|scad)
# openscad_image "${FILE_PATH}" && exit 6
# ;;
# 3mf|amf|dxf|off|stl)
# openscad_image <(echo "import(\"${FILE_PATH}\");") && exit 6
# ;;
drawio)
draw.io -x "${FILE_PATH}" -o "${IMAGE_CACHE_PATH}" \
--width "${DEFAULT_SIZE%x*}" && exit 6
exit 1;;
esac
}
handle_mime() {
local mimetype="${1}"
case "${mimetype}" in
## RTF and DOC
text/rtf|*msword)
## Preview as text conversion
## note: catdoc does not always work for .doc files
## catdoc: http://www.wagner.pp.ru/~vitus/software/catdoc/
catdoc -- "${FILE_PATH}" && exit 5
exit 1;;
## DOCX, ePub, FB2 (using markdown)
## You might want to remove "|epub" and/or "|fb2" below if you have
## uncommented other methods to preview those formats
*wordprocessingml.document|*/epub+zip|*/x-fictionbook+xml)
## Preview as markdown conversion
pandoc -s -t markdown -- "${FILE_PATH}" && exit 5
exit 1;;
## E-mails
message/rfc822)
## Parsing performed by mu: https://github.com/djcb/mu
mu view -- "${FILE_PATH}" && exit 5
exit 1;;
## XLS
*ms-excel)
## Preview as csv conversion
## xls2csv comes with catdoc:
## http://www.wagner.pp.ru/~vitus/software/catdoc/
xls2csv -- "${FILE_PATH}" && exit 5
exit 1;;
## Text
text/* | */xml)
## Syntax highlight
if [[ "$( stat --printf='%s' -- "${FILE_PATH}" )" -gt "${HIGHLIGHT_SIZE_MAX}" ]]; then
exit 2
fi
if [[ "$( tput colors )" -ge 256 ]]; then
local pygmentize_format='terminal256'
local highlight_format='xterm256'
else
local pygmentize_format='terminal'
local highlight_format='ansi'
fi
env HIGHLIGHT_OPTIONS="${HIGHLIGHT_OPTIONS}" highlight \
--out-format="${highlight_format}" \
--force -- "${FILE_PATH}" && exit 5
env COLORTERM=8bit bat --color=always --style="plain" \
-- "${FILE_PATH}" && exit 5
pygmentize -f "${pygmentize_format}" -O "style=${PYGMENTIZE_STYLE}"\
-- "${FILE_PATH}" && exit 5
exit 2;;
## DjVu
image/vnd.djvu)
## Preview as text conversion (requires djvulibre)
djvutxt "${FILE_PATH}" | fmt -w "${PV_WIDTH}" && exit 5
exiftool "${FILE_PATH}" && exit 5
exit 1;;
## Image
image/*)
## Preview as text conversion
# img2txt --gamma=0.6 --width="${PV_WIDTH}" -- "${FILE_PATH}" && exit 4
exiftool "${FILE_PATH}" && exit 5
exit 1;;
## Video and audio
video/* | audio/*)
mediainfo "${FILE_PATH}" && exit 5
exiftool "${FILE_PATH}" && exit 5
exit 1;;
## ELF files (executables and shared objects)
application/x-executable | application/x-pie-executable | application/x-sharedlib)
readelf -WCa "${FILE_PATH}" && exit 5
exit 1;;
esac
}
handle_fallback() {
echo '----- File Type Classification -----' && file --dereference --brief -- "${FILE_PATH}" && exit 5
exit 1
}
MIMETYPE="$( file --dereference --brief --mime-type -- "${FILE_PATH}" )"
if [[ "${PV_IMAGE_ENABLED}" == 'True' ]]; then
handle_image "${MIMETYPE}"
fi
handle_extension
handle_mime "${MIMETYPE}"
handle_fallback
exit 1

View file

@ -1,96 +0,0 @@
{
config,
pkgs,
lib,
font,
...
}:
let
inherit (config.my)
key
theme
accent
font
;
inherit (theme) color;
in
{
config = {
programs.rofi = {
enable = true;
package = pkgs.rofi-wayland.override {
plugins = with pkgs; [
rofi-emoji
rofi-file-browser
];
};
extraConfig = {
show-icons = true;
modi = "drun,emoji";
terminal = "alacritty";
display-drun = "Iniciar: ";
kb-primary-paste = "Control+V,Shift+Insert";
kb-secondary-paste = "Control+v,Insert";
};
theme =
let
# Use `mkLiteral` for string-like values that should show without
# quotes, e.g.:
# {
# foo = "abc"; => foo: "abc";
# bar = mkLiteral "abc"; => bar: abc;
# };
inherit (config.lib.formats.rasi) mkLiteral;
in
{
"*" = {
# foreground-color = mkLiteral color.txt;
text-color = mkLiteral color.txt;
# background-color = mkLiteral color.bg;
background-color = mkLiteral "transparent";
# width = 512;
};
"#window" = {
background-color = mkLiteral "${color.bg}${lib.toHexString (theme.opacity * 255 / 100)}";
# children = map mkLiteral [ "prompt" "entry" ];
border = mkLiteral "2px solid";
border-color = mkLiteral accent.color;
padding = 0;
};
"#inputbar" = {
margin = mkLiteral "10px";
};
"#listview" = {
# fixed-height=0;
border = mkLiteral "2px solid 0px 0px";
# border-color = mkLiteral "@separatorcolor";
# spacing= 0 ;
};
# "#textbox-prompt-colon" = {
# expand = false;
# str = ":";
# margin = mkLiteral "0px 0.3em 0em 0em";
# text-color = mkLiteral "@foreground-color";
# };
"#element" = {
# text-color = mkLiteral "#252525";
background-color = mkLiteral "transparent";
padding = mkLiteral "3px 10px";
};
"#element selected" = {
# text-color = mkLiteral "#252525";
background-color = mkLiteral accent.color;
};
element-icon = {
# background-color= inherit;
# text-color= inherit;
margin-right = mkLiteral "20px";
size = 24;
};
};
};
};
}

View file

@ -1,164 +0,0 @@
{
config,
pkgs,
lib,
...
}:
let
inherit (config.my)
key
accent
font
theme
;
inherit (theme) color;
in
{
imports = [
./kanshi.nix
./mako.nix
./sway-binds.nix
./sway-modes.nix
./sway-assigns.nix
./swayidle.nix
./swaylock.nix
./theme.nix
];
config = lib.mkIf (config.my.desktop == "sway") {
services.mako.enable = true;
services.swayidle.enable = true;
services.kanshi.enable = true;
wayland.windowManager.sway = {
enable = true;
package = pkgs.mySway;
config = {
bars = [ ];
floating.modifier = "Mod4";
terminal = pkgs.alacritty.executable;
window.titlebar = false;
gaps = {
smartGaps = true;
smartBorders = "on";
inner = 5;
};
colors =
let
acc = accent.color;
fg_acc = accent.fg;
fg_color = color.txt;
bg_color = color.bg_dark;
alert = "#000000";
client = border: background: text: indicator: childBorder: {
inherit
border
background
text
indicator
childBorder
;
};
in
{
focused = client acc acc fg_acc acc acc;
focusedInactive = client bg_color bg_color fg_color bg_color bg_color;
unfocused = client bg_color bg_color fg_color bg_color bg_color;
urgent = client alert alert fg_color alert alert;
};
output = {
"*" = {
bg = "${theme.background} fill";
mode = "1920x1080@144.000Hz";
};
};
fonts = {
names = [ font.interface ];
size = font.size.medium * 1.0;
};
# Ignore PS4 controller touchpad events
input."1356:2508:Wireless_Controller_Touchpad".events = "disabled";
input."1133:16537:Logitech_G502_X_PLUS" = {
accel_profile = "flat";
pointer_accel = "0";
};
input."type:touchpad" = {
# Disable While Typing
dwt = "enabled";
natural_scroll = "enabled";
tap = "enabled";
};
input."*" = {
xkb_layout = "us(colemak),br";
xkb_options = "lv3:lsgt_switch,grp:shifts_toggle";
xkb_numlock = "enabled";
repeat_rate = "30";
repeat_delay = "200";
};
# setup cursor based on home.pointerCursor
seat."*" = {
xcursor_theme = "${config.home.pointerCursor.name} ${toString config.home.pointerCursor.size}";
hide_cursor = "when-typing enable";
};
};
extraConfig = ''
for_window [title=.*] inhibit_idle fullscreen
exec swaymsg workspace 2
exec_always systemctl --user restart waybar.service
exec corectrl --minimize-systray
'';
};
services.gammastep = {
enable = true;
provider = "geoclue2";
};
services.kdeconnect = {
enable = true;
indicator = true;
};
services.gpg-agent.pinentryPackage = pkgs.pinentry-all;
xdg.configFile."OpenTabletDriver/settings.json".source = ./open-tablet-driver.json;
home.packages = with pkgs; [
mySway
swaybg
swaylock
wdisplays
waybar
dhist
demoji
bmenu
wdmenu
wlauncher
volumesh
brightnessctl
showkeys
pamixer
libnotify
xdg-utils
screenshotsh
color_picker
wf-recorder
wl-clipboard
wtype
wl-crosshair
grim
satty
xdg-user-dirs
(tesseract5.override {
enableLanguages = [
"eng"
"por"
];
})
];
};
}

View file

@ -1,51 +0,0 @@
{
config,
pkgs,
lib,
...
}:
let
inherit (config.my)
key
accent
font
theme
;
inherit (theme) color;
in
{
services.kanshi = {
settings = [
{
profile = {
name = "sedetary";
outputs = [
{
criteria = "eDP-1";
status = "disable";
position = "1920,312";
}
{
criteria = "HDMI-A-1";
position = "0,0";
}
];
exec = [ "xrdb .Xresources" ];
};
}
{
profile = {
name = "nomad";
outputs = [
{
criteria = "eDP-1";
status = "enable";
position = "1920,312";
}
];
exec = [ "xrdb .Xresources" ];
};
}
];
};
}

Some files were not shown because too many files have changed in this diff Show more