diff --git a/home/.chezmoiexternal.toml.tmpl b/home/.chezmoiexternal.toml.tmpl index b811f8c..db6a72b 100644 --- a/home/.chezmoiexternal.toml.tmpl +++ b/home/.chezmoiexternal.toml.tmpl @@ -49,6 +49,12 @@ url = "https://github.com/tmux-plugins/tpm.git" refreshPeriod = "168h" +{{ $tmsuVersion := "0.7.5" -}} +[".local/bin/tmsu"] + type = "archive-file" + url = "https://github.com/oniony/TMSU/releases/download/v0.7.5/tmsu-x86_64-{{ $tmsuVersion }}.tgz" + path = bin/tmsu + [".zim/zimfw.zsh"] type = "file" url = "https://github.com/zimfw/zimfw/releases/latest/download/zimfw.zsh" diff --git a/home/dot_config/ranger/command.py b/home/dot_config/ranger/commands.py similarity index 91% rename from home/dot_config/ranger/command.py rename to home/dot_config/ranger/commands.py index d099ced..38108f6 100644 --- a/home/dot_config/ranger/command.py +++ b/home/dot_config/ranger/commands.py @@ -1,10 +1,10 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- -# File : command.py +# File : .config/ranger/commands.py # Author : Jeff LANCE # Date : 12.05.2021 -# Last Modified Date: 12.05.2021 -# Last Modified By : Jeff LANCE +# Last Modified Date: 08.03.2024 17:35:06 +# Last Modified By : Jeff Lance from ranger.api.commands import Command diff --git a/home/dot_config/ranger/plugins/.keep b/home/dot_config/ranger/plugins/.keep new file mode 100644 index 0000000..e69de29 diff --git a/home/dot_config/ranger/plugins/compress.py b/home/dot_config/ranger/plugins/compress.py deleted file mode 100644 index 8286ea8..0000000 --- a/home/dot_config/ranger/plugins/compress.py +++ /dev/null @@ -1,43 +0,0 @@ -import os -from ranger.api.commands import * -from ranger.core.loader import CommandLoader - -class compress(Command): - def execute(self): - """ Compress marked files to current directory """ - cwd = self.fm.thisdir - marked_files = cwd.get_selection() - - if not marked_files: - return - - def refresh(_): - cwd = self.fm.get_directory(original_path) - cwd.load_content() - - original_path = cwd.path - - # Parsing arguments line - parts = self.line.strip().split() - if len(parts) > 1: - au_flags = [' '.join(parts[1:])] - else: - au_flags = [os.path.basename(self.fm.thisdir.path) + '.zip'] - - # Making description line - files_num = len(marked_files) - files_num_str = str(files_num) + ' objects' if files_num > 1 else '1 object' - descr = "Compressing " + files_num_str + " -> " + os.path.basename(au_flags[0]) - - # Creating archive - obj = CommandLoader(args=['apack'] + au_flags + \ - [os.path.relpath(f.path, cwd.path) for f in marked_files], descr=descr, read=True) - - obj.signal_bind('after', refresh) - self.fm.loader.add(obj) - - def tab(self, tabnum): - """ Complete with current folder name """ - - extension = ['.zip', '.tar.gz', '.rar', '.7z'] - return ['compress ' + os.path.basename(self.fm.thisdir.path) + ext for ext in extension] diff --git a/home/dot_config/ranger/plugins/executable_devicons.py b/home/dot_config/ranger/plugins/executable_devicons.py deleted file mode 100644 index a698070..0000000 --- a/home/dot_config/ranger/plugins/executable_devicons.py +++ /dev/null @@ -1,322 +0,0 @@ -#!/usr/bin/python -# coding=UTF-8 -# These glyphs, and the mapping of file extensions to glyphs -# has been copied from the vimscript code that is present in -# https://github.com/ryanoasis/vim-devicons -import re; -import os; - -# all those glyphs will show as weird squares if you don't have the correct patched font -# My advice is to use NerdFonts which can be found here: -# https://github.com/ryanoasis/nerd-fonts -file_node_extensions = { - '7z' : '', - 'a' : '', - 'ai' : '', - 'apk' : '', - 'asm' : '', - 'asp' : '', - 'aup' : '', - 'avi' : '', - 'bat' : '', - 'bmp' : '', - 'bz2' : '', - 'c' : '', - 'c++' : '', - 'cab' : '', - 'cbr' : '', - 'cbz' : '', - 'cc' : '', - 'class' : '', - 'clj' : '', - 'cljc' : '', - 'cljs' : '', - 'cmake' : '', - 'coffee' : '', - 'conf' : '', - 'cp' : '', - 'cpio' : '', - 'cpp' : '', - 'cs' : '', - 'css' : '', - 'cue' : '', - 'cvs' : '', - 'cxx' : '', - 'd' : '', - 'dart' : '', - 'db' : '', - 'deb' : '', - 'diff' : '', - 'dll' : '', - 'doc' : '', - 'docx' : '', - 'dump' : '', - 'edn' : '', - 'efi' : '', - 'ejs' : '', - 'elf' : '', - 'elm' : '', - 'epub' : '', - 'erl' : '', - 'ex' : '', - 'exe' : '', - 'exs' : '', - 'eex' : '', - 'f#' : '', - 'fifo' : '|', - 'fish' : '', - 'flac' : '', - 'flv' : '', - 'fs' : '', - 'fsi' : '', - 'fsscript' : '', - 'fsx' : '', - 'gem' : '', - 'gif' : '', - 'go' : '', - 'gz' : '', - 'gzip' : '', - 'h' : '', - 'hbs' : '', - 'hrl' : '', - 'hs' : '', - 'htaccess' : '', - 'htpasswd' : '', - 'htm' : '', - 'html' : '', - 'ico' : '', - 'img' : '', - 'ini' : '', - 'iso' : '', - 'jar' : '', - 'java' : '', - 'jl' : '', - 'jpeg' : '', - 'jpg' : '', - 'js' : '', - 'json' : '', - 'jsx' : '', - 'key' : '', - 'less' : '', - 'lha' : '', - 'lhs' : '', - 'log' : '', - 'lua' : '', - 'lzh' : '', - 'lzma' : '', - 'm4a' : '', - 'm4v' : '', - 'markdown' : '', - 'md' : '', - 'mkv' : '', - 'ml' : 'λ', - 'mli' : 'λ', - 'mov' : '', - 'mp3' : '', - 'mp4' : '', - 'mpeg' : '', - 'mpg' : '', - 'msi' : '', - 'mustache' : '', - 'o' : '', - 'ogg' : '', - 'pdf' : '', - 'php' : '', - 'pl' : '', - 'pm' : '', - 'png' : '', - 'pub' : '', - 'ppt' : '', - 'pptx' : '', - 'psb' : '', - 'psd' : '', - 'py' : '', - 'pyc' : '', - 'pyd' : '', - 'pyo' : '', - 'rar' : '', - 'rb' : '', - 'rc' : '', - 'rlib' : '', - 'rom' : '', - 'rpm' : '', - 'rs' : '', - 'rss' : '', - 'rtf' : '', - 's' : '', - 'so' : '', - 'scala' : '', - 'scss' : '', - 'sh' : '', - 'slim' : '', - 'sln' : '', - 'sql' : '', - 'styl' : '', - 'suo' : '', - 't' : '', - 'tar' : '', - 'tgz' : '', - 'ts' : '', - 'twig' : '', - 'vim' : '', - 'vimrc' : '', - 'wav' : '', - 'webm' : '', - 'xbps' : '', - 'xhtml' : '', - 'xls' : '', - 'xlsx' : '', - 'xml' : '', - 'xul' : '', - 'xz' : '', - 'yaml' : '', - 'yml' : '', - 'zip' : '', -} - -dir_node_exact_matches = { -# English - '.git' : '', - 'Desktop' : '', - 'Documents' : '', - 'Downloads' : '', - 'Dotfiles' : '', - 'Dropbox' : '', - 'Music' : '', - 'Pictures' : '', - 'Public' : '', - 'Templates' : '', - 'Videos' : '', -# Spanish - 'Escritorio' : '', - 'Documentos' : '', - 'Descargas' : '', - 'Música' : '', - 'Imágenes' : '', - 'Público' : '', - 'Plantillas' : '', - 'Vídeos' : '', -# French - 'Bureau' : '', - 'Documents' : '', - 'Images' : '', - 'Musique' : '', - 'Publique' : '', - 'Téléchargements' : '', - 'Vidéos' : '', -# Portuguese - 'Documentos' : '', - 'Imagens' : '', - 'Modelos' : '', - 'Música' : '', - 'Público' : '', - 'Vídeos' : '', - 'Área de trabalho' : '', -# Italian - 'Documenti' : '', - 'Immagini' : '', - 'Modelli' : '', - 'Musica' : '', - 'Pubblici' : '', - 'Scaricati' : '', - 'Scrivania' : '', - 'Video' : '', -# German - 'Bilder' : '', - 'Dokumente' : '', - 'Musik' : '', - 'Schreibtisch' : '', - 'Vorlagen' : '', - 'Öffentlich' : '', -# Hungarian - 'Dokumentumok' : '', - 'Képek' : '', - 'Modelli' : '', - 'Zene' : '', - 'Letöltések' : '', - 'Számítógép' : '', - 'Videók' : '', -} - -file_node_exact_matches = { - '.Xauthority' : '', - '.Xdefaults' : '', - '.Xresources' : '', - '.bash_aliases' : '', - '.bashprofile' : '', - '.bash_profile' : '', - '.bash_logout' : '', - '.bash_history' : '', - '.bashrc' : '', - '.dmrc' : '', - '.DS_Store' : '', - '.fasd' : '', - '.fehbg' : '', - '.gitconfig' : '', - '.gitattributes' : '', - '.gitignore' : '', - '.inputrc' : '', - '.jack-settings' : '', - '.mime.types' : '', - '.nvidia-settings-rc' : '', - '.pam_environment' : '', - '.profile' : '', - '.recently-used' : '', - '.selected_editor' : '', - '.vim' : '', - '.vimrc' : '', - '.viminfo' : '', - '.xinitrc' : '', - '.xinputrc' : '', - 'config' : '', - 'Dockerfile' : '', - 'docker-compose.yml' : '', - 'dropbox' : '', - 'exact-match-case-sensitive-1.txt' : 'X1', - 'exact-match-case-sensitive-2' : 'X2', - 'favicon.ico' : '', - 'a.out' : '', - 'bspwmrc' : '', - 'sxhkdrc' : '', - 'Makefile' : '', - 'Makefile.in' : '', - 'Makefile.ac' : '', - 'config.mk' : '', - 'config.m4' : '', - 'config.ac' : '', - 'configure' : '', - 'Rakefile' : '', - 'gruntfile.coffee' : '', - 'gruntfile.js' : '', - 'gruntfile.ls' : '', - 'gulpfile.coffee' : '', - 'gulpfile.js' : '', - 'gulpfile.ls' : '', - 'ini' : '', - 'ledger' : '', - 'package.json' : '', - 'package-lock.json' : '', - '.ncmpcpp' : '', - 'playlists' : '', - 'known_hosts' : '', - 'authorized_keys' : '', - 'license' : '', - 'LICENSE.md' : '', - 'LICENSE' : '', - 'LICENSE.txt' : '', - 'mimeapps.list' : '', - 'node_modules' : '', - 'procfile' : '', - 'react.jsx' : '', - 'README.rst' : '', - 'README.md' : '', - 'README.markdown' : '', - 'README' : '', - 'README.txt' : '', - 'user-dirs.dirs' : '', - 'webpack.config.js' : '', -} - -def devicon(file): - if file.is_directory: return dir_node_exact_matches.get(file.relative_path, '') - return file_node_exact_matches.get(file.relative_path, file_node_extensions.get(file.extension, '')) diff --git a/home/dot_config/ranger/plugins/executable_devicons_linemode.py b/home/dot_config/ranger/plugins/executable_devicons_linemode.py deleted file mode 100644 index aeca62b..0000000 --- a/home/dot_config/ranger/plugins/executable_devicons_linemode.py +++ /dev/null @@ -1,19 +0,0 @@ -import ranger.api -from ranger.core.linemode import LinemodeBase -from .devicons import * - -@ranger.api.register_linemode -class DevIconsLinemode(LinemodeBase): - name = "devicons" - - uses_metadata = False - - def filetitle(self, file, metadata): - return devicon(file) + ' ' + file.relative_path - -@ranger.api.register_linemode -class DevIconsLinemodeFile(LinemodeBase): - name = "filename" - - def filetitle(self, file, metadata): - return devicon(file) + ' ' + file.relative_path diff --git a/home/dot_config/ranger/plugins/extract.py b/home/dot_config/ranger/plugins/extract.py deleted file mode 100644 index fc86a86..0000000 --- a/home/dot_config/ranger/plugins/extract.py +++ /dev/null @@ -1,85 +0,0 @@ -import os -from ranger.api.commands import * -from ranger.core.loader import CommandLoader - -class extract(Command): - def execute(self): - """Extract copied files to current directory or directory - specified in a command line - """ - - cwd = self.fm.thisdir - copied_files = cwd.get_selection() - - if not copied_files: - return - - def refresh(_): - cwd = self.fm.get_directory(original_path) - cwd.load_content() - - one_file = copied_files[0] - cwd = self.fm.thisdir - original_path = cwd.path - - line_args = self.line.split()[1:] - if line_args: - extraction_dir = os.path.join(cwd.path, "".join(line_args)) - os.makedirs(extraction_dir, exist_ok=True) - flags = ['-X', extraction_dir] - flags += ['-e'] - else: - flags = ['-X', cwd.path] - flags += ['-e'] - - self.fm.copy_buffer.clear() - self.fm.cut_buffer = False - - if len(copied_files) == 1: - descr = "Extracting: " + os.path.basename(one_file.path) - else: - descr = "Extracting files from: " + os.path.basename(one_file.dirname) - obj = CommandLoader(args=['aunpack'] + flags \ - + [f.path for f in copied_files], descr=descr, read=True) - - obj.signal_bind('after', refresh) - self.fm.loader.add(obj) - -class extract_to_dirs(Command): - def execute(self): - """ Extract copied files to a subdirectories """ - - cwd = self.fm.thisdir - original_path = cwd.path - copied_files = cwd.get_selection() - - if not copied_files: - return - - def refresh(_): - cwd = self.fm.get_directory(original_path) - cwd.load_content() - - def make_flags(fn): - fn_wo_ext = os.path.basename(os.path.splitext(fn)[0]) - flags = ['-X', fn_wo_ext] - return flags - - one_file = copied_files[0] - self.fm.copy_buffer.clear() - self.fm.cut_buffer = False - - # Making description line - if len(copied_files) == 1: - descr = "Extracting: " + os.path.basename(one_file.path) - else: - descr = "Extracting files from: " + os.path.basename(one_file.dirname) - - # Extracting files - for f in copied_files: - obj = CommandLoader( - args=['aunpack'] + make_flags(f.path) + [f.path], - descr=descr, read=True - ) - obj.signal_bind('after', refresh) - self.fm.loader.add(obj)