tree-wide: remove sway related config

This commit is contained in:
Leonardo Eugênio 2024-08-20 19:16:39 -03:00
parent 7780de1f47
commit 2e2f2239a5
82 changed files with 10 additions and 6568 deletions

View file

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

View file

@ -1,10 +1,9 @@
{ inputs, packages, ... }: { inputs, ... }:
rec { rec {
all = [ all = [
scripts scripts
themes themes
new-packages new-packages
patches
lib_extended lib_extended
disko disko
]; ];
@ -35,9 +34,7 @@ rec {
); );
new-packages = ( new-packages = (
final: prev: final: prev: {
packages
// {
dhist = inputs.dhist.packages.${prev.system}.dhist; dhist = inputs.dhist.packages.${prev.system}.dhist;
demoji = inputs.demoji.packages.${prev.system}.default; demoji = inputs.demoji.packages.${prev.system}.default;
tlauncher = inputs.tlauncher.packages.${prev.system}.tlauncher; tlauncher = inputs.tlauncher.packages.${prev.system}.tlauncher;
@ -45,18 +42,6 @@ rec {
} }
); );
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 ];
});
};
}
);
lib_extended = ( lib_extended = (
final: prev: { final: prev: {
lib = prev.lib // rec { lib = prev.lib // rec {

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 +0,0 @@
# 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 { };
}

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

@ -44,11 +44,6 @@
_diffr = [ diffr ]; _diffr = [ diffr ];
_thunar-terminal = [ terminal ]; _thunar-terminal = [ terminal ];
_sway_idle_toggle = [ swayidle ]; _sway_idle_toggle = [ swayidle ];
kak-pager = [
fish
_diffr
];
kak-man-pager = [ kak-pager ];
helix-pager = [ helix-pager = [
fish fish
_diffr _diffr

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,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,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 = [ imports = [
./gamemode.nix
./cachix.nix
./media-packages.nix ./media-packages.nix
./boot.nix ./boot.nix
./thunar.nix
./nix.nix ./nix.nix
./fonts.nix ./fonts.nix
./sound.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,5 @@
chrome-gnome-shell chrome-gnome-shell
gnomeExtensions.quick-settings-audio-devices-hider gnomeExtensions.quick-settings-audio-devices-hider
gnome-pass-search-provider
]; ];
} }

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

@ -18,14 +18,12 @@ in
ffmpeg ffmpeg
obs-studio obs-studio
imagemagick imagemagick
mpc-cli
helvum helvum
gimp gimp
inkscape inkscape
krita krita
kdePackages.breeze kdePackages.breeze
kdePackages.kdenlive kdePackages.kdenlive
pitivi
blender-hip blender-hip
libreoffice libreoffice
godot_4 godot_4

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

@ -6,41 +6,6 @@
}: }:
{ {
xdg.desktopEntries = { 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 = { down_meme = {
name = "DownMeme"; name = "DownMeme";
genericName = "Download memes"; 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

@ -40,12 +40,6 @@ in
}; };
shellAbbrs = { shellAbbrs = {
off = "shutdown now"; off = "shutdown now";
v =
{
"helix" = "hx";
"kakoune" = "kak";
}
.${editor};
ns = "nix develop --command $SHELL"; ns = "nix develop --command $SHELL";
wcf = "wl-copy-file"; wcf = "wl-copy-file";
c = "cargo"; c = "cargo";

View file

@ -28,11 +28,6 @@ in
autoSquash = true; autoSquash = true;
autoStash = 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 = { alias = {
graph = "log --graph --oneline --branches"; graph = "log --graph --oneline --branches";
root = "rev-parse --show-toplevel"; root = "rev-parse --show-toplevel";

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

@ -9,36 +9,20 @@
{ {
imports = [ imports = [
./controller.nix ./controller.nix
./waybar
./helix.nix ./helix.nix
./kakoune
./vscode ./vscode
./fish ./fish
./firefox.nix ./firefox.nix
./alacritty.nix
./git.nix ./git.nix
./ssh.nix ./ssh.nix
./gpg.nix
./rofi.nix
./mpv.nix
./mangohud.nix ./mangohud.nix
./pipewire.nix ./pipewire.nix
./mimeapps.nix ./mimeapps.nix
./desktop-entries.nix ./desktop-entries.nix
./chat.nix ./chat.nix
./syncthing.nix
./bmenu.nix
./fzf.nix ./fzf.nix
./ranger
./lf
./pass.nix
./pqiv.nix
./zathura.nix
./man.nix ./man.nix
./mpd.nix
./sway
./gnome.nix ./gnome.nix
./thunar.nix
./xdg-dirs.nix ./xdg-dirs.nix
inputs.nix-index-database.hmModules.nix-index inputs.nix-index-database.hmModules.nix-index
../settings ../settings
@ -88,7 +72,6 @@
sd sd
ripgrep ripgrep
translate-shell translate-shell
lipsum
par par
mate.engrampa mate.engrampa
@ -133,7 +116,6 @@
clang-tools # c/c++ lsp server clang-tools # c/c++ lsp server
rust-analyzer # rust analyzer rust-analyzer # rust analyzer
blade-formatter
nixfmt-rfc-style 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, 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 = { config = {
programs.man = { programs.man = {
enable = true; enable = true;
generateCaches = 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" ];
};
}
];
};
}

View file

@ -1,65 +0,0 @@
{
config,
pkgs,
lib,
...
}:
let
inherit (config.my)
key
accent
font
theme
;
inherit (theme) color;
in
{
services.mako = {
borderSize = 2;
padding = "5";
margin = "15";
layer = "overlay";
font = "${font.interface} ${toString font.size.small}";
textColor = color.txt;
backgroundColor = color.bg;
borderColor = accent.color;
progressColor = "over ${accent.color}88";
defaultTimeout = 10000;
extraConfig = ''
[app-name=volumesh]
default-timeout=5000
group-by=app-name
format=<b>%s</b>\n%b
'';
# # {{@@ header() @@}}
# # text
# # features
# icons=1
# markup=1
# actions=1
# default-timeout=10000
# # position
# layer=overlay
};
systemd.user.services.mako = lib.mkIf (config.services.mako.enable) {
Unit = {
Description = "Notification daemon";
PartOf = [ "graphical-session.target" ];
After = [ "graphical-session.target" ];
};
Service = {
ExecStart = "${pkgs.mako}/bin/mako";
Restart = "on-failure";
};
Install = {
WantedBy = [ "sway-session.target" ];
};
};
}

View file

@ -1,114 +0,0 @@
{
"Profiles": [
{
"Tablet": "Wacom CTL-4100",
"OutputMode": {
"Path": "OpenTabletDriver.Desktop.Output.LinuxArtistMode",
"Settings": [],
"Enable": true
},
"Filters": [],
"AbsoluteModeSettings": {
"Display": {
"Width": 1920.0,
"Height": 1080.0,
"X": 960.0,
"Y": 540.0,
"Rotation": 0.0
},
"Tablet": {
"Width": 152.0,
"Height": 85.5,
"X": 76.0,
"Y": 47.5,
"Rotation": 0.0
},
"EnableClipping": false,
"EnableAreaLimiting": false,
"LockAspectRatio": true
},
"RelativeModeSettings": {
"XSensitivity": 10.0,
"YSensitivity": 10.0,
"RelativeRotation": 0.0,
"RelativeResetDelay": "00:00:00.1000000"
},
"Bindings": {
"TipActivationThreshold": 0.0,
"TipButton": null,
"EraserActivationThreshold": 0.0,
"EraserButton": null,
"PenButtons": [
{
"Path": "OpenTabletDriver.Desktop.Binding.LinuxArtistMode.LinuxArtistModeButtonBinding",
"Settings": [
{
"Property": "Button",
"Value": "Pen Button 1"
}
],
"Enable": true
},
{
"Path": "OpenTabletDriver.Desktop.Binding.LinuxArtistMode.LinuxArtistModeButtonBinding",
"Settings": [
{
"Property": "Button",
"Value": "Pen Button 2"
}
],
"Enable": true
}
],
"AuxButtons": [
{
"Path": "OpenTabletDriver.Desktop.Binding.MultiKeyBinding",
"Settings": [
{
"Property": "Keys",
"Value": "Control+Z"
}
],
"Enable": true
},
{
"Path": "OpenTabletDriver.Desktop.Binding.MultiKeyBinding",
"Settings": [
{
"Property": "Keys",
"Value": "Control+O"
}
],
"Enable": true
},
{
"Path": "OpenTabletDriver.Desktop.Binding.MultiKeyBinding",
"Settings": [
{
"Property": "Keys",
"Value": "Control+Minus"
}
],
"Enable": true
},
{
"Path": "OpenTabletDriver.Desktop.Binding.MultiKeyBinding",
"Settings": [
{
"Property": "Keys",
"Value": "Control+Equal"
}
],
"Enable": true
}
],
"MouseButtons": [],
"MouseScrollUp": null,
"MouseScrollDown": null
}
}
],
"LockUsableAreaDisplay": true,
"LockUsableAreaTablet": true,
"Tools": []
}

View file

@ -1,65 +0,0 @@
{ config, pkgs, ... }:
let
in
# inherit (config.my) key accent font theme;
# inherit (theme) color;
# inherit (pkgs) lib;
# mod = "Mod4";
# menu = "wlauncher";
# terminal = "alacritty";
# locked_binds =
# lib.mapAttrs' (k: v: lib.nameValuePair "--locked ${k}" v);
# code_binds =
# lib.mapAttrs' (k: v: lib.nameValuePair "--to-code ${k}" v);
# return_mode = lib.mapAttrs (k: v: "${v}; mode default");
# playerctl = "exec ${pkgs.playerctl}/bin/playerctl";
{
wayland.windowManager.sway.config = {
assigns = {
"2" = [
{ class = "firefox"; }
{ app_id = "firefox"; }
{ class = "Chromium"; }
{ app_id = "chromium"; }
];
"6" = [
{ app_id = "org.nicotine_plus.Nicotine"; }
{ app_id = "deluge"; }
{ app_id = "com.obsproject.Studio"; }
];
"7" = [
{ app_id = "thunderbird"; }
{ app_id = "astroid"; }
];
"9" = [
{ class = ".*[Ss]team.*"; }
{ app_id = ".*[Ss]team.*"; }
{ app_id = "[Ll]utris"; }
];
"10" = [
{ app_id = ".*[Tt]elegram.*"; }
{ class = ".*[Tt]elegram.*"; }
{ class = "Jitsi Meet"; }
{ class = "discord"; }
{ title = "Discord"; }
{ class = "WebCord"; }
{ app_id = "WebCord"; }
{ class = "vesktop"; }
{ app_id = "vesktop"; }
{ class = "Element"; }
{ app_id = "Element"; }
];
};
floating = {
criteria = [
{ class = "Godot"; }
{ class = "file_picker"; }
{ app_id = "file_picker"; }
{ app_id = "wdisplays"; }
{ app_id = "pavucontrol"; }
{ app_id = ".*[Hh]elvum.*"; }
{ workspace = "9"; }
];
};
};
}

View file

@ -1,208 +0,0 @@
{ config, pkgs, ... }:
let
inherit (config.my)
key
accent
font
theme
;
inherit (theme) color;
inherit (pkgs) lib;
mod = "Mod4";
menu = "wlauncher";
terminal = "alacritty";
_lock = pkgs.writeShellScriptBin "_lock" ''
${pkgs.sway}/bin/swaymsg mode default
${pkgs.swaylock}/bin/swaylock -f
'';
_suspend = pkgs.writeShellScriptBin "_suspend" ''
${pkgs.sway}/bin/swaymsg mode default
systemctl --user start swayidle.service
systemctl suspend
'';
# mod+1 to swich to workspace 1
# mod+shift+1 to move to workspace 1
workspace_binds = lib.forEachMerge (lib.range 1 10) (
i:
let
key = toString (lib.mod i 10);
workspaceNumber = toString i;
in
{
"${mod}+${key}" = "workspace number ${workspaceNumber}";
"${mod}+Shift+${key}" = "move container to workspace number ${workspaceNumber}";
}
);
prev_next_binds =
let
maybe_window = key: if (lib.strings.hasInfix "button" key) then "--whole-window" else "";
makePrevNextBindFunction = (
prev_or_next:
map (key: {
"${maybe_window key} ${mod}+${key}" = "workspace ${prev_or_next}_on_output";
})
);
prev_binds = makePrevNextBindFunction "prev" [
key.tabL
"bracketleft"
"Prior"
"button9"
"button4"
"Shift+Tab"
];
next_binds = makePrevNextBindFunction "next" [
key.tabR
"bracketright"
"Next"
"button8"
"button5"
"Tab"
];
in
lib.mergeAttrsSet (prev_binds ++ next_binds);
# focus, move, resize, (focus and move output)
# for every direction with both arrow keys and vim keys
movement_binds =
let
directions = [
"Left"
"Up"
"Right"
"Down"
];
makeVimKeys = (k: key.${lib.toLower k});
makeArrowKeys = (k: k);
makeResizeCommand =
direction:
{
Left = "shrink width 20px";
Up = "shrink height 20px";
Right = "grow width 20px";
Down = "grow height 20px";
}
.${direction};
in
lib.forEachMerge
[
makeVimKeys
makeArrowKeys
]
(
prefixFun:
lib.forEachMerge directions (
direction:
let
resize_cmd = makeResizeCommand direction;
keyBind = prefixFun direction;
in
{
# Move focus
"${mod}+${keyBind}" = "focus ${direction}";
# Move window
"${mod}+Shift+${keyBind}" = "move ${direction}";
# Resize window
"${mod}+Control+${keyBind}" = "resize ${resize_cmd}";
# focus output
"${mod}+mod1+${keyBind}" = "focus output ${direction}";
# Move workspace to output
"${mod}+mod1+Shift+${keyBind}" = "move workspace output ${direction}";
}
)
);
parenting_binds = {
"${mod}+equal" = "focus parent";
"${mod}+minus" = "focus child";
"${mod}+r" = "layout toggle split";
"${mod}+t" = "layout toggle split tabbed stacking";
"${mod}+b" = "splith";
"${mod}+v" = "splitv";
"${mod}+a" = "focus parent";
## TODO:
# "${mod}+Shift+minus" = "move scratchpad";
# "${mod}+minus" = "scratchpad show";
};
audio_binds = {
XF86AudioRaiseVolume = "exec volumesh -i 10";
XF86AudioLowerVolume = "exec volumesh -d 10";
XF86AudioMute = "exec volumesh -t";
XF86AudioMicMute = "exec pactl set-source-mute @DEFAULT_SOURCE@ toggle";
# Control media
XF86AudioPlay = "exec playerctl play-pause";
XF86AudioPause = "exec playerctl play-pause";
XF86AudioNext = "exec playerctl next";
XF86AudioPrev = "exec playerctl previous";
};
system_binds = {
"--locked Ctrl+${mod}+z" = "exec ${_suspend}/bin/_suspend";
"${mod}+Alt+c" = "exec ${pkgs._sway_idle_toggle}/bin/_sway_idle_toggle";
};
screenshot_binds = {
# Screens to file
"Print" = "exec ${pkgs.screenshotsh}/bin/screenshotsh def";
# Screen area to file
"Shift+Print" = "exec ${pkgs.screenshotsh}/bin/screenshotsh area";
# Screen area to clipboard
"Control+Shift+Print" = "exec ${pkgs.screenshotsh}/bin/screenshotsh area-clip";
# Focused monitor to clipboard
"Control+Print" = "exec ${pkgs.screenshotsh}/bin/screenshotsh clip";
};
screen_binds = {
"XF86MonBrightnessDown" = "exec brightnessctl --min-value=1 set 5%-";
"XF86MonBrightnessUp" = "exec brightnessctl --min-value=1 set 5%+";
"${mod}+l" = lib.getExe _lock;
};
other_binds = {
"${mod}+p" = "exec ${pkgs.wpass}/bin/wpass";
"${mod}+s" = "exec ${menu}";
"${mod}+g" = "exec ${pkgs.demoji}/bin/demoji --lang pt --fallback --copy -- ${pkgs.wdmenu}/bin/wdmenu";
"${mod}+c" = "exec ${pkgs.color_picker}/bin/color_picker";
"${mod}+Return" = "exec ${terminal}";
"${mod}+Ctrl+Return" = "exec thunar";
"${mod}+Shift+s" = ''
exec grim - | satty --filename - --fullscreen --output-filename "$(xdg-user-dir PICTURES)"/Screenshots/satty-$(date '+%Y%m%d-%H:%M:%S').png
'';
"${mod}+Ctrl+v" = "exec wl-paste | tesseract -l por - - | wl-copy";
"${mod}+k" = "exec showkeys";
"${mod}+Alt+x" = "exec pkill wl-crosshair || exec wl-crosshair";
"${mod}+x" = "kill";
"${mod}+m" = "mode audio";
"${mod}+escape" = "mode passthrough;exec notify-send 'Passthrough on'";
"${mod}+ctrl+k" = "exec swaymsg input type:pointer events disabled";
"${mod}+ctrl+shift+k" = "exec swaymsg input type:pointer events enabled";
"${mod}+f" = "fullscreen toggle";
"${mod}+Shift+space" = "floating toggle";
"${mod}+space" = "focus mode_toggle";
"${mod}+ctrl+space" = "sticky toggle";
"${mod}+Shift+c" = "reload";
# "${mod}+Shift+e" =
# "exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'";
# https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/1731
"${mod}+Ctrl+Shift+Alt+l" = "exec xdg-open https://www.linkedin.com";
};
in
{
wayland.windowManager.sway.config.keybindings = lib.mergeAttrsSet [
other_binds
workspace_binds
prev_next_binds
movement_binds
audio_binds
system_binds
parenting_binds
screenshot_binds
screen_binds
];
}

View file

@ -1,102 +0,0 @@
{ config, pkgs, ... }:
let
inherit (config.my)
key
accent
font
theme
;
inherit (theme) color;
inherit (pkgs) lib;
mod = "Mod4";
menu = "wlauncher";
terminal = "alacritty";
locked = lib.mapAttrs' (k: v: lib.nameValuePair "--locked ${k}" v);
to-code = lib.mapAttrs' (k: v: lib.nameValuePair "--to-code ${k}" v);
quit-mode = lib.mapAttrs (k: v: "${v}; mode default");
playerctl = "exec ${pkgs.playerctl}/bin/playerctl";
bind_group = opts: binds: lib.pipe binds opts;
in
{
wayland.windowManager.sway.config.modes = {
audio =
(bind_group
[
to-code
locked
]
{
${key.tabR} = "exec volumesh -i 10";
${key.tabL} = "exec volumesh -d 10";
${key.right} = "exec mpc next";
${key.left} = "exec mpc prev";
${key.up} = "exec volumesh --mpd -i 10";
${key.down} = "exec volumesh --mpd -d 10";
}
)
// (bind_group
[
locked
quit-mode
]
{
"space" = "exec mpc toggle";
"escape" = "";
"q" = "";
}
)
// (bind_group [ quit-mode ] {
"m" = "exec volumesh -t";
"s" = "exec ${pkgs.pulse_sink}/bin/pulse_sink";
"d" = "exec ${pkgs.musmenu}/bin/musmenu delete";
"f" = "exec ${pkgs.musmenu}/bin/musmenu search";
"a" = "exec ${pkgs.dzadd}/bin/dzadd";
"Shift+y" = "exec ${pkgs.musmenu}/bin/musmenu yank";
"Ctrl+a" = "exec ${pkgs.musmenu}/bin/musmenu padd";
"Ctrl+s" = "exec ${pkgs.musmenu}/bin/musmenu psave";
"Ctrl+o" = "exec ${pkgs.musmenu}/bin/musmenu pload";
"Ctrl+d" = "exec ${pkgs.musmenu}/bin/musmenu pdelete";
})
// {
"p" = "mode playerctl";
"Ctrl+c" = "exec musmenu pclear";
};
playerctl =
(bind_group
[
to-code
locked
]
{
${key.left} = "${playerctl} previous";
${key.right} = "${playerctl} next";
${key.up} = "${playerctl} volume 10+";
${key.down} = "${playerctl} volume 10-";
${key.tabR} = "${playerctl} volume 10+";
${key.tabL} = "${playerctl} volume 10-";
}
)
// (bind_group
[
to-code
quit-mode
]
{
"space" = "${playerctl} play-pause";
"escape" = "";
"q" = "";
}
);
passthrough = {
"${mod}+escape" = "mode default;exec notify-send 'Passthrough off'";
};
};
}

View file

@ -1,50 +0,0 @@
{
config,
pkgs,
lib,
...
}:
let
inherit (config.my)
key
accent
font
theme
;
inherit (theme) color;
asScript = filename: text: toString (pkgs.writeShellScript filename text);
in
{
services.swayidle = {
timeouts = [
{
timeout = 360;
command = "${pkgs.swaylock}/bin/swaylock -f";
}
{
timeout = 1800;
command = asScript "swayidle-suspend-monitors" ''
${pkgs.mpc_cli}/bin/mpc status | grep "^[playing]" > /dev/null || ${pkgs.sway}/bin/swaymsg "output * dpms off"
'';
resumeCommand = asScript "swayidle-wakeup-monitors" ''
${pkgs.sway}/bin/swaymsg "output * dpms on"
'';
}
];
events = [
{
event = "before-sleep";
command = "${pkgs.swaylock}/bin/swaylock -f";
}
{
event = "after-resume";
command = asScript "after-resume" ''
${pkgs.sway}/bin/swaymsg "output * dpms on"
${pkgs.systemd}/bin/systemctl --user restart \
kdeconnect.service kdeconnect-indicator.service
'';
}
];
};
}

View file

@ -1,35 +0,0 @@
{
config,
pkgs,
lib,
...
}:
let
inherit (config.my)
key
accent
font
theme
;
inherit (theme) color;
in
{
programs.swaylock.settings = {
image = toString theme.background;
font = font.interface;
font-size = font.size.medium;
indicator-thickness = 20;
color = color.bg;
inside-color = "#FFFFFF00";
bs-hl-color = color.normal.red;
ring-color = color.normal.green;
key-hl-color = accent.color;
# divisor lines;
separator-color = "#aabbcc00";
line-color = "#aabbcc00";
line-clear-color = "#aabbcc00";
line-caps-lock-color = "#aabbcc00";
line-ver-color = "#aabbcc00";
line-wrong-color = "#aabbcc00";
};
}

View file

@ -1,125 +0,0 @@
{
config,
pkgs,
lib,
inputs,
...
}:
let
inherit (config.my) theme font desktop;
inherit (theme)
color
gtk_theme
icon_theme
cursor_theme
;
in
lib.mkIf (desktop == "sway") {
home.pointerCursor = {
name = cursor_theme;
size = 24;
package = pkgs.bibata-cursors;
gtk.enable = true;
};
gtk =
{
enable = true;
font = {
name = font.interface;
size = font.size.small;
};
theme = {
name = gtk_theme;
package = pkgs.orchis_theme_compact;
};
iconTheme = {
name = icon_theme;
package = pkgs.papirus_red;
};
}
// (
let
shared.extraConfig = {
gtk-decoration-layout = "menu:";
};
in
{
gtk4 = shared;
gtk3 = shared;
}
);
xdg.configFile."gtk-3.0/settings.ini".force = true;
xdg.configFile."gtk-4.0/settings.ini".force = true;
qt = {
enable = true;
platformTheme.name = "gtk3";
style.name = "qt5ct";
};
dconf.settings = {
"org/gnome/desktop/interface" = {
gtk-theme = gtk_theme;
icon-theme = icon_theme;
cursor-theme = cursor_theme;
color-scheme = "prefer-${color.type}";
};
"org/gnome/desktop/wm/preferences" = {
button-layout = "menu:";
};
};
# fonts.fontconfig.enable = true;
xdg.configFile = {
"qt5ct/qt5ct.conf".text = ''
[Appearance]
# color_scheme_path=/nix/store/f07mk0vrm47jxw3y5v99hxncy0w4vcyq-qt5ct-1.5/share/qt5ct/colors/darker.conf
custom_palette=false
icon_theme=${icon_theme}
standard_dialogs=default
style=kvantum-dark
# [Fonts]
# fixed=@Variant(\0\0\0@\0\0\0\x1c\0H\0\x61\0\x63\0k\0 \0N\0\x65\0r\0\x64\0 \0\x46\0o\0n\0t@(\0\0\0\0\0\0\xff\xff\xff\xff\x5\x1\0\x32\x10)
# general=@Variant(\0\0\0@\0\0\0\x1e\0L\0i\0\x62\0\x65\0r\0\x61\0t\0i\0o\0n\0 \0S\0\x61\0n\0s@(\0\0\0\0\0\0\xff\xff\xff\xff\x5\x1\0\x32\x10)
'';
"kdedefaults/kdeglobals".text = ''
[General]
ColorScheme=BreezeDark
[Icons]
Theme=${icon_theme}
'';
};
services.xsettingsd = {
enable = true;
settings = {
"Gtk/FontName" = "${font.interface} ${toString font.size.small}";
"Net/ThemeName" = "${gtk_theme}";
"Net/IconThemeName" = "${icon_theme}";
"Gtk/CursorThemeName" = "${cursor_theme}";
"Gtk/CursorThemeSize" = 24;
"Net/SoundThemeName" = "freedesktop";
};
};
home.packages = with pkgs; [
libsForQt5.qt5ct
libsForQt5.qtstyleplugin-kvantum
qt6Packages.qt6ct
qt6Packages.qtstyleplugin-kvantum
pkgs.bibata-cursors
pkgs.orchis_theme_compact
pkgs.papirus_red
## fonts
liberation_ttf
hack-font
font-awesome_5
fira-code
nerdfonts_fira_hack
material-wifi-icons
];
}

View file

@ -1,10 +0,0 @@
{ ... }:
{
services.syncthing = {
enable = true;
tray = {
enable = true;
command = "syncthingtray --wait";
};
};
}

View file

@ -1,22 +0,0 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
_thunar-terminal
(xfce.thunar.override {
thunarPlugins = with pkgs.xfce; [
thunar-volman
thunar-archive-plugin
];
})
];
wayland.windowManager.sway = {
extraConfig = ''
exec_always systemctl --user import-environment PATH
'';
};
xdg.configFile = {
"Thunar/".source = ./thunar;
};
}

View file

@ -1,96 +0,0 @@
; thunar GtkAccelMap rc-file -*- scheme -*-
; this file is an automated accelerator map dump
;
; (gtk_accel_path "<Actions>/ThunarLauncher/delete-3" "<Shift>KP_Delete")
; (gtk_accel_path "<Actions>/ThunarWindow/reload" "<Primary>r")
; (gtk_accel_path "<Actions>/ThunarLauncher/delete" "")
; (gtk_accel_path "<Actions>/ThunarStandardView/invert-selection" "")
(gtk_accel_path "<Actions>/ThunarActions/uca-action-1623021489374475-1" "<Primary>Return")
; (gtk_accel_path "<Actions>/ThunarLauncher/open-in-new-tab" "<Primary><Shift>p")
; (gtk_accel_path "<Actions>/ThunarLauncher/delete-2" "<Shift>Delete")
; (gtk_accel_path "<Actions>/ThunarWindow/zoom-in" "<Primary>KP_Add")
; (gtk_accel_path "<Actions>/ThunarWindow/empty-trash" "")
; (gtk_accel_path "<Actions>/ThunarLauncher/open" "<Primary>o")
(gtk_accel_path "<Actions>/ThunarActions/uca-action-1623196889794306-1" "<Primary><Shift>c")
; (gtk_accel_path "<Actions>/ThunarWindow/view-side-pane-menu" "")
; (gtk_accel_path "<Actions>/ThunarStandardView/sort-ascending" "")
; (gtk_accel_path "<Actions>/ThunarWindow/open-network" "")
; (gtk_accel_path "<Actions>/ThunarWindow/contents/help-menu" "")
; (gtk_accel_path "<Actions>/ThunarWindow/open-file-system" "")
; (gtk_accel_path "<Actions>/ThunarStandardView/back-alt" "BackSpace")
; (gtk_accel_path "<Actions>/ThunarLauncher/paste" "<Primary>v")
; (gtk_accel_path "<Actions>/ThunarWindow/switch-next-tab" "<Primary>Page_Down")
; (gtk_accel_path "<Actions>/ThunarWindow/open-file-menu" "F10")
; (gtk_accel_path "<Actions>/ThunarWindow/view-as-compact-list" "<Primary>3")
; (gtk_accel_path "<Actions>/ThunarWindow/about" "")
; (gtk_accel_path "<Actions>/ThunarWindow/clear-directory-specific-settings" "")
; (gtk_accel_path "<Actions>/ThunarWindow/open-computer" "")
; (gtk_accel_path "<Actions>/ThunarWindow/view-menu" "")
; (gtk_accel_path "<Actions>/ThunarWindow/open-parent" "<Alt>Up")
; (gtk_accel_path "<Actions>/ThunarStandardView/properties" "<Alt>Return")
; (gtk_accel_path "<Actions>/ThunarLauncher/open-in-new-window" "<Primary><Shift>o")
; (gtk_accel_path "<Actions>/ThunarStandardView/back" "<Alt>Left")
; (gtk_accel_path "<Actions>/ThunarLauncher/trash-delete" "Delete")
; (gtk_accel_path "<Actions>/ThunarWindow/sendto-menu" "")
; (gtk_accel_path "<Actions>/ThunarWindow/reload-alt" "F5")
; (gtk_accel_path "<Actions>/ThunarWindow/zoom-out-alt" "<Primary>minus")
; (gtk_accel_path "<Actions>/ThunarStandardView/select-by-pattern" "<Primary>s")
; (gtk_accel_path "<Actions>/ThunarStandardView/rename" "F2")
; (gtk_accel_path "<Actions>/ThunarStandardView/create-document" "")
; (gtk_accel_path "<Actions>/ThunarShortcutsPane/sendto-shortcuts" "")
; (gtk_accel_path "<Actions>/ThunarStandardView/sort-by-type" "")
; (gtk_accel_path "<Actions>/ThunarWindow/close-tab" "<Primary>w")
; (gtk_accel_path "<Actions>/ThunarWindow/view-side-pane-tree" "<Primary>e")
(gtk_accel_path "<Actions>/ThunarActions/uca-action-1623198055590793-3" "<Primary><Shift>m")
; (gtk_accel_path "<Actions>/ThunarWindow/toggle-side-pane" "F9")
; (gtk_accel_path "<Actions>/ThunarWindow/open-home" "<Alt>Home")
; (gtk_accel_path "<Actions>/ThunarLauncher/execute" "")
; (gtk_accel_path "<Actions>/ThunarWindow/open-templates" "")
; (gtk_accel_path "<Actions>/ThunarWindow/open-location-alt" "<Alt>d")
; (gtk_accel_path "<Actions>/ThunarWindow/close-window" "<Primary>q")
; (gtk_accel_path "<Actions>/ThunarStandardView/duplicate" "")
; (gtk_accel_path "<Actions>/ThunarLauncher/cut" "<Primary>x")
; (gtk_accel_path "<Actions>/ThunarLauncher/sendto-desktop" "")
; (gtk_accel_path "<Actions>/ThunarWindow/zoom-in-alt2" "<Primary>equal")
; (gtk_accel_path "<Actions>/ThunarWindow/view-location-selector-toolbar" "")
; (gtk_accel_path "<Actions>/ThunarStandardView/select-all-files" "<Primary>a")
; (gtk_accel_path "<Actions>/ThunarLauncher/open-with-other" "")
; (gtk_accel_path "<Actions>/ThunarWindow/zoom-out" "<Primary>KP_Subtract")
; (gtk_accel_path "<Actions>/ThunarWindow/contents" "F1")
; (gtk_accel_path "<Actions>/ThunarWindow/view-side-pane-shortcuts" "<Primary>b")
; (gtk_accel_path "<Actions>/ThunarWindow/edit-menu" "")
; (gtk_accel_path "<Actions>/ThunarWindow/zoom-in-alt1" "<Primary>plus")
; (gtk_accel_path "<Actions>/ThunarWindow/preferences" "")
(gtk_accel_path "<Actions>/ThunarActions/uca-action-1623199341595037-4" "<Primary><Shift>r")
; (gtk_accel_path "<Actions>/ThunarWindow/switch-previous-tab" "<Primary>Page_Up")
; (gtk_accel_path "<Actions>/ThunarStandardView/sort-by-size" "")
; (gtk_accel_path "<Actions>/ThunarStandardView/create-folder" "<Primary><Shift>n")
; (gtk_accel_path "<Actions>/ThunarWindow/view-location-selector-menu" "")
; (gtk_accel_path "<Actions>/ThunarWindow/view-statusbar" "")
; (gtk_accel_path "<Actions>/ThunarWindow/close-all-windows" "<Primary><Shift>w")
; (gtk_accel_path "<Actions>/ThunarWindow/open-trash" "")
; (gtk_accel_path "<Actions>/ThunarLauncher/restore" "")
; (gtk_accel_path "<Actions>/ThunarWindow/open-desktop" "")
; (gtk_accel_path "<Actions>/ThunarStandardView/arrange-items-menu" "")
; (gtk_accel_path "<Actions>/ThunarWindow/open-location" "<Primary>l")
; (gtk_accel_path "<Actions>/ThunarWindow/new-window" "<Primary>n")
; (gtk_accel_path "<Actions>/ThunarWindow/view-menubar" "<Primary>m")
; (gtk_accel_path "<Actions>/ThunarWindow/zoom-reset-alt" "<Primary>0")
; (gtk_accel_path "<Actions>/ThunarWindow/view-as-detailed-list" "<Primary>2")
; (gtk_accel_path "<Actions>/ThunarWindow/view-as-icons" "<Primary>1")
(gtk_accel_path "<Actions>/ThunarActions/uca-action-1623196941650150-2" "<Primary><Shift>x")
; (gtk_accel_path "<Actions>/ThunarStandardView/forward" "<Alt>Right")
; (gtk_accel_path "<Actions>/ThunarLauncher/copy" "<Primary>c")
; (gtk_accel_path "<Actions>/ThunarWindow/file-menu" "")
; (gtk_accel_path "<Actions>/ThunarStandardView/make-link" "")
; (gtk_accel_path "<Actions>/ThunarStandardView/sort-descending" "")
; (gtk_accel_path "<Actions>/ThunarWindow/new-tab" "<Primary>t")
; (gtk_accel_path "<Actions>/ThunarWindow/go-menu" "")
; (gtk_accel_path "<Actions>/ThunarLauncher/trash-delete-2" "KP_Delete")
; (gtk_accel_path "<Actions>/ThunarStandardView/sort-by-mtime" "")
; (gtk_accel_path "<Actions>/ThunarWindow/view-location-selector-pathbar" "")
; (gtk_accel_path "<Actions>/ThunarWindow/show-hidden" "<Primary>h")
; (gtk_accel_path "<Actions>/ThunarStandardView/sort-by-name" "")
; (gtk_accel_path "<Actions>/ThunarWindow/zoom-reset" "<Primary>KP_0")
; (gtk_accel_path "<Actions>/ThunarLauncher/move-to-trash" "")
; (gtk_accel_path "<Actions>/ThunarWindow/detach-tab" "")

View file

@ -1,73 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<actions>
<action>
<icon>utilities-terminal</icon>
<name>Open Terminal</name>
<unique-id>1623021489374475-1</unique-id>
<command>_thunar-terminal &quot;%f&quot;</command>
<description></description>
<patterns>*</patterns>
<startup-notify/>
<directories/>
<audio-files/>
<image-files/>
<other-files/>
<text-files/>
<video-files/>
</action>
<action>
<icon>folder-copy</icon>
<name>Copy Path</name>
<unique-id>1623196889794306-1</unique-id>
<command>wl-copy %F</command>
<description></description>
<patterns>*</patterns>
<directories/>
<audio-files/>
<image-files/>
<other-files/>
<text-files/>
<video-files/>
</action>
<action>
<icon>edit-copy</icon>
<name>Copy Name</name>
<unique-id>1623196941650150-2</unique-id>
<command>wl-copy %N</command>
<description></description>
<patterns>*</patterns>
<directories/>
<audio-files/>
<image-files/>
<other-files/>
<text-files/>
<video-files/>
</action>
<action>
<icon>gimp</icon>
<name>Meme</name>
<unique-id>1623198055590793-3</unique-id>
<command>memegen --open -i %f</command>
<description></description>
<patterns>*</patterns>
<image-files/>
</action>
<action>
<icon>video</icon>
<name>Convert to mp4</name>
<unique-id>2623193055590793-3</unique-id>
<command>ffmpeg -i %f %f.mp4</command>
<description></description>
<patterns>*.mkv</patterns>
<video-files/>
</action>
<action>
<icon>com.github.peteruithoven.resizer</icon>
<name>Resize Image</name>
<unique-id>1623199341595037-4</unique-id>
<command>imgrs %f</command>
<description></description>
<patterns>*</patterns>
<image-files/>
</action>
</actions>

View file

@ -23,4 +23,10 @@
"**/.direnv/**" "**/.direnv/**"
], ],
"intelephense.format.braces": "k&r", "intelephense.format.braces": "k&r",
"continue.enableTabAutocomplete": true,
"intelephense.completion.fullyQualifyGlobalConstantsAndFunctions": true,
"diffEditor.renderSideBySide": false,
"diffEditor.hideUnchangedRegions.enabled": true,
"nix.formatterPath": "nixfmt",
"explorer.confirmDelete": false,
} }

View file

@ -1,246 +0,0 @@
{
config,
osConfig,
pkgs,
lib,
font,
...
}:
let
inherit (config.my)
key
theme
accent
font
;
inherit (theme) color;
in
{
config = {
programs.waybar = {
enable = true;
systemd.enable = true;
systemd.target = "sway-session.target";
settings = [
{
layer = "top";
modules-left = [
"sway/workspaces"
"sway/mode"
"sway/window"
];
modules-center = [ "clock" ];
modules-right = lib.flatten [
"sway/language"
"mpd"
"custom/playerctl"
"tray"
"custom/caffeine"
"pulseaudio"
(lib.optional (osConfig.services.vpn.enable or false) "custom/vpn")
"network"
"battery"
];
battery = {
tooltip = true;
states = {
full = 100;
good = 95;
warning = 25;
};
format = "{icon} ";
format-charging = "";
format-plugged = "";
format-full = "";
format-warning = "{icon} {time}";
format-icons = [
""
""
""
""
""
""
];
};
network = {
interval = 5;
tooltip = false;
on-click = "terminal -e iwd";
format-wifi = "{icon}";
format-icons = [
""
""
""
""
""
];
format-ethernet = "󰈀";
format-linked = "󰈀";
format-disconnected = "";
};
"sway/workspaces" = {
enable-bar-scroll = true;
format = "{icon}";
format-icons = {
"1" = "";
"2" = "";
"3" = "󰅩";
"4" = "";
"5" = "";
"6" = "";
"7" = "󰇮";
"8" = "";
"9" = "";
"10" = "";
urgent = "";
# focused = "";
default = "";
};
};
"sway/window" = {
max-length = 40;
};
"tray" = {
"spacing" = 7;
"icon-size" = 19;
};
clock = {
interval = 60;
format = "<b>{:L%H:%M %a %d/%m}</b>";
tooltip-format = "<tt><small>{calendar}</small></tt>";
calendar = {
mode = "year";
mode-mon-col = 3;
weeks-pos = "right";
on-scroll = 1;
on-click-right = "mode";
format = {
months = "<span color='${color.normal.magenta}'><b>{}</b></span>";
days = "<span color='${color.txt}'><b>{}</b></span>";
weeks = "<span color='${color.normal.cyan}'><b>W{}</b></span>";
weekdays = "<span color='${color.normal.yellow}'><b>{}</b></span>";
today = "<span color='${accent.color}'><b><u>{}</u></b></span>";
};
};
actions = {
on-click-right = "mode";
on-click-forward = "tz_up";
on-click-backward = "tz_down";
on-scroll-up = "shift_up";
on-scroll-down = "shift_down";
};
};
mpd =
let
mpc = "${pkgs.mpc-cli}/bin/mpc";
in
{
format = "{stateIcon} {title} - {artist}";
format-paused = "{stateIcon}";
format-stopped = "";
state-icons = {
paused = "";
playing = "";
};
tooltip = false;
on-click = "${mpc} toggle";
on-scroll-up = "${mpc} vol +10";
on-scroll-down = "${mpc} vol -10";
};
"custom/playerctl" = {
format = "{} ";
exec = "${pkgs.playerctl-status}/bin/playerctl-status";
on-click = "${pkgs.playerctl}/bin/playerctl --ignore-player=mpd play-pause";
interval = 1;
tooltip = false;
};
"sway/language" = {
format = "{short} {variant}";
};
"custom/caffeine" = {
format = "{}";
exec = "systemctl --user status swayidle > /dev/null && echo 󰒲 || echo 󰒳";
on-click = "${pkgs._sway_idle_toggle}/bin/_sway_idle_toggle";
interval = 1;
tooltip = false;
};
"custom/vpn" = lib.mkIf (osConfig.services.vpn.enable or false) {
format = "{}";
exec = ''
${pkgs.mullvad}/bin/mullvad status | ${pkgs.gnugrep}/bin/grep "^Connected" > /dev/null \
&& echo "" \
|| echo ""
'';
on-click = "mullvad connect";
on-click-right = "mullvad disconnect";
interval = 1;
tooltip = false;
};
pulseaudio = {
interval = 5;
tooltip = false;
scroll-step = 10;
format = "{icon}";
format-bluetooth = "";
format-bluetooth-muted = "󰝟";
format-muted = "󰝟";
format-icons = {
"rtp-sink" = [
"󰕿"
"󰖀"
"󰕾"
];
"alsa_output.usb-C-Media_Electronics_Inc._USB_Audio_Device-00.analog-stereo" = [
" 󰕿"
" 󰖀"
" 󰕾"
];
"alsa_output.pci-0000_09_00.4.analog-stereo" = [
" 󰕿"
" 󰖀"
" 󰕾"
];
headphone = [
" 󰕿"
" 󰖀"
" 󰕾"
];
handsfree = "";
headset = "";
phone = "";
portable = "";
car = "";
default = [
"󰕿"
"󰖀"
"󰕾"
];
};
on-click = "pavucontrol";
on-click-right = "${pkgs.pulse_sink}/bin/pulse_sink";
on-scroll-up = "${pkgs.volumesh}/bin/volumesh -i 10";
on-scroll-down = "${pkgs.volumesh}/bin/volumesh -d 10";
};
}
];
style = builtins.readFile (
pkgs.substituteAll {
src = ./style.css;
accent_color = accent.color;
color_bg = color.bg;
color_bg_dark = color.bg_dark;
color_bg_light = color.bg_light;
color_txt = color.txt;
font_interface = font.interface;
font_size_big = "${toString font.size.big}px";
font_size_medium = "${toString font.size.medium}px";
}
);
};
home.packages = with pkgs; [ waybar ];
};
}

View file

@ -1,102 +0,0 @@
* {
font: @font_size_medium@ @font_interface@, Font Awesome, Fira Code Nerd Font;
border-radius: 0;
margin: 0;
padding: 0;
transition-duration: 0;
}
window#waybar {
transition-duration: 0.5s;
/* TODO: background opacity */
background-color: @color_bg@;
border-bottom: 2px solid @color_bg_dark@;
}
window#waybar.solo {
background-color: @color_bg@;
}
#workspaces button {
color: @color_bg_light@;
min-width: 50px;
background-color: transparent;
border: 3px solid transparent;
}
#workspaces button.focused {
color: @color_txt@;
border-top: 3px solid @accent_color@;
}
#window {
color: @color_txt@;
margin: 0 4px;
}
#mode {
color: @accent_color@;
}
#mpd,
#custom-mpd,
#custom-playerctl,
#tray,
#clock,
#network,
#battery,
#backlight,
#bluetooth,
#pulseaudio,
#custom-vpn,
#custom-mail,
#custom-spigot,
#custom-updates,
#custom-weather,
#custom-unpushed,
#custom-transmissionD,
#custom-transmissionS,
#custom-delugeD,
#custom-delugeS,
#custom-caffeine {
margin: 0 7px;
color: @color_txt@;
opacity: 0.7;
}
#battery {
margin-right: 15px;
}
#clock,
#custom-weather {
font-size: @font_size_big@;
}
#custom-vpn {
margin: 0;
margin-right: 1px;
}
#network,
#custom-vpn,
#pulseaudio,
#custom-caffeine {
margin-top: -1px;
font-size: 17px;
}
#mpd,
#window,
#workspaces {
font-weight: normal;
}
#custom-unpushed,
#custom-recording {
min-width: 15px;
color: #ee4040;
}
#tray {
padding: 0;
margin: 0;
}
#language {
font-size: @font_size_medium@;
color: @color_bg_light@;
}
#custom-sleep {
color: @accent_color@;
font-size: @font_size_big@;
font-weight: bold;
}

View file

@ -1,68 +0,0 @@
{
config,
pkgs,
lib,
font,
...
}:
let
inherit (config.my)
key
accent
font
theme
;
inherit (theme) color;
in
{
config = {
programs.zathura.enable = true;
programs.zathura.options = {
font = "${font.mono} ${toString font.size.small}";
guioptions = "s";
selection-clipboard = "clipboard";
recolor = true;
# Turn images grayscale, so they don't look weird
recolor-keephue = false;
recolor-lightcolor = "rgba(0,0,0,0)";
recolor-darkcolor = color.txt;
default-bg = color.bg_dark;
inputbar-bg = color.bg_dark;
inputbar-fg = color.txt;
statusbar-bg = color.bg;
statusbar-fg = color.txt;
completion-bg = color.bg;
completion-fg = color.txt;
completion-group-bg = color.bg_dark;
completion-group-fg = color.txt;
completion-highlight-bg = accent.color;
completion-highlight-fg = accent.fg;
index-active-bg = accent.color;
index-active-fg = accent.fg;
};
programs.zathura.mappings = {
"<C-b>" = "toggle_statusbar";
${key.left} = "scroll left";
${key.down} = "scroll down";
${key.up} = "scroll up";
${key.right} = "scroll right";
"[index] ${key.left}" = "navigate_index collapse";
"[index] ${key.down}" = "navigate_index down";
"[index] ${key.up}" = "navigate_index up";
"[index] ${key.right}" = "navigate_index expand";
${lib.toUpper key.down} = "navigate next";
${lib.toUpper key.up} = "navigate previous";
${key.next} = "search forward";
${lib.toUpper key.next} = "search backward";
};
};
}