Wednesday, March 16, 2016

Effectively Destroying the Gnome Screen Lock/Shield

I ran into an annoying problem with Gnome and GDM... the notorious screen lock/shield. Anyway, I seem to have fixed it with the following commands. Note that my goal was to get rid of the lock and many of the other techniques did not work.

gsettings set org.gnome.desktop.session idle-delay 4000000000

This effectively delays the screen lock for 126 years! Perfect.

Gentoo Commands

Below is a list of commands that I found I was often using during setup of the Gentoo Linux distro with brief descriptions of what they do. I will not always explain all the flags nor will the commands be in their most generic form. However, I will link to the full help files where appropriate. This list is largely for me, but I thought that the community might also find it helpful.

The backslash is used to indicate a multiline command as per Linux syntax.

Basic but useful for editing text without linewraps:
nano -w <file>

Obvious ping syntax for 3 calls.
ping -c 3 <website>

Checking out networks and taking them up/down
ifconfig <wifi name> [up/down]

Remove a package (lots of other emerge hints here).
emerge -aC <package>

Check status of package: R is it exists. U is update. N means new.
emerge -p <package>

Update system with new USE flags:
emerge --update --deep --newuse @world

Remove obsolete dependencies (good to check with -p flag first):
emerge --depclean

Reverse check dependencies:
revdep-rebuild

This is also good (and more powerful) for package status as described here.
equery --quiet l <package>

List of USE flags for package.
equery uses <package>

Start up wpa_supplicant in the background based on .conf file
wpa_supplicant -B -i<wifi name> \
-c/etc/wpa_supplicant/wpa_supplicant.conf

Basic .conf file should read:
ctrl_interface=/var/run/wpa_supplicant
network={
    ssid="<SSID>"
    psk="<passkey>"
}

But make sure that dhcpcd is up:
dhcpcd

Alternative wifi setup with dhclient and NetworkManager (nmcli website):
systemctl start NetworkManager
nmcli dev wifi connect <ssid> password <password>

A set of <type> actions (first is enable at boot):
systemctl enable <service>
systemctl stop <service>
systemctl start <service>
systemctl restart <service>
systemctl reload <service>
systemctl status <service>
systemctl disable <service>
systemctl is-active <service>
systemctl list-units --type service --all

Where the main types I'm interested in are devices, mounts, paths, and services. The rest are listed here.

Quick kernel update of the available sources.
genkernel --no-clean --menuconfig all

Useful folders and files:

USE, VIDEO_CARDS, DEVICE_INPUTS, etc.
/etc/portage/make.conf

Name of computer.
/etc/hostname

Grub file for boot parameters
/etc/default/grub

Wednesday, March 2, 2016

Steam on Gentoo

Following my last post where I set up the Gentoo kernel on my laptop, one of the next things to do was get the Steam client running on the system. I used this wiki page for the base setup and followed the manual approach after failing an attempt to use overlays (USE flag chaos ensued and I just restarted). Honestly, I thought the overlay was going to save me from having to copy over the dependency lists and it did not.

To save you, my fellow reader, from having to deal with that nonsense, I have added both updated files to my website. If you cd to each of the desired locations then call wget, you will scoop those files for free. The full code is:

mkdir /etc/portage/sets/
cd /etc/portage/sets/
wget http://www.theworldmatrix.ca/steam_set -O steam

cd /etc/portage/package.use/
wget http://www.theworldmatrix.ca/steam

I did both of these before emerge'ing using this call:

emerge -a @steam

Then update check:

emerge -a --changed-use --deep @world

Fetch the steam installer while logged into a user rather than root and then open it (this way it goes into /home I believe; keep in mind that the \ is a line continuation mark):

wget http://repo.steampowered.com/steam/ \
archive/precise/steam_latest.tar.gz
tar -xvzpf steam_latest.tar.gz

Now, when I followed the instructions from here I got all kinds of weird errors that varied depending on whether I was in root or in a user account. The first one had to do with the other tar file that was downloaded (bootstraplinux_ubuntu12_32.tar.xz). I fixed this by running make install from root in the steam directory. The user account then started to get errors stemming from /share/Steam/steam.sh (e.g., VERSION_ID: unbound variable) while the root account first complained about xterm (I updated the portage files that you downloaded to accommodate this change), then complained about a missing $DISPLAY variable. After scouring the docs, I realized that there seemed to be a conflict when xterm tried to boot the Xorg display server. So, knowing that Gnome booted the display server, I booted up Gnome and tried to run the steam code in an xterm window. It worked! The final command from within the steam folder in your home directory is:

./steam

And that is it. Enjoy!