Network Manager and ethernet

Network Manager (or networkmanager) is a comfortable GUI app to switch between internet connections in Linux. The more recent versions of it seem to misbehave more and more, in my experience failing mainly with older Android modems. Here’s a workaround that may help.

The workaround requires dhcp as described at Manjarowiki, but the instructions are a bit different.

  1. Determine the devices: ls /sys/class/net This gives you normally three devices on computer to connect to internet: wifi, ethernet, and something called lo.
  2. Connect the Android phone, switch it to make modem, and see if it Network Manager fails. If it fails, move on to the next step.
  3. Determine the devices again: ls /sys/class/net This time it should list four devices. The fourth is your modem. It’s the one to go for with dhcp.
  4. As root, type dhcpcd enp* where enp* should be completed as your fourth device appeared in the previous step.
  5. Now there should be internet 🙂

The Manjarowiki instructions also include a step how to make the device permanent in systemd across reboots, but this is not feasible with mobile phone modem, as it sometimes gets differently assigned. The enp* identifier will be different, so it cannot be made permanent.

Review: Otter browser, weekly 46 release

Otter browser is a project to re-create Opera browser interface, as it stood during Presto era. (Nowadays Opera has moved on to the uninteresting Blink era and lost its unique interface.) 

Otter browser builds interface with Qt5 and renders with Webkit. The development has had a fast pace. The plans look moderately ambitious, i.e. achievable. In weekly 46 release, these Opera-like elements have been re-created:

  • Sidebar/Panel (currently featuring only History, Bookmarks, and Downloads)
  • Tray icon
  • Zoom slider
  • Paste-and-go (opens in same tab)
  • Pin tabs
  • Duplicate tab (called CloneTab)
  • Reopen closed tabs
  • Website Preferences and Quick Options (F12)
  • Save sessions
  • Private tabs and private sessions
  • Configure search engines
  • Set custom fonts, custom colours, and a custom stylesheet
  • Configurable keyboard shortcuts in INI file (has its glitches, not all shortcuts can be assigned)
  • Configurable menu bar items in JSON file
  • Easy switching between translations (you can translate your own language and thus contribute to the project)
  • Bookmarks import in Opera format (.adr) and HTML format. Opera bookmarks keywords get imported and assigned correctly
  • Keywords can be accessed with QuickBookmarkAccess dialogue just like in Opera with keyboard shortcut Shift+F2
  • Secondary address bar with keyboard shortcut F2
  • Rocker gestures (mouse buttons left+right to go forward in history, right+left to go back)
  • Some incremental Rewind and Fast Forward
  • Hint: take a look in about:config

The adress field is still not quite uptodate with suggestions et al., but at this stage I’d call Otter generally usable, particularly because of good cookie support. It’s usable as a general purpose browser, and it’s a joy to follow its development.

Most easily installable packages are available for Arch Linux and Windows. In other distros and opsyses you will have to hunt for Qt dependencies in order to get Otter installed.

Duplicate tab in DWB browser

DWB is a buttonless webkit browser with common-sense defaults. However, duplicate tab or clone tab function is missing out of the box.

Here’s how to create duplicate tab or clone tab for DWB browser. 

  1. Go to keyboard shotcuts manager. This is accessed by default with keys Sk or by open: dwb:keys.
  2. Scroll to the bottom of the page, to the text area Custom commands
  3. Enter: t:yank_primary;;tab_paste_primary

This will set t key as the shortcut for duplicate tab. If you need this key for something else, use some other key.

Usage case for duplicate tab

DWB intructions page at Archwiki offers a userscript to switch user stylesheets

#!/bin/bash # dwb:xg  CURRENT_STYLESHEET="$(dwbremote get setting user-stylesheet-uri)"  STYLESHEET_1="file://$HOME/.config/dwb/stylesheets/foo.css" STYLESHEET_2="file://$HOME/.config/dwb/stylesheets/bar.css"  if [[ "${CURRENT_STYLESHEET}" = ${STYLESHEET_1} ]]; then     dwbremote :local_set user-stylesheet-uri "$STYLESHEET_2" else      dwbremote :local_set user-stylesheet-uri "$STYLESHEET_1" fi

Set two stylesheets in position. Edit the file paths in the script accordingly. Save the script in ~/.config/dwb/userscripts/ and make it executable. Restart the browser. If everything went right, then xg keys will be switching between your two stylesheets.

The problem you will notice is that there’s no way back to the author-set stylesheets after you switched to user stylesheets. This is precisely where duplicate tab comes in handy. Duplicate tab will open up the same address in a new tab and reload author stylesheets.