The One with the Thoughts of Frans

Mimic Windows Snap Hotkeys in Xfce

It’s quite simple. Open Settings → Window Manager → Keyboard. Then find the various “Tile window to the…” options. Finally, pick your desired keys.

You can’t make it function quite as smoothly as in Windows 10, but it certainly helps.

Of course you can also just drag the window against the side of the screen with the mouse. But sometimes the keyboard is faster.

CommentsTags: ,

MariaDB Fix “Can’t init tc log” Error

I messed up my automation of backups, meaning that after two years my entire VPS had secretly filled up. This lead to MariaDB being unable to initialize. After taking care of the root cause MariaDB still refused to start.

$ sudo tail -3 /var/log/mysql/error.log
2018-02-20 12:07:45 140649776292416 [Note] Recovering after a crash using tc.log
2018-02-20 12:07:45 140649776292416 [ERROR] Can't init tc log
2018-02-20 12:07:45 140649776292416 [ERROR] Aborting

Stupidly, just removing the zero byte `/var/lib/mysql/tc.log` file took care of the problem.

Comments (1)Tags:

Why Windows Is Better Than PulseAudio

Wait, what? You heard me. On Windows you can set sample rates per sound card. It looks like this.

Setting one soundcard to 24 bit, 96 kHz in Windows. Windows refers to this as “Studio Quality.”

In PulseAudio you’re limited to a primary and secondary sample rate. I’ve actually been using pasuspender more, also because its AC3 passthrough never seemed to work.

CommentsTags: ,

Adding “Search in Folder” to Thunar Custom Actions

Thunar is one of the best graphical file managers I’ve used, and I say that even while I own a Directory Opus license for Windows. I have some minor quibbles like very sparsely populated default actions on files and folders, but the biggest flaw is doubtless that the breadcrumb navigation doesn’t feature all of the regular folder interactions. In any case, in this blog post I intend to show how I improve on both Thunar and GNOME Search in one fell swoop.

I’ll start with a screenshot of the desired end result. You right click on a folder, and you’re presented with the option to search for files in it.

My context menu with Search for files.

In order to add this custom action, you’ll have to configure custom actions.

Edit → Configure custom actions.

Then you click + to add a new one, or you can edit an existing action.

Choose whether to add or edit a custom action.

You can type the name that will show up in the context menu, a little description for yourself, choose a fancy icon, and under appearance conditions you can choose whether this custom action applies to a specific type of files or folders. Unfortunately this dialog can’t be resized, but since you can copy and paste it’s not too bad.

gnome-search-tool --path=%f --contains=
The Edit Action dialog.

Finally, here is the result. Note that since I started gnome-search-tool with --contains=, the option to search for files containing specific text will show by default.

GNOME Search for Files (gnome-search-tool) with Contains the text expanded by default.

You can perform similar tricks with any of these other options.

$ gnome-search-tool --help
Usage:
  gnome-search-tool [OPTION...] - the GNOME Search Tool

Help Options:
  -h, --help                      Show help options
  --help-all                      Show all help options
  --help-gtk                      Show GTK+ Options
  --help-sm-client                Show session management options

Application Options:
  --version                       Show version of the application
  --named=STRING                  Set the text of "Name contains" search option
  --path=PATH                     Set the tet of "Look in folder" search option
  --sortby=VALUE                  Sort files by one of the following: name, folder, size, type, or date
  --descending                    Set sort order to descending, the default is ascending
  --start                         Automatically start a search
  --contains=STRING               Select and set the "Contains the text" search option
  --mtimeless=DAYS                Select and set the "Date modified less than" search option
  --mtimemore=DAYS                Select and set the "Date modified more than" search option
  --sizemore=KILOBYTES            Select and set the "Size at least" search option
  --sizeless=KILOBYTES            Select and set the "Size at most" search option
  --empty                         Select the "File is empty" search option
  --user=USER                     Select and set the "Owned by user" search option
  --group=GROUP                   Select and set the "Owned by group" search option
  --nouser                        Select the "Owner is unrecognized" search option
  --notnamed=STRING               Select and set the "Name does not contain" search option
  --regex=PATTERN                 Select and set the "Name matches regular expression" search option
  --hidden                        Select the "Show hidden and backup files" search option
  --follow                        Select the "Follow symbolic links" search option
  --mounts                        Select the "Exclude other filesystems" search option
  --display=DISPLAY               X display to use

Also see Finding Files on the Ubuntu wiki.

Comments (1)Tags: ,

Lossless Cut with ffmpeg

As another addendum to my notes on image optimization, here is how to cut a piece of audio or video as losslessly as possible with just ffmpeg on the commandline.

In this example we want the piece of audio from 1:30 to 2:00.

fmpeg -ss "1:30" -i audio-full.m4a -c copy -t "2:00" audio-cut.m4a

CommentsTags:

You Can Just Concatenate MPEG-2

To deal with the inferior FAT file system, it would seem that consumer-level Sony video cameras write video files of a maximum of about 2.1 GB. A sensible approach, but annoying to work with. Luckily they can be concatenated without any concerns or side effects for easier viewing and editing.

cat 00006.MTS 00007.MTS 00008.MTS > output.mts

For other video formats, see the ffmpeg FAQ.

CommentsTags:

Launcher with parameters in Xfce

Back in November I decided to try Aard 2 on my laptop. I followed the instructions and it worked. Then I created a launcher with the following command and suddenly it did not.

java -Dslobber.browse=true -jar ~/programs/aard2/aard2-web-0.7.jar ~/programs/aard2/slobs/*.slob

A different strategy, passing a command to Bash, did the trick.

bash -c "java -Dslobber.browse=true -jar ~/programs/aard2/aard2-web-0.7.jar ~/programs/aard2/slobs/*.slob"

Enjoy your fully functional launcher! 😉

CommentsTags: ,

Qalculate!, My New Favorite Calculator

Over the past few years I acquired a bad habit of using search engines for basic calculations and conversions. I’m not talking about the stuff you should just do in your head — not quite that bad, but about the fact that several Linux distros, including my favorite of Debian Xfce, don’t seem to ship with a calculator by default. So I finally got around to testing some programs and Qalculate! does all I want. You can install it on Debian using sudo apt install qalculate-gtk. There’s a list of features on the website. Enjoy a few screenshots.

Celsius to Fahrenheit.
Kilometer to mile.
Euro to Dollar.

I hope you’ll like it too!

CommentsTags: , ,

libGL error in Steam and Broken Age in Debian Stretch

After some update or other, Broken Age refused to start.

$ ./start.sh 
Running Broken Age
libGL error: unable to load driver: radeonsi_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: radeonsi
libGL error: unable to load driver: swrast_dri.so
libGL error: failed to load driver: swrast
X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  155 (GLX)
  Minor opcode of failed request:  3 (X_GLXCreateContext)
  Value in failed request:  0x0
  Serial number of failed request:  91
  Current serial number in output stream:  92

Oh well, let’s give it a little hand, shall we?

LD_PRELOAD='/usr/lib/i386-linux-gnu/libstdc++.so.6 /lib/i386-linux-gnu/libgpg-error.so.0' ./start.sh

This loads the included libraries before any others, in order to override the incompatible libraries shipped with the program in question. The same trick also works for Steam. If gaming is your goal, you should probably stick to whatever version of Ubuntu is supported best. I’m just pleased that I can play the occasional game like Oxenfree (no preloading required, mind you) or Broken Age on my workhorse without having to install any stability-reducing binary blobs.

Comments (2)Tags: ,

Fix No gksu(do) Permissions Prompt on Gparted, Synaptic, Mounting Drives, Etc. in Debian

I run Debian Stretch (testing) as my daily driver, and at some point I stopped being able to start programs like start Synaptic, Gparted, Synaptic etc. without manually typing gksu(do). The solution is as simple as it is seemingly unnecessary and stupid:

sudo apt install policykit-1-gnome

The problem is apparent upon reading the description:

This implementation was originally designed for GNOME 2, but most
GNOME-based desktop environments, including GNOME 3, GNOME Flashback,
MATE and Cinnamon, have their own built-in PolicyKit agents and no
longer use this one. The remaining users of this implementation
are XFCE and Unity.

Reported as Debian bug #843224. My first?


D’oh, I wrote this on November 5, 2016. I’ll still publish it anyway in case it’ll still help someone searching for a solution.

Comments (2)Tags: ,

« Newer EntriesOlder Entries »