My immediate reaction when I saw this was, “woah, really?”, “that’s crazy”, and, “I never thought I’d see this day”, and I wonder if it’s as jarring to other people who haven’t grown up with Microsoft being such a behemoth in the news and in their lives.
I think my dad might have joked once, “if I had bought shares in Microsoft when you were a kid, instead of your Speak n’ Spell, we’d both be retired by now.” I remember being horrified by the suggestion, too. “No, dad! Really? My Speak n’ Spell?”
Most people saw over the years that Microsoft’s success was less of a testament to their ability to innovate, but to engage in monopolistic business practices. And it was certainly effective: Microsoft was ubiquitous, and everyday people across the country fantasized about where they might be had they bought stock in MS while they could afford it.
Having grown up hearing about them choking the competition all my life is certainly one of many reasons seeing Arch Linux in the Microsoft store is really super shocking. 😳
What’s next, Microsoft open sourcing their technologies?
😳
Back in the late ’90s / early ‘2000s, when the internet was still relatively new, Friendster was a thing, and RedHat was the only distro I’d ever heard of by name, there was a palpable sense that nothing would ever disrupt the Windows/MacOS duopoly, or cause them to reexamine their ultra-competitive business models.
The closed-intellectual property business model of Microsoft (and even more rabidly authoritarian monopolistic single-hardware vendor to walled-garden ecosystem Apple) seemed like one constant that would change about as much as death or taxes. Nobody expected Microsoft would start to give up its iron grip on source code, or start to even publish and market its own services using a Linux Operating System. (Yes, I’m looking at you, Azure hosted Kubernetes)
Bill Gates was still CEO, and they’d just had a hugely consequential precedent-setting battle in the courtroom for breaking anti-trust laws.
Microsoft bought or suffocated any decent competition, and leveraged their market proliferation into monopolization wherever it could. They eventually lost their lawsuit after several years of defending their position to achieve defacto omnipotence. It was surprising to see such a large, powerful company actually lose in court, but many saw the loss as a testament to how many bad faith business practices MS had engaged in. You have to be pretty anti-competition in this day and age to get charged by the federal government.
With a reputation like they had at the time, Anyone who knew anything about Microsoft was convinced they’d be going the locked-down software-selling, IP hoarding route forever. And while they’re certainly not perfect, they’re certainly engaging in practices I’ve never expected from them. Not in a million years.
The Microsoft I remember would have attempted to make it harder to run other company’s software. They’d never dream of providing Kubernetes on Azure with Linux containers, they’d make them all run Windows at $149 a pop, and force everyone to keep a copy of “MS Azure Browser” on their desktop.
And while I applaud MS for not pushing the boundaries of price elasticity as much as most other megacorps these days (i.e. Windows is still “only” $149) Linux’s source code is distributed for free in a way everyone can examine, so it’s hard to see how they could use their previously archetypal hoard-and-license IP business strategy.
What’s going on here? Are things actually changing?
To be clear, I know this distribution of Arch Linux for WSL has nothing to do with Microsoft really, other than it’s packaged for their proprietary VM layer on their still-$149-a-license operating system. But how jarring it is for me personally to see Microsoft change in this manner is pretty hard to overstate. I know MS is still making boatloads of money, but it’s amazing that something, or someone, could shake up the paradigm of how Microsoft Makes Money so fundamentally. And whether that was their intention, or it is simplyan artifact, there’s one person I believe we can point to for this eventually occurring (albeit, over the course of about 30-40 years):
Richard Stallman is the creator of the GNU Public License. Seen here playing your friend’s hippy dad taking you both to a cookout, he is the original stalwart advocate for free software distribution.
Stallman and his brainchild, the GPL, have been making the case that developers (and software companies) shouldn’t just release their code so people can know what it’s doing, but if they adopt any code released under GPL they are essentially forced to. Many other types of free distribution licenses allow companies to eventually close their source code and hoard their IP. There are plenty of reasons to do that, like security, competition, and market share. And if I understand correctly, it was an essential reason companies like Nintendo and Apple chose BSD for their OS platforms instead of Linux.
This is not meant to be a bash against companies for being greedy, under capitalism it’s essentially their main job. But it’s possible to be altruistic and make money. I don’t have any empirical evidence to support this suggestion, but I imagine enough developers realized hoarding IP is a barrier to improving technology, and whether for altruism, concerns about long-term self-preservation, or because their program relies heavily on a gzip library, enough people have gotten onboard with open-sourcing technology that it’s even been championed by Microsoft.
I have to pause a second to take that in. Microsoft has been the poster child of IP hoarding since their inception in 1980. By no means was adopting a license that would require developers and software companies to release their source code a fait accompli, but I suppose enough developers understood how much more rapidly we would progress collectively if we all shared information about how to do things. And for the rest of us who don’t make a habit of examining questions of existential importance on a daily basis, we probably just fell into it by proximity and convenience.
But realistically speaking, it also gives me pause to think of how much progress me might not have made if it weren’t for the open source community (regardless of license). What might not have been. Where we’d still be today. If, by 2024, open sourcing hadn’t proliferated so profoundly, we wouldn’t still be searching Alta Vista, trying to make out HTML tables on our flip phones.
And I say this gratefully, and without any sense of irony, that, for one reason or another, we all have Richard Stallman to thank for releasing Arch Linux in the Microsoft Store. Thank you, Richard!
And also probably because of all the parents who had the presence of mind to buy their kids Speak n’ Spells.
How can grep clear the clutter obstructing our goals?
This is a little beginner command-line demonstration for finding the results you need most. A lot of the time in the command line, a simple ls can return way more than any one person can reasonably deal with. Most people know how to use ls with extension flags: ls *.sh ; ls -a ; ls -a .??* , but what about situations when file extensions aren’t relevant, or when doing other things?
For those who don’t already know, grep is your spectacularly special search superhero you can use to slice and dice strings in a smattering of situations – and here’s a few instructive ways it can be used to make life easier when looking for something.
Say I’m troubleshooting kernel-install. kernel-install is an intrinsic part of making sure kernels are installed properly, but on most (if not all) distros, it’s packaged with systemd, a fairly sprawling package with tentacles in virtually everything. How can we sift through the systemd package to narrow down what we’re looking for, so our search becomes less overwhelming?
Bash
❯pacman-Qlsystemd|wc-l1450
A quick analysis of the number of lines contained in the systemd package is 1,450 lines! That’s a lot of stuff to sort through in order to find a rather narrow section of it we need for our issue. That’s where some strategic use of the grep command can come in handy:
I usually start by thinking about what I don’t want in the results, since there’s almost always a lot more of what we don’t need than what we do need.
This filter with grep -v does the opposite of what grep does by default, and removes everything in a given search string. By using -E we can chain strings together, as if to instruct grepnot to return results with any of these values (note the single quotes and pipe character separators)
If we use grep to omit all zsh functions, bash-completions, man files, polkit definitions, and locale settings, that can get us a little closer, but it’s still only narrowed down by 577 results. systemd is a lengthy package, indeed.
From there, I realize we got lucky looking for kernel-install, since anything related to it is likely to have the word kernel in it. A quick addition of grep kernel as a subsequent filter on the end narrowed our search down to 17 results.
Now the list is fairly manageable. But what if we want it to be very accurate?
At this point, I’d go back to considering what not to include – in this case I know we don’t want any mount or socket files.
Are you noticing a pattern in these results, though? They include the files we’re looking for, related to kernel-install infrastructure, but also the folders. We know which folders they’re in through getting results for the files, so the folder locations are redundant:
This handy filter, grep -v '/$' should remove all the lines that end with a forward slash: / — and look, it ends up being only 5 related files:kernel-install, the binary, and the included .install scripts.
Since kernel is a fairly unique word, not often used in more than one context, it’s one of the easier ones to narrow down. We could have started by looking for the word kernel first:
Since we put grep kernel first, and did what was most obvious (filter out all the bare folder results), this search becomes admittedly less complicated. However, I thought it might be helpful to demonstrate a more narrow, selective reduction with search filters, since there are likely to be situations where one is looking for something more difficult to narrow down, and eliminating results might make more sense than immediately looking for keywords related to it.
E.g. all executable binaries and libexec files in the libvirt package:
This is a fairly good example, because how do you search for executables? Well, they don’t usually include a file extension, so that’s exactly what we filtered out with \. at the end (the dot needs to be escaped).
And, indeed, these are essentially all executable files, even the last one in /usr/share/doc (In the case of kernel-install, the .install files are executables, so it’s an awkward juxtaposition, but that’s not very common… I’m sure you get the idea…) A couple quick, last ones, along the same vein:
What .install or .sh scripts are included in dracut, sbctl, systemd and systemd-ukify – sorted in numeric order (which reflects the order of execution in most freedesktop.org software). There’s a little “flag-stacking” in that grep -ivE command, too.
Anyway, I hope this demo helps people. Feel free to leave comments or suggestions, especially if there’s anything you think I missed or left out. Thanks!
Quick little command line kung fu job with this parser called column
Bash
column-hUsage:column [options] [<file>...]Columnatelists.Options:-t,--tablecreateatable-n,--table-name<name>tablenameforJSONoutput-O,--table-order<columns>specifyorderofoutputcolumns-C,--table-column<properties>definecolumn-N,--table-columns<names>commaseparatedcolumnsnames-l,--table-columns-limit<num>maximalnumberofinputcolumns-E,--table-noextreme<columns>don't count long text from the columns to column width -d, --table-noheadings don'tprintheader-m,--table-maxoutfillallavailablespace-e,--table-header-repeatrepeatheaderforeachpage-H,--table-hide<columns>don't print the columns -R, --table-right <columns> right align text in these columns -T, --table-truncate <columns> truncate text in the columns when necessary -W, --table-wrap <columns> wrap text in the columns when necessary -L, --keep-empty-lines don'tignoreemptylines-J,--jsonuseJSONoutputformatfortable-r,--tree<column>columntousetree-likeoutputforthetable-i,--tree-id<column>lineIDtospecifychild-parentrelation-p,--tree-parent<column>parenttospecifychild-parentrelation-c,--output-width<width>widthofoutputinnumberofcharacters-o,--output-separator<string>columnsseparatorfortableoutput (default istwospaces)-s,--separator<string>possibletabledelimiters-x,--fillrowsfillrowsbeforecolumns-h,--helpdisplaythishelp-V,--versiondisplayversionFormoredetailsseecolumn(1).
It’s in the util-linux package, which, if I am remembering correctly, is included by default in basically any release outside of netboot and cloud images
this demonstrates why it’s included: It’s required by basically all of the setup infrastructure packages (makes sense). But I don’t really see column getting a lot of attention. Not sure why.
Here I used it to convert a list of installed flatpak containers to both JSON and YAML, using the column names from the flatpak’s output options (see flatpak list --help for available columns).
Start by making a list using the flatpak list --columns=$COLUMNS command:
Bash
# export comma-separated column headers, in desired orderexportCOLUMNS='name,application,version,branch,arch,origin,installation,ref'# make a list of flatpaks with these columnsflatpaklist--app--columns=$NAMES>all-flatpak-apps.list# verify the list was createdcatall-flatpak-apps.list# output (truncated):DeltaChatchat.delta.desktopv1.44.1stablex86_64flathubuserchat.delta.desktop/x86_64/stableTwilioAuthycom.authy.Authy2.5.0stablex86_64flathubusercom.authy.Authy/x86_64/stableDiscordcom.discordapp.Discord0.0.54stablex86_64flathubusercom.discordapp.Discord/x86_64/stableGitButlercom.gitbutler.gitbutler0.11.7stablex86_64flathubusercom.gitbutler.gitbutler/x86_64/stableDrawingcom.github.maoschanz.drawing1.0.2stablex86_64flathubusercom.github.maoschanz.drawing/x86_64/stableFlatsealcom.github.tchx84.Flatseal2.2.0stablex86_64flathubusercom.github.tchx84.Flatseal/x86_64/stableExtensionManagercom.mattjakeman.ExtensionManager0.5.1stablex86_64flathubusercom.mattjakeman.ExtensionManager/x86_64/stableYubicoAuthenticatorcom.yubico.yubioath7.0.0stablex86_64flathubusercom.yubico.yubioath/x86_64/stable...
It’s kinda hard to read like that, but I suppose if your font were small enough, or the terminal wide enough, the lines would stop wrapping and they’d be easier to read…
Then, take the list and convert it to json with a little column parsing:
Bash
# the flags are: # 1. create a table (-t), # 2. give it these headers (-N $comma,separated,headervals) # 3. limit it to the number we gave you (-l $integer)# 4. make it json! (-J)# 5. $INPUT_FILE > [$OUTPUT_FILE] column-t-d-N$NAMES-l8-Jall-flatpak-apps.list>flatpak-apps.json# column is a lot more forgiving of formatting than jq and yq
I haven’t had a lot of luck piping to column directly to make a parse-inception one-liner, which is why I am making two files (the flatpak.list and the .json file). I am sure there’s some people out there who could make this work, but I want to keep it on the less complicated side for demonstrative purposes, as well.
The output will be json format with the column parse by itself, but some of us like to pretty-print our json with jq , since the colors make it easier to read – especially when they’re not even pretty-printed:
And if you need yaml, the same thing works with yq:
Bash
# what NOT to do (if you want to be able to read it):column-t-d-N$NAMES-l8-Jall-flatpak-apps.list|yq{"table": [{"name":"Delta","application":"Chat","version":"chat.delta.desktop","branch":"v1.44.1","arch":"stable","origin":"x86_64","installation":"flathub","ref":"user\tchat.delta.desktop/x86_64/stable"},{"name":"Twilio","application":"Authy",...# sometimes yq requires being super-explicit:# yq flags are: # 1. input file type (-p type)# 2. output file type (-o type)# 3. pretty-print (-P) column-t-d-N$NAMES-l8-Jall-flatpak-apps.list|yq-pjson-oyaml-Ptable:-name:Deltaapplication:Chatversion:chat.delta.desktopbranch:v1.44.1arch:stableorigin:x86_64installation:flathubref:"user\tchat.delta.desktop/x86_64/stable"-name:Twilioapplication:Authyversion:com.authy.Authybranch:2.5.0arch:stableorigin:x86_64installation:flathubref:"user\tcom.authy.Authy/x86_64/stable"-name:Discordapplication:com.discordapp.Discordversion:0.0.54branch:stablearch:x86_64origin:flathubinstallation:userref:com.discordapp.Discord/x86_64/stable...
I’ve got the go-yq package, which has a much newer version of jq included with it, so if you’re seeing some differences in behavior or command-line arguments, that could be why – give it a shot if you’re having issues. (I do prefer the original jq, but I don’t really have a choice since it’s a dependency of devtools…
Bash
# not a huge fan of gojq-bin, but go-yq is awesome...❯pacman-Qigo-yqName:go-yqVersion:4.44.1-1Description:Portablecommand-lineYAMLprocessorArchitecture:x86_64URL:https://github.com/mikefarah/yqLicenses:MITGroups:NoneProvides:NoneDependsOn:glibcOptionalDeps:NoneRequiredBy:NoneOptionalFor:NoneConflictsWith:yqReplaces:NoneInstalledSize:9.58MiBPackager:DanielM.Capella<polyzen@archlinux.org>BuildDate:Sat11May202408:14:21PMPDTInstallDate:Sat11May202409:08:38PMPDTInstallReason:ExplicitlyinstalledInstallScript:NoValidatedBy:Signature
And don’t forget, column should be able to format basically any time of list with repeating columns. I guess that’s all for now, enjoy!
ok nevermind, just one more thing: This has nothing to do with column, necessarily, but it’s all the output you can get when you choose json as your output. I’ll have to do another post about this, but it’s tangentially related.
Look at the output from kubernetes kubectl get pods -A :
It’s nice that kubectl actually has a yaml output, since it’s a little easier to read than json, what with all the [{"punctuation": "on"},{"basically": "every}, {"word": true}], but most programs, if they even offer json, probably aren’t going to offer yaml – so to convert it, here’s the pipe string:
Bash
# adding `yq` colorizes output to `yaml` output, tookubectlgetpods-A-ojson|yq-pjson-oyaml-PapiVersion:v1items:-apiVersion:v1kind:Podmetadata:creationTimestamp:"2024-05-25T12:26:56Z"generateName:elasticsearch-coordinating-labels:app:coordinating-onlyapp.kubernetes.io/component:coordinating-onlyapp.kubernetes.io/instance:elasticsearchapp.kubernetes.io/managed-by:Helmapp.kubernetes.io/name:elasticsearchapp.kubernetes.io/version:8.13.4apps.kubernetes.io/pod-index:"0"controller-revision-hash:elasticsearch-coordinating-64759546bhelm.sh/chart:elasticsearch-21.1.0statefulset.kubernetes.io/pod-name:elasticsearch-coordinating-0name:elasticsearch-coordinating-0namespace:defaultownerReferences:-apiVersion:apps/v1blockOwnerDeletion:truecontroller:truekind:StatefulSetname:elasticsearch-coordinatinguid:e403f4a1-3058-4830-8f4e-25323fa68be5resourceVersion:"2737"uid:5c26ea5d-5ec7-40b1-946c-573651123552spec:affinity:{}automountServiceAccountToken:falsecontainers:-env:-name:MY_POD_NAMEvalueFrom:fieldRef:apiVersion:v1fieldPath:metadata.name-name:BITNAMI_DEBUGvalue:"false"-name:ELASTICSEARCH_CLUSTER_NAMEvalue:elastic-name:ELASTICSEARCH_IS_DEDICATED_NODEvalue:"yes"-name:ELASTICSEARCH_NODE_ROLES-name:ELASTICSEARCH_TRANSPORT_PORT_NUMBERvalue:"9300"-name:ELASTICSEARCH_HTTP_PORT_NUMBERvalue:"9200"-name:ELASTICSEARCH_CLUSTER_HOSTSvalue:elasticsearch-master-hl.default.svc.cluster.local,elasticsearch-coordinating-hl.default.svc.cluster.local,elasticsearch-data-hl.default.svc.cluster.local,elasticsearch-ingest-hl.default.svc.cluster.local,-name:ELASTICSEARCH_TOTAL_NODESvalue:"4"-name:ELASTICSEARCH_CLUSTER_MASTER_HOSTSvalue:elasticsearch-master-0elasticsearch-master-1-name:ELASTICSEARCH_MINIMUM_MASTER_NODESvalue:"2"-name:ELASTICSEARCH_ADVERTISED_HOSTNAMEvalue:$(MY_POD_NAME).elasticsearch-coordinating-hl.default.svc.cluster.local-name:ELASTICSEARCH_HEAP_SIZEvalue:128mimage:docker.io/bitnami/elasticsearch:8.13.4-debian-12-r0imagePullPolicy:IfNotPresentlivenessProbe:failureThreshold:5initialDelaySeconds:180periodSeconds:10successThreshold:1tcpSocket:port:rest-apitimeoutSeconds:5name:elasticsearchports:-containerPort:9200name:rest-apiprotocol:TCP-containerPort:9300name:transportprotocol:TCPreadinessProbe:exec:command:-/opt/bitnami/scripts/elasticsearch/healthcheck.shfailureThreshold:5initialDelaySeconds:90periodSeconds:10successThreshold:1timeoutSeconds:5resources:limits:cpu:750mephemeral-storage:1Gimemory:768Mirequests:cpu:500mephemeral-storage:50Mimemory:512MisecurityContext:allowPrivilegeEscalation:falsecapabilities:drop:-ALLprivileged:falsereadOnlyRootFilesystem:truerunAsGroup:1001runAsNonRoot:truerunAsUser:1001seLinuxOptions:{}seccompProfile:type: RuntimeDefaultterminationMessagePath:/dev/termination-logterminationMessagePolicy:FilevolumeMounts:-mountPath:/tmpname:empty-dirsubPath:tmp-dir-mountPath:/opt/bitnami/elasticsearch/configname:empty-dirsubPath:app-conf-dir...
It sure is nice to be able to read the stuff that comes out of the tools we’re using every day…
There’s always issues here or there trying to incorporate container apps with the desktop, due to their sandboxed nature and subsequent lack of out-of-the-box feature parity with their distro-packaged and supported counterparts.
This is not a post about how awesome Obsidian is, but if you haven’t heard of it, I recommend checking it out: https://obsidian.md/
Rather, it’s a response I just put on github issues for an obsidian CLI controller I have been using. It’s been pretty helpful, but the real gem is Obsidian itself, I just love it, right down to being able to export markmap files and having vim keymap settings.
I just switched to the flatpak version, though, because I noticed the package distributed through Arch’s extra repository was pulling electron on to my system as a dependency (I am trying to cordon nodejs off as much as possible to my adsf environment and away from my main system, because it’s caused the most intra-dependency issues out of any language I’ve dealt with, by far, but that’s too irritating to go into here).
run it with a lowercase %u which appears to be an error on both Linux package distributions I’ve tried so far
One might want to examine the wrapper included with the flatpak to see if there’s any other settings they want to incorporate for their setup if they are executing the binary directly. A lot of time these wrappers are outdated and/or unnecessary for their situation, but worth checking out: $HOME/.local/share/flatpak/app/md.obsidian.Obsidian/x86_64/stable/active/files/bin/obsidian.sh
#!/bin/shset-ouepipefailEXTRA_ARGS=()add_argument() {declare-i"$1"=${!1:-0}if [[ "${!1}"-eq1 ]]; thenEXTRA_ARGS+=(${@:2})fi}# Nvidia GPUs may need to disable GPU acceleration:# flatpak override --user --env=OBSIDIAN_DISABLE_GPU=1 md.obsidian.Obsidianadd_argumentOBSIDIAN_DISABLE_GPU--disable-gpuadd_argumentOBSIDIAN_ENABLE_AUTOSCROLL--enable-blink-features=MiddleClickAutoscroll# Wayland support can be optionally enabled like so:# flatpak override --user --socket=wayland md.obsidian.ObsidianWL_DISPLAY="${WAYLAND_DISPLAY:-"wayland-0"}"# Some compositors a real path a instead of a symlink for WAYLAND_DISPLAY:# https://github.com/flathub/md.obsidian.Obsidian/issues/284if [[ -e"${XDG_RUNTIME_DIR}/${WL_DISPLAY}"||-e"/${WL_DISPLAY}" ]]; thenecho"Debug: Enabling Wayland backend"EXTRA_ARGS+=(--ozone-platform-hint=auto--enable-features=WaylandWindowDecorations )if [[ -c /dev/nvidia0 ]]; thenecho"Debug: Detecting Nvidia GPU. disabling GPU sandbox."EXTRA_ARGS+=(--disable-gpu-sandbox )fifi# The cache files created by Electron and Mesa can become incompatible when there's an upgrade to# either and may cause Obsidian to launch with a blank screen:# https://github.com/flathub/md.obsidian.Obsidian/issues/214if [[ "${OBSIDIAN_CLEAN_CACHE}"-eq1 ]]; thenCACHE_DIRECTORIES=("${XDG_CONFIG_HOME}/obsidian/GPUCache" )forCACHE_DIRECTORYin"${CACHE_DIRECTORIES[@]}"; doif [[ -d"${CACHE_DIRECTORY}" ]]; thenecho"Deleting cache directory: ${CACHE_DIRECTORY}"rm-rf"${CACHE_DIRECTORY}"fidonefiecho"Debug: Will run Obsidian with the following arguments: ${EXTRA_ARGS[@]}"echo"Debug: Additionally, user gave: $@"exportFLATPAK_ID="${FLATPAK_ID:-md.obsidian.Obsidian}"exportTMPDIR="${XDG_RUNTIME_DIR}/app/${FLATPAK_ID}"# Discord RPCforiin {0..9}; dotest-S"$XDG_RUNTIME_DIR"/"discord-ipc-$i"||ln-sf{app/com.discordapp.Discord,"$XDG_RUNTIME_DIR"}/"discord-ipc-$i";donezypak-wrapper/app/obsidian$@ ${EXTRA_ARGS[@]}****
Hasn’t everybody deleted some stuff in the command line, wishing they had a way to get it back? Well, by default there are no do-overs. That’s where rmw comes in: rmw creates a trash can for your command line, so even after you delete some files (as long as you use it), you should be able to get them back within your specified period of time.
It’s a semi-compatible drop-in replacement for rm that should leave you feeling more at home than the alternatives – I checked out at least 7 of them, and this appeared to be the most developed and supported out of all the ones I tried. And while rmw doesn’t (yet) support viewing, deleting, and otherwise co-mingling files with your desktop trash, you can at least keep them all in the same place to avoid confusion.
For me, setup went something like this …
# Set your environment variables (ephemeral and persistent):$exportRMW_CONF_DIR="$HOME/.config/rmw"$echo'export RMW_CONF_DIR="$HOME/.config/rmw"'>>$HOME/.zshrc# or .bashrc# Create your configuration directory and go there:$mkdir-p$RMW_CONF_DIR$cd$RMW_CONF_DIR# now this is a little weird - rmwrc has to be $CONFIG/rmwrc, but it keepstwofilesforconfigurationin$RMW_CONF_DIR
Set up your config:
# auto-create the config with rmw:$rmw--config$RMW_CONF_DIR/rmwrc
The auto-created configuration has these defaults, but the Waste directory seemed a little redundant to me
$catrmwrc# rmw default waste directory, separate from the desktop trashWASTE=$HOME/.local/share/Waste# The directory used by the FreeDesktop.org Trash spec# Note to macOS and Windows users: moving files to 'Desktop' trash# doesn't work yet# WASTE=$HOME/.local/share/Trash# A folder can use the $UID variable.# See the README or man page for details about using the 'removable' attribute# WASTE=/mnt/flash/.Trash-$UID, removable# How many days should items be allowed to stay in the waste# directories before they are permanently deleted## use '0' to disable purging (can be overridden by using --purge=N_DAYS)#expire_age=0# purge is allowed to run without the '-f' option. If you'd rather# require the use of '-f', you may uncomment the line below.## force_required
So I switched the commenting to use the desktop trash location instead of the new one rmw uses by default:
# Change configuration to reflect freedesktop (gnome, etc.) default trash location:$sed-i's|# WASTE=$HOME/.local/share/Trash|WASTE=$HOME/.local/share/Trash|g'$RMW_CONF_DIR/rmwrc$sed-i's|WASTE = $HOME/.local/share/Waste|# WASTE = $HOME/.local/share/Waste|g'$RMW_CONF_DIR/rmwrc$cat$RMW_CONF_DIR/rmwrc# rmw default waste directory, separate from the desktop trash# WASTE = $HOME/.local/share/Waste# The directory used by the FreeDesktop.org Trash spec# Note to macOS and Windows users: moving files to 'Desktop' trash# doesn't work yetWASTE=$HOME/.local/share/Trash
Also, I’d like it to empty itself after a month so I can’t forget to do it myself:
# set 30 day retention policy:$sed-i's|expire_age = 0|expire_age = 30|g'$RMW_CONF_DIR/rmwrc$cat$RMW_CONF_DIR/rmwrc|grepexpire_ageexpire_age=30
Lastly, I’d like to try it out in place of rm for a while and see how it goes…