{"id":18974482,"url":"https://github.com/m7a/lp-conf-cli","last_synced_at":"2026-04-08T15:30:18.733Z","repository":{"id":164554617,"uuid":"289578553","full_name":"m7a/lp-conf-cli","owner":"m7a","description":"MDVL Basic CLI Configuration Package aka ”dotfiles”","archived":false,"fork":false,"pushed_at":"2024-05-01T10:47:16.000Z","size":153,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-01T09:07:56.152Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/m7a.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-08-22T22:45:10.000Z","updated_at":"2024-05-01T10:47:19.000Z","dependencies_parsed_at":"2024-05-01T12:25:58.170Z","dependency_job_id":"7a1299d9-67d1-4c56-bc71-0a6262de1535","html_url":"https://github.com/m7a/lp-conf-cli","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m7a%2Flp-conf-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m7a%2Flp-conf-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m7a%2Flp-conf-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m7a%2Flp-conf-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/m7a","download_url":"https://codeload.github.com/m7a/lp-conf-cli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239972027,"owners_count":19727289,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T15:15:13.491Z","updated_at":"2026-04-08T15:30:18.659Z","avatar_url":"https://github.com/m7a.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\nsection: 32\nx-masysma-name: conf-cli\ntitle: MDVL Basic CLI Configuration Package\ndate: 2020/08/23 00:46:15\nlang: en-US\nauthor: [\"Linux-Fan, Ma_Sys.ma (Ma_Sys.ma@web.de)\"]\nkeywords: [\"mdvl\", \"conf\", \"dotfiles\", \"cli\", \"package\"]\nx-masysma-version: 1.0.2\nx-masysma-repository: https://www.github.com/m7a/lp-conf-cli\nx-masysma-website: https://masysma.net/32/conf-cli.xhtml\nx-masysma-owned: 1\nx-masysma-copyright: |\n  Copyright (c) 2020, 2021 Ma_Sys.ma.\n  For further info send an e-mail to Ma_Sys.ma@web.de.\n---\nDescription\n===========\n\nBuild instructions for package `mdvl-conf-cli`.\n\nThis package serves a similar purpose like a collection of dotfiles and\nincludes some alias-like scripts.\n\nTo build the package, invoke\n\n~~~\n$ ant package\n~~~\n\nIn addition to configuration files, some scripts which serve an alias-like\nfunction are provided. See the following sections for details.\n\nAlias-Scripts\n=============\n\nThe following scripts are part of this package:\n\n`ctrlc`\n:   Copies data from stdin to the clipboard using `xclip`.\n    They can be pasted in some GUI applications with [CTRL]-[V].\n`ctrlv`\n:   Pastes data from the clipboard to stdout using `xclip`.\n`ma_cpyurl`\n:   Special invocation of `ctrlc` which removes newlines from inputs and\n    mirrors it to stdout. This is useful for copying broken URLs from e-mails.\n`ma_xclock`\n:   Invokes `xclock` with digital time, `d.m.Y H:M:S` format and Terminus font.\n`materm`\n:   Invokes `urxvt` with sane defaults.\n`materm_white`\n:   Invokes `urxvt` with dark font on white background and extra-large font\n    size (useful for presentations or working in sunlight).\n`rsync_ma`\n:   Invokes `rsync` with useful parameters for synchronization:\n    `-vrlpEogDtS --delete --delete-after --stats -h --progress -i`\n`svg2pdf`\n:   Invokes [rsvg-convert(1)](https://manpages.debian.org/buster/librsvg2-bin/rsvg-convert.1.en.html)\n    from package `librsvg2-bin` to convert an SVG to PDF.\n\n`masysma_bashrc.sh` -- Ma_Sys.ma `.bashrc` configuration\n========================================================\n\nThe Ma_Sys.ma `.bashrc` is organized in multiple sections. They are explained\nin the following along with some excerpts from the actual code:\n\n## Run Syssheet\n\nThe first action is to invoke [syssheet(11)](../11/syssheet.xhtml) to display\nsystem information on newly started terminals or SSH sessions. It is started\nfirst and runs asynchronously because it is one of the slowest operations from\nthe bashrc to complete:\n\n~~~{.bash}\nexport LINES\nexport COLUMNS\nsheetpid=\nif [ -z \"$MAEM_RES\" ]; then\n        /usr/bin/syssheet -f \u0026 # Syssheet is slow =\u003e Parallelization is good\n        sheetpid=$!\nelse\n        sheetpid=-1\nfi\n~~~\n\nThe process ID is stored to later be able to cancel `syssheet` processes, should\nthey take too long to complete.\n\n## Basic Shell Settings\n\nConfigures the history and enables vi-style keybindings for commandline\nmodification.\n\n~~~{.bashrc}\nHISTCONTROL=ignoredups:ignorespace\nHISTSIZE=1000\nHISTFILESIZE=2000\nshopt -s histappend\nshopt -s checkwinsize\n\n# https://serverfault.com/questions/208265\nset +H\nset -o vi\n~~~\n\n## Configure Prompt\n\n~~~{.bash}\nma_host_tmp=\"$(who -m | cut -d \"(\" -f 2 | tr -d \")\" | cut -d \".\" -f 1)\"\nma_tty_tmp=\"$(echo $ma_host_tmp | cut -d \" \" -f 2 | cut -c -3)\"\nif [ -e /.dockerenv ] || { [ -x /usr/bin/ischroot ] \u0026\u0026 ischroot; }; then\n        # container\n        export PS1='\\[\\033[36;40;1m\\]\\H:\\w\\$\\[\\033]0;\\H:\\w\\$\\007\\033[00m\\] '\nelif [ -z \"$ma_host_tmp\" -o \"$ma_host_tmp\" = \":0\" -o \\\n                                        \"$ma_tty_tmp\" = \"tty\" ]; then\n        # local\n        export PS1='\\[\\033[33;40;1m\\]\\w\\$\\[\\033]0;\\w\\$\\007\\033[00m\\] '\nelse\n        # remote\n        export PS1='\\[\\033[31;40;1m\\]\\H:\\w\\$\\[\\033]0;\\H:\\w\\$\\007\\033[00m\\] '\nfi\n~~~\n\nHere, prompt colors are set depending on the environment. The color assignment\nis as follows:\n\nColor    Sample Prompt      Use\n-------  -----------------  --------------------------------\nyellow   `/$`               Local system login\nred      `hostname:~$`      Remote system login\ncyan     `3a009206af3e:/#`  Login inside container or chroot\n\nThe idea is to warn users with the red prompt that they are working on a remote\nsystem. Additionally, for remote and chroot/container logins, the hostname is\ndisplayed while it should be clear on the local system.\n\nNote that the heuristics to decide between local or remote connections fails\ninside terminal multiplexers.\n\n## Editors, PATH, Java\n\nThese sections are not shown here. Their use is as follows\n\n * Configure vi as the editor\n * Let `PATH` include `/usr/sbin`, because `ifconfig` and the like are also\n   useful to non-administrator users.\n * Set `JAVA_HOME`, `CLASSPATH` and prefer Java 8 over other installed versions\n   (for compatibility with Ma_Sys.ma programs).\n\n## Aliases\n\n~~~{.bash}\nalias ls=\"/bin/ls --color=auto -h\"\nalias grep=\"grep --color=auto\"\nalias info=\"/usr/bin/info --vi-keys\"\nalias maxima=\"/usr/bin/maxima -q\"\nalias sysus=\"systemctl --no-pager --user\"\nalias journalctl=\"journalctl --no-pager\"\nalias systemctl=\"systemctl --no-pager -l\"\nalias 7z_ma=\"/usr/bin/7z a -t7z -m0=lzma2 -mx=9 -mfb=64 -md=64m -ms=2g -l\"\nalias z_cmdcolors=colortest-16b\n~~~\n\n`ls` and `grep`\n:   Configure colorized output.\n`info`\n:   Configure vi keybindings.\n`maxima`\n:   Suppress version information and directly prompt for input.\n`sysus`\n:   Provide convenient access to user-sytemd\n`journalctl`, `systemctl`\n:   Disable systemd's insane default-to-pager\n    (see \u003chttps://bugzilla.redhat.com/show_bug.cgi?id=768601\u003e).\n`7z_ma`\n:   Provide quick access to better compression with 7z.\n`z_cmdcolors`\n:   Alternative name for `colortest-16b`. Previously, script\n    `colortools-system-gyw` was available under name `z_cmdcolors`. However,\n    its license seems to be unclear, thus MDVL systems will now invoke\n    `colortest-16b` from package `colortest` (which is in Debian).\n    See \u003chttps://github.com/pvinis/colortools\u003e for the source code for\n    `colortools-system-gyw` if interested.\n\n## MDVL Simple Login Manager\n\n~~~{.bash}\nif [ -z \"$DISPLAY\" -a -z \"$MAEMR_RES\" -a \"$(tty)\" = \"/dev/tty1\" -a \\\n                                                        \"$(id -u)\" != 0 ]; then\n        unset sheetpid\n        unset sleeppid\n        unset LINES\n        unset COLUMNS\n        # Prevent ck-launch blah to fail automounting when using startx...\n        export GDMSESSION=masysma\n        # invoke on the same VT to mitigate potential security issues\n        exec /usr/bin/startx -- vt1 2\u003e /dev/null \u003e /dev/null\nelif [ $sheetpid != -1 ]; then\n        ( sleep 3 \u0026\u0026 kill $sheetpid ) 2\u003e\u00261 \u003e /dev/null \u0026 sleeppid=$!\n        disown\n        wait $sheetpid\n        kill -s TERM $sleeppid 2\u003e /dev/null\n        echo\nfi\n~~~\n\nThis part of the configuration is concerned with auto-running `startx` if\nlogging into `tty1`. These few lines have been found to effectively replace the\nneed for login managers.\n\nFor all other instances, `syssheet` is given three seconds to complete before\nbeing killed; `syssheet` can hang if commands like `mount` take too long to\nrespond, but shell access should still be possible then, thus the timeout.\n\n`vimrc.mdvl` -- Ma_Sys.ma `vimrc` file\n======================================\n\nThere are tons of online-resources for `vimrc` files. This repository provides\nthe Ma_Sys.ma variant. Some excerpts are shown and explained in the following.\n\n## Basic settings and includes\n\nThe file sets the following basic options:\n\n~~~\nset nocompatible\nset backspace=indent,eol,start  \" more powerful backspacing\nset history=400                 \" keep 400 lines of command line history\nset ruler                       \" show the cursor position all the time\nset background=dark\n~~~\n\nAfter that, it contains a few lines to source other VIM configuration if it\nis present on the system including configuration for Ma_Sys.ma specific formats\nor `tetris.vim` :)\n\nA configuration snippet for hex editing is also included (copied from the\nVIM wiki?). After that, some more options follow -- including links to\ninteresting blog posts about `vimrc` files. The links seem to be down, thus\n`archive.org` links are given instead.\n\n~~~\nset printfont=courier:h9 \" Smaller printing font size\nset printoptions=formfeed:y,paper:a4\nset hlsearch\nhighlight Search ctermbg=LightGreen\nset title\nset showcmd\n\" Copied from http://dougblack.io/words/a-good-vimrc.html\n\" https://web.archive.org/web/20200202000014/https://dougblack.io/words/a-good-vimrc.html\nset wildmenu\nset lazyredraw\n\" Copied from http://amix.dk/vim/vimrc.html\n\" https://web.archive.org/web/20170222115910/http://amix.dk/vim/vimrc.html\nset noerrorbells\nset tm=500\nset ffs=unix,dos,mac\nset laststatus=2\n\" disable bells\nset vb t_vb=\n\" http://stackoverflow.com/questions/4775605/vim-syntax-highlight-improve-\n\"                                                                 performance\nset nocursorcolumn\nset nocursorline\n~~~\n\n## Colorcolumn\n\nIf available, the last column to be usable for keeping an 80-character limit is\nhighlighted:\n\n~~~\nif exists(\"+colorcolumn\")\n        set colorcolumn=80\n        hi ColorColumn ctermbg=DarkBlue\nendif\n~~~\n\nAlthough somewhat historic, 80 chars is still good to allow large font sizes\nwithout breaking the lines.\n\nIt is nice to remember that the `colorcolumn` can be used for e-mails as well,\njust type `:set colorcolumn=72` and it moves a little leftward to a common\nlimit used in e-mail.\n\n## Line Numbers\n\nThe configuration of line numbers is also taking the 80 chars width into\nconsideration: In case the terminal has 86 chars or less, `nonumber` will be\nset to avoid breaking the lines. The value for `nuberwidth=6` is based on\nexperience and works most of the times. By setting a different background color\nfor line numbers, they are visually well-distinguishable from the actual source\ncode.\n\nIn theory, displaying line numbers should also change as the window size\nchanges, but despite being a good heuristics, it does not always work as\nexpected...\n\n~~~\nset numberwidth=6\nset nonumber\nhighlight LineNr cterm=NONE ctermbg=DarkGray ctermfg=White\n\n\" http://stackoverflow.com/questions/13093289/gvim-dynamically-change-font-\n\"                                                         based-on-window-size\nfunction MaAutomaticLineNumbers()\n        if winwidth(0) \u003e 86\n                set number\n        else\n                set nonumber\n        endif\nendfunction\n~~~\n\nThe remainder of the file (not shown) is concerned with some GUI options to make\nterminal and `gvim` behave similarly (in case `gvim` is accidentally invoked).\n\n`vifmrc` -- File Manager Configuration\n======================================\n\nThe Ma_Sys.ma configuration for `vifmrc` changes the original two-pane logic\ntowards a slightly different model of use:\n\n * By setting `syncregs`, all `vifm` instances share the same set of registers\n   and it becomes possible to yank and paste seamlessly across multiple\n   instances.\n * Keyinbding `öw` for “new window” duplicates the current instance (i.e. starts\n   a new instance in the same directory)\n * All instances run on `:only` i.e. the normally two-pane file manager is\n   reduced to show only one pane.\n * Borders are reduced to a minimum such that even a tiny 41x11 terminal can\n   be used to browse directories and selet places to paste files to etc.\n\nCombining these features allows starting with a single instance and then opening\nand closing new instances as one continues the file management process. This\nvariant blends well with the quick startup time of vifm and the capabilities of\n(tiling) window managers to allow keeping track of many windows.\n\nUnlike two-pane workflows, there is no need to strictly have at most two panes\nat the same time -- three windows may be open and copying across all three can\nhappen as needed. Additionally, unlike tab-based workflows windows are only\nhidden if the window manager commands it. Bonus: Sometimes one wants to just\nquick and dirty switch to a different directory, be it for pasting or for\nchecking something different than the current work was about. In this case, the\nsecond pane of the originally two-pane file manager is still active (although\nhidden) and can be switched to at any time using the [TAB] key.\n\nTo summarize: A lot of flexiblity by using a probably uncommon configuration.\nSome excerpts with details of the configuration file follow:\n\n## General Settings\n\n~~~\nset sortnumbers\nset timefmt=%d.%m.%y\\ %H:%M:%S\nset wildmenu\nset hlsearch\nset scrolloff=4\nset sort=+fileext\nset tuioptions=p\nset confirm=permdelete\nset dotdirs=\nset iec\nset vifminfo=bookmarks,bmarks,registers\nset syncregs=syncregs\n\nif has('unix')\n        set trashdir=$HOME/ranger_trash\nendif\n~~~\n\nEnables some sane configuration defaults like date and time format, default\nsorting order, units to use, and configures a directory for deleted files\n`$HOME/ranger_trash`. The name is due to the fact that previously, Ma_Sys.ma\nsystems used\n[ranger(1)](https://manpages.debian.org/buster/ranger/ranger.1.en.html)\ninstead of vifm.\n\n## Colorscheme\n\n![Screeshot of an unmodified/default `vifm` configuration](conf-cli_att/scrvifmdefault.png)\n\n![Screeshot of the Ma_Sys.ma `vifm` configuration presented here](conf-cli_att/scrvifmtheme.png)\n\nThe Ma_Sys.ma colorscheme is configured by the following settings:\n\n~~~\nhighlight Border ctermbg=black\nhighlight StatusLine cterm=none ctermfg=white ctermbg=17\nhighlight TopLine cterm=none ctermfg=lightwhite ctermbg=17\nhighlight TopLineSel cterm=none ctermfg=lightwhite ctermbg=17\n~~~\n\nCheck the screenshots to see the difference between the default colorscheme and\nconfiguration vs. the changes by the Ma_Sys.ma `vifmrc`.\n\n## File Types\n\n~~~\nfiletype *.html,*.xhtml,*.xml,*.svg firefox %c 2\u003e\u00261 \u003e /dev/null \u0026\nfiletype *.xcf,*.dds gimp %c 2\u003e\u00261 \u003e /dev/null \u0026\nfiletype *.pcap,*.eth wireshark %c \u0026\nfiletype *.uxf umlet %c 2\u003e\u00261 \u003e /dev/null \u0026\nfiletype *.odf,*.odg,*.odx,*.doc,*.docx,*.doc,*.xls,*.xlsx,*.ppt,*.pptx,*.ods,*.odt libreoffice %c \u0026\nif has('unix')\n        filetype *.sc sc-im %c\n        filetype *.ppm,*.png,*.jpg,*.tiff,*.ico,*.gif,*.svg,*.xpm,*.jpeg,*.pnm,*.bmp,*.tga ma_plan_view_feh %c 2\u003e\u00261 \u003e /dev/null \u0026\n        filetype *.webm,*.mov,*.flv,*.3gp,*.ogv,*.mp4 /usr/bin/mpv %c 2\u003e\u00261 \u003e /dev/null \u0026\n        filetype *.mp3,*.wav,*.ogg /usr/bin/mocp %c\n        filetype *.rpm,*.gz,*.bz2,*.txz,*.tgz,*.bz2,*.7z,*.zip,*.tar,*.jar,*.rar,*.deb,*.iso,*.xz xarchiver %c 2\u003e\u00261 \u003e /dev/null \u0026\n        filetype *.pdf,*.ps,*.eps,*.pdf.gz zathura %c 2\u003e\u00261 \u003e /dev/null \u0026\nendif\n~~~\n\nConfigures typical MDVL applications to open files of various types. The first\npart of the definitions is intended to also work on Windows systems if the\nrespective applications are in `%PATH%`.\n\n## Custom Commands\n\n~~~\ncommand make !make\nif has('unix')\n        command thunar !thunar \u0026\n        command extract !atool -x %c \u0026\n        command mount !/usr/bin/mavifmext_reduced.sh mount\n        command umount !/usr/bin/mavifmext_reduced.sh umount %c\nendif\n~~~\n\nThe Ma_Sys.ma commands integrate shortcuts for `make`, `thunar` and archive\nextraction alongside with a link to a terminal user interface to `ma_mount`.\nSee [vifm-ext(32)](vifm-ext.xhtml) for details on `ma_mount`.\n\n## Custom Mappings\n\n~~~\nnmap ö0 :!tmux splitw -h -c %d vim\\ %f\u003ccr\u003e\nnmap ö1 :!materm -e vim %f \u0026\u003ccr\u003e\nnmap öc :!tmux new-window -c %d bash\u003ccr\u003e\nnmap öd :!materm -e dhex %f \u0026\u003ccr\u003e\nnmap öf :!tmux new-window -c %d vim\\ %f\u003ccr\u003e\nnmap öj :!jedit %f \u0026\u003ccr\u003e\nnmap öm :!mousepad %f \u0026\u003ccr\u003e\nnmap ön :!ma_new_file\u003ccr\u003e\nnmap öp :!plan_view.py \u0026\u003ccr\u003e\nnmap öq :!ma_plan_view_feh 2\u003e\u00261 \u003e /dev/null \u0026\u003ccr\u003e\nnmap öt :!materm \u0026\u003ccr\u003e\nnmap öv :!tmux splitw -h -c %d bash\u003ccr\u003e\nnmap öw :!materm -e /usr/bin/vifm \u0026\u003ccr\u003e\n~~~\n\nThe mappings provide quick access to various applications:\n\nApplications       Run on GUI  Run on tmux\n-----------------  ----------  -----------\nvim                ö1          ö0, öf\nTerminal           öt          öc, öv\nGUI Editors        öj, öm      --\ndhex (Hex Editor)  öd          --\nImage Viewers      öp, öq      --\n\nShortcut `öw` “duplicates” the current vifm instance to support the workflow\ndescribed in the introduction. `ön` integrates with `ma_new_file`,\nsee [templates(32)](templates.xhtml) for details\n\n`htoprc` -- Process Viewer Configuration\n========================================\n\nThe two major changes of the Ma_Sys.ma `htoprc` vs. the default configuraiton\nare as follows:\n\n 1. Threads are no longer displayed as indivdual entries.\n    This _greatly_ simplifies the list.\n 2. The initial view shows the process tree rather than table.\n\n![Default htop configuration](conf-cli_att/scrhtopdefault.png)\n\n![Htop configuration provided here](conf-cli_att/scrhtoprc.png)\n\nSystem-Wide Configuration\n=========================\n\n## Custom Login Screen\n\nFiles `90-masysma.conf` and `helpful_issue` customize the Linux console login\nscreen to look similar to the following screenshot:\n\n![Screenshot of the Linux console login as configured by this package](conf-cli_att/scrlogin.png)\n\n## Intel Virtualization\n\nFile `masysma-intel-virtualization.conf` enables nested virtualization for KVM\non Intel processors.\n\n## APT Progress Bar and Colors\n\nFile `99masysma.conf` enables colorized progress bars in all APT programs\n(most notably: `aptitude`).\n\n## SysRq\n\nAll SysRq features are enabled (file `masysma.conf`).\nCheck the\n[Kernel Documentation on SysRq](https://www.kernel.org/doc/html/latest/admin-guide/sysrq.html)\nfor details on what this is about.\n\nMiscellaneous application-specific Configuration\n================================================\n\n * `subversion` is configured to never store passwords by file `config.mdvl`\n * `/etc/papersize` is set to A4 by `papersize.mdvl`\n * Laptop lid closures are ignored by file `logind.conf.mdvl`\n * `smartmontools` daemon is enabled by file `smartmontools.mdvl`\n * `tmux` is configured to use vi-style keybindings by setting\n   `set-window-option -g mode-keys vi` in `tmux.conf`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm7a%2Flp-conf-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fm7a%2Flp-conf-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm7a%2Flp-conf-cli/lists"}