Install Microsoft Fonts with Play on Linux

Refer: https://gist.github.com/ibrahimtuzlak0295/2a66981f99f25e08cb2039df53391b05

The Play on Linux Way

Normally the Microsoft Core Fonts can be installed like this:

  • Click Configure
  • Select the prefix where you want the fonts installed
  • Tab Install components
  • Select Microsoft Core Fonts from the list and click Install

Manually

However, if for some reason this doesn't install the fonts, it's still possible to do that manually. First install the ttf-mscorefonts-installer package:

sudo apt install ttf-mscorefonts-installer

Note the prefix name: ls ~/.PlayOnLinux/wineprefix

And replace yourprefix in the command with the one you want:

cp /usr/share/fonts/truetype/msttcorefonts/* ~/.PlayOnLinux/wineprefix/yourprefix/drive_c/windows/Fonts

Now we have the core fonts in place. We can remove the package:

sudo apt purge ttf-mscorefonts-installer

Upgrade to Ubuntu 20.04

There are issues using a GUI to upgrade, sometimes you cannot get to an acceptance button or the like. It's better to just upgrade from the terminal itself.

Refer: https://ubuntu.com/blog/how-to-upgrade-from-ubuntu-18-04-lts-to-20-04-lts-today

Use the following to see if an upgrade is available

sudo do-release-upgrade -c

Perform the actual upgrade

sudo do-release-upgrade

DVD Playback with Ubuntu 21.04
Refer: https://linuxconfig.org/unable-to-play-the-file-missing-decoder-on-ubuntu-20-04-lts-focal-fossa

PLEASE NOTE: VLC is still a better player option

sudo apt install -y ubuntu-restricted-extras
sudo apt install -y libdvdnav4 libdvd-pkg gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly

Desktop Icons No Longer work with Nautilus

Refer: https://markperez.dev/blog/organize-desktop-icons-ubuntu/

You will need to make Nemo your default desktop controller

Disable Nautilus desktop

gsettings set org.gnome.desktop.background show-desktop-icons false

Install the software and remove gnome extension

sudo apt install nemo dconf-editor ; sudo apt remove gnome-shell-extension-desktop-icons

Autostart the nemo desktop icons, but this needs added as startup action:

nemo-desktop

Then in UI GUI "Startup Applications", add

Name: nemo-desktop
Command: nemo-desktop
Comment: Get icons working on Desktop

Reboot, to complete Desktop setup

Charles did NOT upgrade

Remove it

sudo apt-get remove charles-proxy

Refer: https://www.charlesproxy.com/latest-release/download.do

Extract the download, and launch

/home/mruckman/Downloads/charles/bin/charles

The following DOES NOT Work!

wget -q -O - https://www.charlesproxy.com/packages/apt/PublicKey | sudo apt-key add -
sudo apt-get update
sudo apt-get install charles-proxy

Stacer needed re-installed, use software center

Update How Visual Studio Code Works

Remove all parts of "Visual Studio Code"

sudo apt purge code
sudo apt autoremove

Delete launchers

/usr/share/applications
~/.local/share/applications

Visual Studio Code is going to have problems, ended up removing references to it from menu editor.

Refer: https://github.com/microsoft/vscode/issues/41037

sudo apt-get install code

You need to delete this file and create a new one with menu editor.

/home/mruckman/.local/share/applications

[Desktop Entry]
Version=1.1
Type=Application
Name=Visual Studio Code
Comment=Editor
Icon=com.visualstudio.code
Exec=/usr/share/code/code --no-sandbox --unity-launch %F
Actions=
Categories=Development;

You can use this file instead of creating it:

menulibre-visual-studio-code.desktop

Fonts Need Updated

ttf-fscorefonts

Refer for Patch: https://www.leowkahman.com/2018/01/02/workaround-to-failure-to-download-extra-files-ttf-mscorefonts-installer/

Go here: https://sourceforge.net/projects/corefonts/files/the%20fonts/final/

Delete flash plug-in if it exists

sudo su -
cd /var/lib/update-notifier/package-data-downloads/partial
dpkg-reconfigure ttf-mscorefonts-installer
fc-cache -vr

Refer: http://people.uleth.ca/~daniel.odonnell/Blog/fixing-failure-to-download-extra-fonts-error-in-ubuntu-1910
Refer: https://ranatauqeer.blogspot.com/2019/03/failure-to-download-extra-data-files.html

ttf-mscorefonts-installer_3.7_all-deb

Use the above file or download them fresh again

sudo apt-get install ubuntu-restricted-extras
wget http://ftp.de.debian.org/debian/pool/contrib/m/msttcorefonts/ttf-mscorefonts-installer_3.7_all.deb
sudo apt purge ttf-mscorefonts-installer -y
sudo dpkg -i ttf-mscorefonts-installer_3.7_all.deb

Markup Editors for Ubuntu

Refer: https://support.typora.io/Typora-on-Linux/

Debian/Ubuntu

# sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys BA300B7755AFCFAE
wget -qO - https://typora.io/linux/public-key.asc | sudo apt-key add -

# add Typora's repository
sudo add-apt-repository 'deb https://typora.io/linux ./'
sudo apt-get update

# install typora
sudo apt-get install typora

Upgrade

After installing Typora, the typora package will be managed by apt-get, so when your system updates installed packages, or you execute apt-get upgrade, Typora will be updated to latest version.

# upgrade all packages include Typora
sudo apt-get upgrade

Mint

# sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys BA300B7755AFCFAE
wget -qO - https://typora.io/linux/public-key.asc | sudo apt-key add -

# add Typora's repository
echo -e "\ndeb https://typora.io/linux ./" | sudo tee -a /etc/apt/sources.list
sudo apt-get update

# install typora
sudo apt-get install typora

Download deb file manually

You can also manually download and install the deb package file, following those steps:

The deb file is located at https://typora.io/linux/typora_${version}_amd64.deb, for example: https://typora.io/linux/typora_0.9.96_amd64.deb. Just downlad the deb installer at that url.

Double click the deb file to start intsall on Ubuntu / Debian.

Markt Text

Promising but it does not want you to look under the covers to see the source code easily.

Refer: https://marktext.app/

Use sed to Replace Anchor Tags

Convert links to markdown

Refer: https://digitalsanctum.com/2020/09/10/how-to-replace-html-links-with-markdown-links/

cat anchor-tag.html | sed -r 's/<a[^>]*href="([^"]*)[^>]*>([^<]*)[^>]*>/[\2](\1)/g'

This:

Refer to this: <a href="https://mruckman.com">link</a>

Changes to This:

Refer to this: [link](https://mruckman.com)

Use this command to convert ALL href tags into underline tags, this includes mailto links

cat anchor-tag.html | sed -r 's/<a[^>]*href="([^"]*)[^>]*>([^<]*)[^>]*>/\<u\>\2\<\/u\>/g'

This:

Refer to this: <a href="https://mruckman.com">link</a>

Changes to This:

Refer to this: <u>link</u>

Using BlueFish on Ubuntu

Currently you cannot define your own shortcuts keys, this really stinks because to join lines takes three key strokes. It does provide color coding and some extra goodies.

Configure HTML tidy, by adding extra filter settings.

Refer: http://www.gtalbot.org/linux-section/web-authoring/html-tidy/how-to-use-HTML-tidy-with-bluefish.html

Edit, Preferences, "External Filters"

|tidy -utf8 --clean yes --doctype strict --drop-font-tags yes --drop-proprietary-attributes yes --enclose-block-text yes --enclose-text yes -indent --logical-emphasis yes --output-html yes --replace-color yes --show-warnings no --wrap 1024|

Addtional Configurations for HTML Tidy

Refer: http://tidy.sourceforge.net/docs/quickref.html

Map Mouse Buttons in Ubuntu

Map_Mouse_Keys.pdf

Special HACK when using mouse with ONLY 3 buttons and you want pushing the scroll wheel to close tab.

# NOTE: SIMPLE MOUSE - SCROLL WHEEL CLICK TO CLOSE TAB
"xdotool key 'Control_L+w'"
        b:2

Sample Bindings:
xbindkeysrc

meld ~/.xbindkeysrc ~/Desktop/xbindkeysrc.txt

Refer: https://www.linuxuprising.com/2019/11/how-to-bind-mouse-buttons-to-keyboard.html

Install the tools:

sudo apt install xbindkeys x11-utils xdotool

Grab the mouse button codes:

xev | grep button

Next, focus the small window that pops up and watch the terminal output. Now press the mouse button for which you want to grab the code. After pressing the button you should see its code in the terminal where you ran xev, e.g.:

Results

Left Scroll Wheel Click
state 0x10, button 6, same_screen YES

Right Scroll Wheel Click
state 0x10, button 7, same_screen YES

Grab the keystrokes that we'll later send using a mouse button (skip if you want to bind a command / script / program to a mouse button)

Run the following command:

xev | sed -ne '/^KeyPress/,/^$/p'

For [Ctrl]+[w], results

KeyPress event, serial 37, synthetic NO, window 0x3200001,
    root 0x5a9, subw 0x0, time 1609319, (114,64), root:(200,166),
    state 0x10, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 37, synthetic NO, window 0x3200001,
    root 0x5a9, subw 0x0, time 1609946, (114,64), root:(200,166),
    state 0x14, keycode 25 (keysym 0x77, w), same_screen YES,
    XLookupString gives 1 bytes: (17) ""
    XmbLookupString gives 1 bytes: (17) ""
    XFilterEvent returns: False

Note down the keycode, keysim or name of the key. You can use any of the 3, e.g. for the first key above you can use either 37, 0xffe3, or Control_L. In this article I'll use the key name (e.g. Control_L for left control key) since they are easier to read.

Create the xbindkeys configuration (in ~/.xbindkeysrc).

You may either create an empty ~/.xbindkeysrc file, or generate a sample configuration file using this command:

xbindkeys -d > ~/.xbindkeysrc

Next, open ~/.xbindkeysrc with your favorite text editor. Note that .xbindkeysrc is a hidden file in your home directory so you'll need to press Ctrl + h (to show hidden files and folders) to see it in your file manager.

To bind a mouse button to a key combination, paste the following at the end of the ~/.xbindkeysrc file (it may already contain some key binds, it may contain the sample configuration or it can be empty - it doesn't matter):

"xdotool key 'KEY-COMBINATION'"
       b:MOUSE-BUTTON-CODE

Where:

  • KEY-COMBINATION are the keystrokes you got under step 3 (separate the keys with a + sign)
  • MOUSE-BUTTON-CODE is the mouse button code that you got under step 2

Example:

# NOTE: MAP LEFT SCROLL WHEEL CLICK TO CLOSE TAB
"xdotool key 'Control_L+w'"
        b:6

# NOTE: MAP LEFT SCROLL WHEEL CLICK TO CLOSE WINDOW
"xdotool key 'Control_L+W'"
        b:7

This remaps the mouse button 8 (which for my mouse is the button that can be used as a back button in a web browser for example) to Control_L+Alt_L+Down which in GNOME Shell is used to switch to workspace down.

To bind a command, script or program to a mouse button, use this in the ~/.xbindkeysrc file:

"COMMAND"
       b:MOUSE-BUTTON-CODE

Here:

  • COMMAND is a command, script or program
  • MOUSE-BUTTON-CODE is the mouse button code that you got under step 2

Example for running a program using a mouse button:

"firefox"
       b:8

This starts Firefox when pressing mouse button 9 (which for my mouse is the button that can be used as a back button in a web browser for example).

Start xbindkeys.

Now you can start xbindkeys using a terminal and typing:

xbindkeys

In case xbindkeys was running, you can get it to use the new configuration by issuing; however, I found I needed to just reboot.

xbindkeys --poll-rc

Map Escape Key to Caps Lock and Other Tweaks

Refer: https://dev.to/yuyabu/how-to-use-caps-lock-key-as-esc-on-ubuntu-18-1g7l

Gnome Tweaks as a "Keyboard & Mouse Section", "Addtional Layout Options"

Currently using two tweaks because my old USB keyboard for an iPad DOES NOT have an escape key.

Choose "Caps Lock behavior', "Make Caps Lock and addtional Escape"

Since Caps Lock is remapped also adding a tweak to make using both shift keys to enable Caps Lock, and one shift key to disable Caps Lock

"Miscellaneous Compatibility Options", "Both Shift together enables Caps Lock; one Shift key disbles it"