1
0
Fork 0
isopod.cool/blog/posts/guide_things_i_keep_having_to_google/index.html
2023-01-09 14:30:45 -07:00

71 lines
4.7 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Guide - Things I Keep Having to Google</title>
<link href="../../../style.css" rel="stylesheet" type="text/css" media="all">
<style type="text/css">
/*h1 {
background-image: url('wireguard_logo.png');
}
summary > * {
margin-bottom: 0;
display: inline-block;
}
details[open] > summary h6 {
display: none;
}*/
td {
padding: .2rem;
}
td h4 {
margin: 0;
}
</style>
</head>
<body>
<h1>guide:</h1>
<h2 id="caption">Things I Keep Having to Google</h2>
<nav>
<a href="../../../">home</a>
<a href="../../">blog</a>
</nav>
<p>This isn't really a guide to anything in particular, I just wanted an easily accessible reference for all the things I'm sick of wading through google results for, or otherwise seem to need help remembering. I've put it here in case someone else might find this helpful. I'll likely be adding to this as I find myself repeatedly googling things.</p>
<h2>Binding things to just the Super key in KDE</h2>
<ol>
<li>Bind it to some other keyboard shortcut using KDE's typical GUI methods. Any shortcut will do.</li>
<li>Find the entry for it in <code>~/.config/khotkeysrc</code>. There should be a line that looks like: <code>Uuid=<u>{77575b17-36d6-4b4e-b01f-2f1156e38583}</u></code>. Copy the contents of that line, specifically everything I have underlined there.</li>
<li>Run the following commands:</li>
</ol>
<code>$ kwriteconfig5 --file ~/.config/kwinrc --group ModifierOnlyShortcuts --key Meta "org.kde.kglobalaccel,/component/khotkeys,org.kde.kglobalaccel.Component,invokeShortcut,&lt;YOUR UUID HERE&gt;"<br>$ qdbus org.kde.KWin /KWin reconfigure</code>
<h2>Linux command line/Bash stuff</h2>
<table>
<tr><td colspan="2"><h4>pipeline</h4></td></tr>
<tr><td><code>command | command2</code></td><td>uses the output of one command as the input to the next</td></tr>
<tr><td><code>command > file</code></td><td>saves the output of a command to a file</td></tr>
<tr><td><code>command < file</code></td><td>uses a file as the input to a command</td></tr>
<tr><td><code>command < fileA > fileB</code></td><td>will therefore run <code>command</code> with the contents of <code>fileA</code> as the input, and save the output to <code>fileB</code></td></tr>
<tr><td nowrap><code>command <<< "string or $variable"</code></td><td>will use the string or variable as the input to a command, the same as <code>&nbsp;< file</code></td></tr>
<tr><td colspan="2"><h4>variables</h4></td></tr>
<tr><td><code>variable=value</code></td><td>assigns a variable</td></tr>
<tr><td><code>$variable</code></td><td>references it</td></tr>
<tr><td><code>$(command)</code></td><td>lets you treat the output of a command like a variable reference</td></tr>
<tr><td><code>$((number+variable))</code></td><td>does the same thing for integer math expressions.</td></tr>
<tr><td><code>$((&nbsp;$(command)&nbsp;))<br>$((&nbsp;variable&nbsp;))</code></td><td>This can also just convert strings into integers.</td></tr>
<tr><td><code>"te$(command)xt"<br>"as$((math))df"</code></td><td>Both can be inserted into strings.</td></tr>
<tr><td><code>"some&nbsp;$variable&nbsp;text"<br>"more${variable}text"</code></td><td>Both of these are valid ways to insert a variable into a string.</td></tr>
<tr><td colspan="2"><h4>grep</h4></td></tr>
<tr><td><code>-v</code></td><td>inverts it, so matches are excluded</td></tr>
<tr><td><code>-E "/regex/"</code></td><td>lets you use regex</td></tr>
<tr><td colspan="2"><h4>cut</h4></td></tr>
<tr><td><code>-d 'string'</code></td><td>determines the delimiter string</td></tr>
<tr><td><code>-f n</code></td><td>specifies a field to output, delimited by <code>-d</code></td></tr>
<tr><td><code>sed 's/ */ /g' | cut -d ' '</code></td><td>Piping your thing through this <span title="It's not foolproof, though. Make sure you understand what this is doing so you can adapt it if it breaks.">helps</span> with parsing a lot of Linux commands that output tabular data</td></tr>
<tr><td colspan="2"><h4>xrandr</h4></td></tr>
<tr><td><code>xrandr --output &lt;display name&gt; --brightness &lt;brightness&gt;</code></td><td title="It would definitely for sure be better to change this via the monitor's built-in menus, but that requires navigating both of my monitors' built-in menus.">Janky software-side display brightness setting</td></tr>
</table>
<h2>HTML/CSS stuff</h2>
<p>Force a <code>&lt;td&gt;</code> element not to wrap by adding the <code>nowrap</code> attribute to it.</p>
</body>
</html>