Given the latest rights to my computer which Microsoft reserves for itself, I am very seriously considering making the switch to Linux. I have had some experience with the OS in the past. I used Ubuntu (pre-Unity), SimplyMepis (helped translate a bit of documentation, thought it was pretty great at the time), Linux Mint (endless trouble with sound drivers, should be ok now) and a few others I don't remember.

My current setup includes a pretty decent if not-brand-new desktop pc (I5 3570k, 12gigs of Ram, Gtx670, ssd) and a Thinkpad running an I5 2520, 4 gigs of ram and a ssd. The Desktop is running Win10 (working nicely) and the Thinkpad has Win7 on it.

There are a few issues which so far have prevented me from switching from my "just works" Windows setup. Let me make it clear: I like Linux. I really want to make it work for me.

1) Configuring certain stuff is hard. On my previous Thinkpad, the screen had a distinct yellow tint. I was able to correct this to an acceptable degree within seconds in Windows just by playing with some sliders in the driver software. Turns out, there are no such sliders in Linux. Several hours spent searching for alternative tools or procedures only produced semi-acceptable workarounds or arcane hints about how maybe possibly config file soandso might be treated with the arcane arts to provide a different color production.

Then there is my Thinkpad's trackpoint. Windows: Open settings, select trackpoint, move slider to set sensitivity. End.

This is the Thinkwiki page detailing how configuration of the trackpoint may be achieved on Linux. Several of the techniques detailed are marked as "soon to be deprecated" or already obsolete, which also goes for the graphical frontend which used to be available. Instead, I'm supposed to use Xinput (I think?!), except the page doesn't tell me about which values for sensitivity are actually accepted by that tool?/command?/magic?. I also don't have the slightest idea if the distribution I'm going to use (and I'm not sure which one that will be) actually uses that method or if it expects me to "just write a startup script" for a task like this. Apparently methods of configuring things also don't work anymore after a while, at which point I assume that stuff is going to break after an update. I am afraid about such an accident happening when I need my machine to work for actual... work.

I realize this isn't Linux's fault but crappy vendor support. I also realize that things just work different in Linuxland and that it's me who needs to learn exactly how they work. But the kind of effort which goes into changing my screen colors and trackpad speed in 2015 doesn't fill me with confidence.

2) Getting competent enough to actually fix stuff when it breaks feels comparable to learning a programming language (which, I'm sure, is in reality a huge exaggeration.) Taking my example from above, a typical command might look like this:

"xinput list

    sed -ne 's/^[^ ][^V].id=\([0-9]\)./\1/p'
while read id"

If I'm going to, in the spirit of linux, be my computer's master, simply copy/pasting of commands isn't going to cut it. So, ideally, I would like to eventually be able to know what tools to use, how they work together and what their parameters mean.

xinput list... sure, I get what that does. while read id... hm, not sure, but I'm sure i can look that up. But that middle part? 's/^[^ ][^V].id=\([0-9]\)./\1/p'? Really? I just have a really, really hard time imagining ever being able to know that 's/^[^ ] needs to go before .*/\1/p'. For all I know, it's a fancy way of telling my pc to rm -rf /.

3) Games. I used to be a huge gamer when I was younger. I don't play games often anymore, but leaving behind my favorites (which don't have a linux version and don't work with wine) still seems like something that might eventually convince me that I still need Wintendo in my life. But if I dual-boot, chances are that after a few hours of wrestling with some linux problem, booting into "shit just works"-OS might seem like an attractive idea. I'm speaking from experience, here.

I'm also having some trouble finding the right distribution. I'm torn between Elementary OS and Linux Mint at the moment, but of course there are countless alternatives out there. A distro for me should offer healthy repositories, an active community in case there's trouble and a track record of not releasing updates which break stuff. I assume that both my machines should be powerful enough to run almost everything which I could throw at them.

Well, anyways, can you guys maybe recommend a good starting point? Or, more importantly, explain to me how I should deal with those 3 issues I mentioned above?

empty:

IMO the best out-of-the-box linux setup is Ubuntu with Gnome 3. It has the GUI config tools you're looking for (or at least, it has more than other distros I've tried).

As for (2), it works like this: Configuration in linux is done primarily through human-readable text files. The same goes for how processes communicate with each other. One program will spit out a bunch of text, the next program will eat that text and spit out more text, etc. A human centipede of small programs is the unix way.

And yes, if you really want to be a power user, you will probably need to learn regular expressions, which are a mini-programming language used for manipulating text. That is what the `sed` command is doing in your example. It's like find-and-replace on steroids. Once you understand what each part means, it won't look so scary.

But you don't need to do that. The command is just an automated way of going through a big config file by hand and manually changing a whole bunch of entries.

First, know that `sed` means "stream editor". Here's your regex:

    s/^[^ ][^V].id=\([0-9]\)./\1/p

Let's break it down into parts. First, the top-level structure of a sed command:

    s/foo/bar/baz

The s means we're going to do a substitution. The foo is what we're searching for, and the bar is what we'll replace matches with. The baz on the end are options that affect other stuff, like case insensitivity or whether or not to do more than one substitution per line.

In your command, the foo part is

    ^[^ ][^V].id=\([0-9]\).

Let's break it down.

    ^

This first carat will match the beginning of a line.

    [^ ]
Brackets mean a character class. For example, [abc] would match one occurrence of any of those letters. If my regex was [abc]d, then it would match the strings "ad", "bd", "cd". But if the list of characters starts with ^, then the class is inverted. So [^ ] means "match one character which is anything but a space.".

    [^V]

Same as before, but now we're matching anything but a V.

    .id=

The . means "any character", and then id= is just taken literally.

    \([0-9]\)

This is the interesting part of the pattern. The \( and \) introduce a "capture group". Any substring matched in a capture group will be available in our replace pattern. This is very powerful for doing complex search-and-replace stuff. Inside the capture group we have another character class. This time it's 0-9, which means any character from 0 up to 9. So basically just the digits 0123456789.

    .

And then another arbitrary character.

Before we move on to the third section of the sed command, let's think about what our search pattern will match.

    Vaid=31
    Vbid=1p
    V.id=3.

I suspect that the author of your regex made a mistake, and wanted actual periods like in the third example.

Let's look at the last two sections.

    /\1/p

The replacement pattern is just \1. \1 refers to the capture group we talked about earlier, so this \1 means "take that number you found before, and replace the whole match with just that number".

    p

This is some option that has to do with printing the inputs or something, but I don't remember off the top of my head because I don't use it that much.

So, in total, the command means "Find stuff that looks like ' V.id=(some number).' and replace it with just that number." This sed command is consuming input from `xinput list`, so it's probably intended to grab the numeric ids of a bunch of devices from the plaintext output of `xinput list`.

Also I just realized that hubski's formatting probably obliterated some of the regex you posted. The markup tips mention a "verbatim" option.

Here's the output of `xinput list` on my machine:

  ⎡ Virtual core pointer                    	id=2	[master pointer  (3)]
  ⎜   ↳ Virtual core XTEST pointer              	id=4	[slave  pointer  (2)]
  ⎜   ↳ xquartz virtual pointer                 	id=6	[slave  pointer  (2)]
  ⎜   ↳ pen                                     	id=8	[slave  pointer  (2)]
  ⎜   ↳ cursor                                  	id=9	[slave  pointer  (2)]
  ⎜   ↳ eraser                                  	id=10	[slave  pointer  (2)]
  ⎣ Virtual core keyboard                   	id=3	[master keyboard (2)]
      ↳ Virtual core XTEST keyboard             	id=5	[slave  keyboard (3)]
      ↳ xquartz virtual keyboard                	id=7	[slave  keyboard (3)]
So yeah. We can see that there's a bunch of Virtual stuff with that uppercase V, and then later in the line, there's id=(some single digit).

posted 3190 days ago