From 8911523e8339a30be4045003edcf7212feb7a15d Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 6 Jul 2025 06:59:32 +0200 Subject: [PATCH 01/14] alias/git,= --- sh/alias/git.sh | 122 ++++++++++++++++++++++++------------------------ sh/main.awk | 2 +- 2 files changed, 62 insertions(+), 62 deletions(-) diff --git a/sh/alias/git.sh b/sh/alias/git.sh index 4519028..9875f68 100644 --- a/sh/alias/git.sh +++ b/sh/alias/git.sh @@ -8,7 +8,7 @@ C %C(blue)%ci %cn %ce %B" # add to index -ga() { a__git_add "${@}"; } +#= ga a__git_add() { git \ add \ @@ -16,7 +16,7 @@ a__git_add() { } # add all to index -gaa() { a__git_add_all "${@}"; } +#= gaa a__git_add_all() { git \ add \ @@ -25,7 +25,7 @@ a__git_add_all() { } # add parts of all to index -gaap() { a__git_add_all_patch "${@}"; } +#= gaap a__git_add_all_patch() { git \ add \ @@ -35,7 +35,7 @@ a__git_add_all_patch() { } # add parts to index -gap() { a__git_add_patch "${@}"; } +#= gap a__git_add_patch() { git \ add \ @@ -44,7 +44,7 @@ a__git_add_patch() { } # create a branch -gb() { a__git_branch "${@}"; } +#= gb a__git_branch() { git \ branch \ @@ -52,7 +52,7 @@ a__git_branch() { } # delete a branch -gbd() { a__git_branch_delete "${@}"; } +#= gbd a__git_branch_delete() { git \ branch \ @@ -61,7 +61,7 @@ a__git_branch_delete() { } # force a branch deletion -gbdf() { a__git_branch_delete_force "${@}"; } +#= gbdf a__git_branch_delete_force() { git \ branch \ @@ -71,7 +71,7 @@ a__git_branch_delete_force() { } # list branches -gbl() { a__git_branch_list "${@}"; } +#= gbl a__git_branch_list() { git \ branch \ @@ -83,7 +83,7 @@ a__git_branch_list() { } # set the link to a remote branch from a local branch -gbsu() { a__git_branch_set_upstream "${@}"; } +#= gbsu a__git_branch_set_upstream() { git \ branch \ @@ -92,7 +92,7 @@ a__git_branch_set_upstream() { } # switch to a branch or checkout file(s) from a commit -gc() { a__git_checkout "${@}"; } +#= gc a__git_checkout() { git \ checkout \ @@ -100,7 +100,7 @@ a__git_checkout() { } # checkout an orphan branch -gco() { a__git_checkout_orphan "${@}"; } +#= gco a__git_checkout_orphan() { git \ checkout \ @@ -109,7 +109,7 @@ a__git_checkout_orphan() { } # pick a commit -gcp() { a__git_cherry_pick "${@}"; } +#= gcp a__git_cherry_pick() { git \ cherry-pick \ @@ -117,7 +117,7 @@ a__git_cherry_pick() { } # abort the commit pick -gcpa() { a__git_cherry_pick_abort "${@}"; } +#= gcpa a__git_cherry_pick_abort() { git \ cherry-pick \ @@ -126,7 +126,7 @@ a__git_cherry_pick_abort() { } # continue the commit pick -gcpc() { a__git_cherry_pick_continue "${@}"; } +#= gcpc a__git_cherry_pick_continue() { git \ cherry-pick \ @@ -135,7 +135,7 @@ a__git_cherry_pick_continue() { } # clean untracked files -gcf() { a__git_clean_force "${@}"; } +#= gcf a__git_clean_force() { git \ clean \ @@ -145,7 +145,7 @@ a__git_clean_force() { } # redo the last commit with a different message -gcam() { a__git_commit_amend_message "${@}"; } +#= gcam a__git_commit_amend_message() { git \ commit \ @@ -155,7 +155,7 @@ a__git_commit_amend_message() { } # make a root commit -gcem() { a__git_commit_empty_message "${@}"; } +#= gcem a__git_commit_empty_message() { git \ commit \ @@ -166,7 +166,7 @@ a__git_commit_empty_message() { } # commit the index -gcm() { a__git_commit_message "${@}"; } +#= gcm a__git_commit_message() { git \ commit \ @@ -175,7 +175,7 @@ a__git_commit_message() { } # configure the user email -gcue() { a__git_config_user_email "${@}"; } +#= gcue a__git_config_user_email() { git \ config \ @@ -184,7 +184,7 @@ a__git_config_user_email() { } # configure the user name -gcun() { a__git_config_user_name "${@}"; } +#= gcun a__git_config_user_name() { git \ config \ @@ -193,7 +193,7 @@ a__git_config_user_name() { } # differences from last or between commits -gd() { a__git_diff "${@}"; } +#= gd a__git_diff() { git \ diff \ @@ -201,7 +201,7 @@ a__git_diff() { } # display what is indexed in cache -gdc() { a__git_diff_cached "${@}"; } +#= gdc a__git_diff_cached() { git \ diff \ @@ -210,7 +210,7 @@ a__git_diff_cached() { } # indexed character-level differences -gdcw() { a__git_diff_cached_word "${@}"; } +#= gdcw a__git_diff_cached_word() { git \ diff \ @@ -220,7 +220,7 @@ a__git_diff_cached_word() { } # differences via external tool -gdt() { a__git_diff_tool "${@}"; } +#= gdt a__git_diff_tool() { git \ difftool \ @@ -229,7 +229,7 @@ a__git_diff_tool() { } # character-level differences -gdw() { a__git_diff_word "${@}"; } +#= gdw a__git_diff_word() { git \ diff \ @@ -238,7 +238,7 @@ a__git_diff_word() { } # fetch from the remote repository -gf() { a__git_fetch "${@}"; } +#= gf a__git_fetch() { rwx_gpg_agent_update && git \ @@ -249,7 +249,7 @@ a__git_fetch() { } # fetch from remote repository and prune local orphan branches -gfp() { a__git_fetch_prune "${@}"; } +#= gfp a__git_fetch_prune() { a__git_fetch \ --prune \ @@ -257,7 +257,7 @@ a__git_fetch_prune() { } # garbage collect all orphan commits -ggc() { a__git_garbage_collect "${@}"; } +#= ggc a__git_garbage_collect() { git \ reflog \ @@ -271,7 +271,7 @@ a__git_garbage_collect() { } # initialize a new repository -gi() { a__git_init "${@}"; } +#= gi a__git_init() { git \ init \ @@ -279,7 +279,7 @@ a__git_init() { } # initialize a new bare repository -gib() { a__git_init_bare "${@}"; } +#= gib a__git_init_bare() { git \ init \ @@ -288,7 +288,7 @@ a__git_init_bare() { } # log history -gl() { a__git_log "${@}"; } +#= gl a__git_log() { git \ log \ @@ -300,7 +300,7 @@ a__git_log() { } # log all history -gla() { a__git_log_all "${@}"; } +#= gla a__git_log_all() { a__git_log \ --all \ @@ -308,7 +308,7 @@ a__git_log_all() { } # log all history as oneline -glao() { a__git_log_all_oneline "${@}"; } +#= glao a__git_log_all_oneline() { a__git_log_all \ --oneline \ @@ -316,7 +316,7 @@ a__git_log_all_oneline() { } # log all history with patches -glap() { a__git_log_all_patch "${@}"; } +#= glap a__git_log_all_patch() { a__git_log \ --all \ @@ -325,7 +325,7 @@ a__git_log_all_patch() { } # log history as oneline -glo() { a__git_log_oneline "${@}"; } +#= glo a__git_log_oneline() { a__git_log \ --oneline \ @@ -333,7 +333,7 @@ a__git_log_oneline() { } # log history with patches -glp() { a__git_log_patch "${@}"; } +#= glp a__git_log_patch() { a__git_log \ --patch \ @@ -341,7 +341,7 @@ a__git_log_patch() { } # fast-forward merge to remote branch -gm() { a__git_merge "${@}"; } +#= gm a__git_merge() { git \ merge \ @@ -350,7 +350,7 @@ a__git_merge() { } # abort the current merge commit -gma() { a__git_merge_abort "${@}"; } +#= gma a__git_merge_abort() { git \ merge \ @@ -359,7 +359,7 @@ a__git_merge_abort() { } # do a merge commit -gmc() { a__git_merge_commit "${@}"; } +#= gmc a__git_merge_commit() { git \ merge \ @@ -369,7 +369,7 @@ a__git_merge_commit() { } # squash a branch and index its modifications -gms() { a__git_merge_squash "${@}"; } +#= gms a__git_merge_squash() { git \ merge \ @@ -378,7 +378,7 @@ a__git_merge_squash() { } # merge via external tool -gmt() { a__git_merge_tool "${@}"; } +#= gmt a__git_merge_tool() { git \ mergetool \ @@ -386,7 +386,7 @@ a__git_merge_tool() { } # push to the remote repository -gp() { a__git_push "${@}"; } +#= gp a__git_push() { rwx_gpg_agent_update && git \ @@ -397,7 +397,7 @@ a__git_push() { } # delete from the remote repository -gpd() { a__git_push_delete "${@}"; } +#= gpd a__git_push_delete() { git \ push \ @@ -406,7 +406,7 @@ a__git_push_delete() { } # force the push to the remote repository -gpf() { a__git_push_force "${@}"; } +#= gpf a__git_push_force() { a__git_push \ --force \ @@ -414,7 +414,7 @@ a__git_push_force() { } # rebase current branch onto another -grb() { a__git_re_base "${@}"; } +#= grb a__git_re_base() { git \ rebase \ @@ -422,7 +422,7 @@ a__git_re_base() { } # abort current rebase -grba() { a__git_re_base_abort "${@}"; } +#= grba a__git_re_base_abort() { git \ rebase \ @@ -431,7 +431,7 @@ a__git_re_base_abort() { } # continue current rebase -grbc() { a__git_re_base_continue "${@}"; } +#= grbc a__git_re_base_continue() { git \ rebase \ @@ -440,7 +440,7 @@ a__git_re_base_continue() { } # force rebase without fast-forward -grbf() { a__git_re_base_force "${@}"; } +#= grbf a__git_re_base_force() { git \ rebase \ @@ -449,7 +449,7 @@ a__git_re_base_force() { } # rebase interactively -grbi() { a__git_re_base_interactive "${@}"; } +#= grbi a__git_re_base_interactive() { git \ rebase \ @@ -458,7 +458,7 @@ a__git_re_base_interactive() { } # add a new remote repository -grma() { a__git_re_mote_add "${@}"; } +#= grma a__git_re_mote_add() { git \ remote \ @@ -467,7 +467,7 @@ a__git_re_mote_add() { } # list remote repositories -grml() { a__git_re_mote_list "${@}"; } +#= grml a__git_re_mote_list() { git \ remote \ @@ -476,7 +476,7 @@ a__git_re_mote_list() { } # set the location of a remote repository -grmsu() { a__git_re_mote_set_upstream "${@}"; } +#= grmsu a__git_re_mote_set_upstream() { git \ remote \ @@ -485,7 +485,7 @@ a__git_re_mote_set_upstream() { } # show connection to a remote repository -grms() { a__git_re_mote_show "${@}"; } +#= grms a__git_re_mote_show() { git \ remote \ @@ -494,7 +494,7 @@ a__git_re_mote_show() { } # remove and add removal to index -grm() { a__git_re_move "${@}"; } +#= grm a__git_re_move() { git \ rm \ @@ -502,7 +502,7 @@ a__git_re_move() { } # remove file(s) from index or move current branch pointer -grs() { a__git_re_set "${@}"; } +#= grs a__git_re_set() { git \ reset \ @@ -510,7 +510,7 @@ a__git_re_set() { } # wipe modifications or reset current branch to another commit -grsh() { a__git_re_set_hard "${@}"; } +#= grsh a__git_re_set_hard() { git \ reset \ @@ -519,7 +519,7 @@ a__git_re_set_hard() { } # current state of repository -gs() { a__git_status "${@}"; } +#= gs a__git_status() { git \ status \ @@ -528,7 +528,7 @@ a__git_status() { } # show a commit -#( gsc +#= gsc a__git_show_commit() { git \ show \ @@ -536,7 +536,7 @@ a__git_show_commit() { } # tag a commit -gt() { a__git_tag "${@}"; } +#= gt a__git_tag() { git \ tag \ @@ -544,7 +544,7 @@ a__git_tag() { } # delete a tag -gtd() { a__git_tag_delete "${@}"; } +#= gtd a__git_tag_delete() { git \ tag \ @@ -553,7 +553,7 @@ a__git_tag_delete() { } # update head ref -gurh() { a__git_update_ref_head "${@}"; } +#= gurh a__git_update_ref_head() { if [ -n "${2}" ]; then git \ diff --git a/sh/main.awk b/sh/main.awk index a64d8cd..2bcc4d5 100644 --- a/sh/main.awk +++ b/sh/main.awk @@ -27,7 +27,7 @@ BEGIN { RE_END = RE_SPACES "$" RE_FUNC = RE_SPACES "\\(" RE_SPACES "\\)" RE_SPACES "{" - RE_ALIAS = RE_BEGIN "#\\(" RE_SPACES RE_VAR RE_END + RE_ALIAS = RE_BEGIN "#=" RE_SPACES RE_VAR RE_END RE_CONSTANT = RE_BEGIN RE_CONST RE_SET RE_END RE_DOC = RE_BEGIN "#" RE_SPACE RE_ANY RE_END RE_FUNCTION = RE_BEGIN RE_VAR RE_FUNC RE_END From 5d93e311a894169946093956b79f9a27420d1677 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 6 Jul 2025 07:03:46 +0200 Subject: [PATCH 02/14] alias/overlay --- sh/alias/overlay.sh | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/sh/alias/overlay.sh b/sh/alias/overlay.sh index 6357655..cfba5dd 100644 --- a/sh/alias/overlay.sh +++ b/sh/alias/overlay.sh @@ -1,4 +1,6 @@ -obm() { a__overlay_bind_mount "${@}"; } +# overlay functions to manipulate squashfs manually + +#= obm a__overlay_bind_mount() { local directory for directory in "dev" "dev/pts" "proc" "sys"; do @@ -9,7 +11,7 @@ a__overlay_bind_mount() { done } -obu() { a__overlay_bind_unmount "${@}"; } +#= obu a__overlay_bind_unmount() { local directory for directory in "sys" "proc" "dev/pts" "dev"; do @@ -20,30 +22,30 @@ a__overlay_bind_unmount() { done } -ocr() { a__overlay_command_root "${@}"; } +#= ocr a__overlay_command_root() { chroot \ "overlay/mount" "${@}" } -ocu() { a__overlay_command_user "${@}"; } +#= ocu a__overlay_command_user() { chroot \ --userspec "1000:1000" \ "overlay/mount" "${@}" } -omm() { a__overlay_mirror_mount "${@}"; } +#= omm a__overlay_mirror_mount() { mount --make-rslave --rbind "/deb" "overlay/mount/deb" } -omu() { a__overlay_mirror_unmount "${@}"; } +#= omu a__overlay_mirror_unmount() { umount --recursive "overlay/mount/deb" } -orm() { a__overlay_root_mount "${@}"; } +#= orm a__overlay_root_mount() { local root="${1}" if [ -z "${root}" ]; then @@ -82,7 +84,7 @@ a__overlay_root_mount() { ) } -ors() { a__overlay_root_squash "${@}"; } +#= ors a__overlay_root_squash() { local directory="${1}" local file @@ -102,7 +104,7 @@ a__overlay_root_squash() { fi } -oru() { a__overlay_root_unmount "${@}"; } +#= oru a__overlay_root_unmount() { ( if ! cd "overlay"; then From de40382945e63369069bfe1866ecaa2a5fd51b5a Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 6 Jul 2025 07:05:55 +0200 Subject: [PATCH 03/14] alias/btrfs --- sh/alias/btrfs.sh | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/sh/alias/btrfs.sh b/sh/alias/btrfs.sh index 0e4ba62..b70f8aa 100644 --- a/sh/alias/btrfs.sh +++ b/sh/alias/btrfs.sh @@ -1,4 +1,6 @@ -bfdf() { a__btrfs_filesystem_d_f "${@}"; } +# functions to handle btrfs volumes + +#= bfdf a__btrfs_filesystem_d_f() { btrfs \ filesystem \ @@ -6,7 +8,7 @@ a__btrfs_filesystem_d_f() { "${@}" } -bfdu() { a__btrfs_filesystem_d_u "${@}"; } +#= bfdu a__btrfs_filesystem_d_u() { btrfs \ filesystem \ @@ -15,7 +17,7 @@ a__btrfs_filesystem_d_u() { "${@}" } -bfu() { a__btrfs_filesystem_usage "${@}"; } +#= bfu a__btrfs_filesystem_usage() { btrfs \ filesystem \ @@ -23,7 +25,7 @@ a__btrfs_filesystem_usage() { "${@}" } -bpg() { a__btrfs_property_get "${@}"; } +#= bpg a__btrfs_property_get() { btrfs \ property \ @@ -31,7 +33,7 @@ a__btrfs_property_get() { "${@}" } -bsc() { a__btrfs_subvolume_create "${@}"; } +#= bsc a__btrfs_subvolume_create() { btrfs \ subvolume \ @@ -39,7 +41,7 @@ a__btrfs_subvolume_create() { "${@}" } -bsd() { a__btrfs_subvolume_delete "${@}"; } +#= bsd a__btrfs_subvolume_delete() { btrfs \ subvolume \ @@ -47,7 +49,7 @@ a__btrfs_subvolume_delete() { "${@}" } -bsl() { a__btrfs_subvolume_list "${@}"; } +#= bsl a__btrfs_subvolume_list() { if [ -n "${1}" ]; then btrfs subvolume list "${1}" | @@ -56,7 +58,7 @@ a__btrfs_subvolume_list() { fi } -bss() { a__btrfs_subvolume_snapshot "${@}"; } +#= bss a__btrfs_subvolume_snapshot() { btrfs \ subvolume \ @@ -64,7 +66,7 @@ a__btrfs_subvolume_snapshot() { "${@}" } -bssr() { a__btrfs_subvolume_snapshot_r "${@}"; } +#= bssr a__btrfs_subvolume_snapshot_r() { btrfs \ subvolume \ From d4340a40047c05de16e229ebe040a6050b995d13 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 6 Jul 2025 07:08:19 +0200 Subject: [PATCH 04/14] alias/apt --- sh/alias/apt.sh | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/sh/alias/apt.sh b/sh/alias/apt.sh index 0f3294e..75723c8 100644 --- a/sh/alias/apt.sh +++ b/sh/alias/apt.sh @@ -1,5 +1,7 @@ +# functions handling apt + # show package information -acl() { a__apt_cache_list "${@}"; } +#= acl a__apt_cache_list() { apt-cache \ show \ @@ -7,7 +9,7 @@ a__apt_cache_list() { } # package versions policy -acp() { a__apt_cache_policy "${@}"; } +#= acp a__apt_cache_policy() { apt-cache \ policy \ @@ -15,23 +17,21 @@ a__apt_cache_policy() { } # search package -acs() { a__apt_cache_search "${@}"; } +#= acs a__apt_cache_search() { apt-cache \ search \ "${@}" } -# -agap() { a__apt_get_auto_purge "${@}"; } +#= agap a__apt_get_auto_purge() { apt-get \ autopurge \ "${@}" } -# -agar() { a__apt_get_auto_remove "${@}"; } +#= agar a__apt_get_auto_remove() { apt-get \ autoremove \ @@ -39,7 +39,7 @@ a__apt_get_auto_remove() { } # clean packages cache -agc() { a__apt_get_clean "${@}"; } +#= agc a__apt_get_clean() { apt-get \ clean \ @@ -47,7 +47,7 @@ a__apt_get_clean() { } # upgrade allowing package installation or removal -agfu() { a__apt_get_full_upgrade "${@}"; } +#= agfu a__apt_get_full_upgrade() { apt-get \ full-upgrade \ @@ -55,23 +55,21 @@ a__apt_get_full_upgrade() { } # install packages -agi() { a__apt_get_install "${@}"; } +#= agi a__apt_get_install() { apt-get \ install \ "${@}" } -# -agp() { a__apt_get_purge "${@}"; } +#= agp a__apt_get_purge() { apt-get \ purge \ "${@}" } -# -agr() { a__apt_get_remove "${@}"; } +#= agr a__apt_get_remove() { apt-get \ remove \ @@ -79,7 +77,7 @@ a__apt_get_remove() { } # update packages catalog -agud() { a__apt_get_up_date "${@}"; } +#= agud a__apt_get_up_date() { apt-get \ update \ @@ -87,7 +85,7 @@ a__apt_get_up_date() { } # upgrade forbidding package installation or removal -agug() { a__apt_get_up_grade "${@}"; } +#= agug a__apt_get_up_grade() { apt-get \ upgrade \ From 72b64d45709f0ceb4226d5529c648e68502c901b Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 6 Jul 2025 07:10:07 +0200 Subject: [PATCH 05/14] alias/tar --- sh/alias/tar.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sh/alias/tar.sh b/sh/alias/tar.sh index 92b8fbf..bf8e8be 100644 --- a/sh/alias/tar.sh +++ b/sh/alias/tar.sh @@ -1,4 +1,6 @@ -tc() { a__tar_create "${@}"; } +# functions to handle tar + +#= tc a__tar_create() { a__tar_verbose \ --create \ @@ -7,7 +9,7 @@ a__tar_create() { "${@}" } -tl() { a__tar_list "${@}"; } +#= tl a__tar_list() { a__tar_verbose \ --list \ @@ -15,14 +17,14 @@ a__tar_list() { "${@}" } -tv() { a__tar_verbose "${@}"; } +#= tv a__tar_verbose() { tar \ --verbose \ "${@}" } -tx() { a__tar_xtract "${@}"; } +#= tx a__tar_xtract() { a__tar_verbose \ --extract \ From 840a1747f97685ef4684e739400822fac51aa947 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 6 Jul 2025 07:12:46 +0200 Subject: [PATCH 06/14] alias/rsync --- sh/alias/rsync.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sh/alias/rsync.sh b/sh/alias/rsync.sh index bdbe4ed..49ad728 100644 --- a/sh/alias/rsync.sh +++ b/sh/alias/rsync.sh @@ -1,5 +1,7 @@ +# shortcuts for rsync + # synchronize -rs() { a__r_sync "${@}"; } +#= rs a__r_sync() { rsync \ --archive \ @@ -11,7 +13,7 @@ a__r_sync() { } # synchronize and delete after -rsda() { a__r_sync_delete_after "${@}"; } +#= rsda a__r_sync_delete_after() { a__r_sync \ --delete-after \ @@ -19,7 +21,7 @@ a__r_sync_delete_after() { } # synchronize and delete before -rsdb() { a__r_sync_delete_before "${@}"; } +#= rsdb a__r_sync_delete_before() { a__r_sync \ --delete-before \ From 4a89985362dacadc67f702488200abf682d64691 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 6 Jul 2025 07:17:11 +0200 Subject: [PATCH 07/14] alias/lsblk --- sh/alias/lsblk.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sh/alias/lsblk.sh b/sh/alias/lsblk.sh index 43dffc6..35e0c73 100644 --- a/sh/alias/lsblk.sh +++ b/sh/alias/lsblk.sh @@ -1,5 +1,7 @@ +# handle block devices + # list block devices -lb() { a__list_block "${@}"; } +#= lb a__list_block() { a__list_block_output \ "SIZE" \ @@ -11,7 +13,7 @@ a__list_block() { } # base arguments -lbne() { a__list_block_no_empty "${@}"; } +#= lbne a__list_block_no_empty() { lsblk \ --noempty \ @@ -19,7 +21,7 @@ a__list_block_no_empty() { } # output arguments -lbo() { a__list_block_output "${@}"; } +#= lbo a__list_block_output() { local argument local arguments="NAME" From 4154a6879024dc3721c5f7a92cf408262e43bc11 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 6 Jul 2025 07:19:58 +0200 Subject: [PATCH 08/14] alias/ls --- sh/alias/ls.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/sh/alias/ls.sh b/sh/alias/ls.sh index ad5a809..13f3663 100644 --- a/sh/alias/ls.sh +++ b/sh/alias/ls.sh @@ -1,9 +1,13 @@ +# list files + +# list colors +# * lighter blue for directories export LS_COLORS="\ di=0;94\ " # list current directory’s entries -l() { a__ls "${@}"; } +#= l a__ls() { ls \ --all \ @@ -15,7 +19,7 @@ a__ls() { } # list timestamps -lt() { a__ls_time "${@}"; } +#= lt a__ls_time() { a__ls \ --time-style "+%Y%m%d-%H%M%S%-:::z" \ @@ -23,7 +27,7 @@ a__ls_time() { } # list timestamps recent last -ltr() { a__ls_time_reverse "${@}"; } +#= ltr a__ls_time_reverse() { a__ls_time \ --reverse \ From 013e1a72ccae7796d8a7b2c0565fcc31e96fe3d7 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 6 Jul 2025 07:24:26 +0200 Subject: [PATCH 09/14] tmux/tm --- sh/alias/tmux.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sh/alias/tmux.sh b/sh/alias/tmux.sh index b30dc79..bac6cee 100644 --- a/sh/alias/tmux.sh +++ b/sh/alias/tmux.sh @@ -1,4 +1,6 @@ -tm() { a__t_mux "${@}"; } +# handle tmux + +#= tm a__t_mux() { tmux \ "${@}" From 2e4e827830e24bc9b5b598a856e5062af00ed449 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 6 Jul 2025 07:30:42 +0200 Subject: [PATCH 10/14] tmux/tml --- sh/tmux.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sh/tmux.sh b/sh/tmux.sh index 1301204..4bd7618 100644 --- a/sh/tmux.sh +++ b/sh/tmux.sh @@ -2,6 +2,12 @@ # │ tmux │ # ╰──────╯ +# list +#= tml +rwx_tmux_list() { + ls "/tmp/tmux-$(id --user)" +} + # ╭──────┬───────╮ # │ tmux │ setup │ # ╰──────┴───────╯ From 8a54f3a0d5e97f623d8b967d18d597c442ad6766 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 6 Jul 2025 07:32:06 +0200 Subject: [PATCH 11/14] tmux/tmk --- sh/tmux.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sh/tmux.sh b/sh/tmux.sh index 4bd7618..930ea42 100644 --- a/sh/tmux.sh +++ b/sh/tmux.sh @@ -2,6 +2,17 @@ # │ tmux │ # ╰──────╯ +# kill +#= tmk +rwx_tmux_kill() { + local server="${1}" + if [ "${server}" ]; then + tmux -L "${server}" kill-server 2>"/dev/null" + else + rwx_tmux_list + fi +} + # list #= tml rwx_tmux_list() { From f240158cc0ae1ba4b9a6e512977ffd2ac16175af Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 6 Jul 2025 07:32:55 +0200 Subject: [PATCH 12/14] tmux/tma --- sh/tmux.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sh/tmux.sh b/sh/tmux.sh index 930ea42..85a616f 100644 --- a/sh/tmux.sh +++ b/sh/tmux.sh @@ -2,6 +2,17 @@ # │ tmux │ # ╰──────╯ +# attach +#= tma +rwx_tmux_attach() { + local server="${1}" + if [ "${server}" ]; then + tmux -L "${server}" attach-session + else + rwx_tmux_list + fi +} + # kill #= tmk rwx_tmux_kill() { From 785b52f4b370b1a08e8d35fa32f5058c76f6547b Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 6 Jul 2025 07:46:41 +0200 Subject: [PATCH 13/14] =?UTF-8?q?=E2=88=92byobu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sh/alias/byobu.sh | 27 --------------------------- 1 file changed, 27 deletions(-) delete mode 100644 sh/alias/byobu.sh diff --git a/sh/alias/byobu.sh b/sh/alias/byobu.sh deleted file mode 100644 index 0f5336e..0000000 --- a/sh/alias/byobu.sh +++ /dev/null @@ -1,27 +0,0 @@ -bb() { a__byo_bu "${@}"; } -a__byo_bu() { - byobu \ - "${@}" -} - -bba() { a__byo_bu_attach "${@}"; } -a__byo_bu_attach() { - byobu \ - attach-session \ - "${@}" -} - -bbl() { a__byo_bu_ls "${@}"; } -a__byo_bu_ls() { - byobu \ - ls \ - "${@}" -} - -bbnd() { a__byo_bu_new_detach "${@}"; } -a__byo_bu_new_detach() { - byobu \ - new-session \ - -d \ - "${@}" -} From 49b9fbe8c3fdc7b3f93ff3e83a98c43805a0d607 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 6 Jul 2025 07:53:27 +0200 Subject: [PATCH 14/14] aliases --- sh/main.awk | 2 +- sh/main.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sh/main.awk b/sh/main.awk index 2bcc4d5..998644d 100644 --- a/sh/main.awk +++ b/sh/main.awk @@ -47,7 +47,7 @@ BEGIN { } else if (match($0, RE_FUNCTION, m)) { n = split(doc, array, "\n") for (i = 1; i<= n; i++) { - print array[i] "() { " m[1] " \"${@}\" ; }" + print array[i] " = " m[1] } reset() } else { diff --git a/sh/main.sh b/sh/main.sh index f2d7a7a..d26159a 100755 --- a/sh/main.sh +++ b/sh/main.sh @@ -189,7 +189,7 @@ rwx_parse_code() { local line RWX_ALIASES="$(rwx_parse_aliases)" while IFS= read -r line; do - eval "${line}" + eval "${line/ = /() { } \"\${@}\"; }" done <