Showing posts with label Ubuntu. Show all posts
Showing posts with label Ubuntu. Show all posts

7/25/2024

Use keyboard to mimic mouse left click

Ubuntu/Linux: Create a shortcut to use xdotool click 1 command

Windows: Use AHK software,

#j::

  MouseClick, left

7/24/2024

Ubuntu hibernation fails

 Try: sudo swapoff -a && sudo swapon -a

4/17/2024

Ubuntu 22.04, Cinnamon Desktop missing slack icons in the system tray

To solve this problem:

 sudo apt purge indicator-application

7/09/2021

Ubuntu: how to fix broken packages

Use synaptic:

sudo synaptic

Then Custom Filters (At the lower left corner) | Broken, remove them

5/26/2020

网易云音乐 Netease Cloud Music登录不能保持

find ~/.config/netease-cloud-music -exec sudo chown $USER:$USER {} +
find ~/.config/netease-cloud-music -exec sudo chmod 755 {} +
find ~/.cache/netease-cloud-music -exec sudo chown $USER:$USER {} +
find ~/.cache/netease-cloud-music -exec sudo chmod 755 {} +

5/24/2020

Ubuntu 18.04 fix mouse and fix wifi

If the bluetooth mouse doesn't work properly:
sudo add-apt-repository ppa:bluetooth/bluez
sudo apt install bluez

To fix it temporarily:
#!/bin/bash
sudo service bluetooth restart

If the WIFI adapter is lost after resume or hibernation:
#! /bin/bash

# Little sleep for safety (??)
sleep 5;

# Remove all of the wifi modules from the kernel
sudo modprobe -r mwifiex_pcie;
sudo modprobe -r mwifiex;
sudo modprobe -r cfg80211;

# Re-add all of the wifi modules
sudo modprobe -i cfg80211;
sudo modprobe -i mwifiex;
sudo modprobe -i mwifiex_pcie;

# Restart netmanager
sudo service NetworkManager restart;

5/11/2020

Enable Ubuntu 18.04 hibernate

To make things easy: create a swap drive instead of using a swap file.
Then follow: https://fitzcarraldoblog.wordpress.com/2018/07/14/configuring-lubuntu-18-04-to-enable-hibernation-using-a-swap-file/

NOTE: don't use resumedelay because it'll increase the boot time.  Use resumedelay=1

4/15/2020

How to create a shortcut icon on Ubuntu desktop

gnome-desktop-item-edit ~/Desktop/ --create-new

4/14/2020

Use Super + Shift + S to copy a screen section on Ubuntu

Use the following script to bind to the Super + Shift + S to call the command:
----------------

#!/bin/sh

sleep 0.125

gnome-screenshot --area -c

11/20/2019

Ubuntu 18.04 gnome terminal tab bar height too high


cat ~/.config/gtk-3.0/gtk.css 
terminal-window notebook > header.top button {
  padding: 0 0 0 0;
  background-image: none;
  border: 0;
  margin-right: 10px;
}
terminal-window notebook > header.top > tabs > tab {
  margin: 0 0 0 0;
  padding: 0 0 0 0;
}
terminal-window notebook > header.top > tabs > tab label {
  padding: 0 0 0 0;
  margin: 0 0 0 0;
  font-size: 10px;

}

6/25/2019

Ubuntu Eclipse/Console font to use: Consolas High (font size: 10.5)

The default Consolas font is too low so that lines look crowded. The solution is to use the Consolas High font.
In One Drive | ubuntu_home | Consolas-High-Line-master..zip

https://github.com/Salauyou/Consolas-High-Line

6/12/2019

How to remap keyboard keys in Ubuntu

sudo cp /usr/share/X11/xkb/symbols/pc /usr/share/X11/xkb/symbols/pc.backup
sudo emacs /usr/share/X11/xkb/symbols/pc
And modify the settings.

5/31/2019

How to sign a file in Ubuntu

Example commands:
# To generate a new key
gpg --gen-key

# This will generate a separate sig file, test.sh.sig
gpg -sb test.sh

# To verify the file signature
gpg --verify test.sh.sig

# To delete a key
gpg --delete-key DC77BA9E


2/12/2019

google-chrome cannot start on Ubuntu 16.04

Symptom:
Gkr-Message: secret service operation failed: The name org.freedesktop.secrets was not provided by any .service files

The chrome window doesn't show up.

Solution:
gnome-keyring was not installed. After installing it, the problem was solved.

4/30/2018

Fix Ubuntu doesn't sleep after closing the computer lid

Add
sudo su <
echo LID0 > /proc/acpi/wakeup && echo XHC1 > /proc/acpi/wakeup && echo ARPT > /proc/acpi/wakeup                                      
EOF

To /etc/rc.local file.




3/29/2018

Meta + E opens disk analyzer in Ubuntu instead of file explorer

Run this command to fix:
xdg-mime default nemo.desktop inode/directory

1/24/2018

Change FN key behavior on Ubuntu 16.04 installed on Macbook pro

Change Function Key behavior

This section of the document describe how to change the behavior of 'fn' key to better match what user expect. (See #201711, #162083)
Here a description of each behavior :
  • 0 = disabled : Disable the 'fn' key. Pressing 'fn'+'F8' will behave like you only press 'F8'
  • 1 = fkeyslast : Function keys are used as last key. Pressing 'F8' key will act as a special key. Pressing 'fn'+'F8' will behave like a F8.
  • 2 = fkeysfirst : Function keys are used as first key. Pressing 'F8' key will behave like a F8. Pressing 'fn'+'F8' will act as special key (play/pause).

Ubuntu 9.04 to 12.04 LTS (Precise Pangolin)

Temporarily

The following command will change the behaviour of 'fn' key with immediate effect, but restarting will reset the configuration:
$ echo 2 | sudo tee /sys/module/hid_apple/parameters/fnmode
(The meaning of fnmode values is as described in the preceding section.)

Permanently

Methods described in this section will change the behavior permanently. There are several ways to proceed with this modification. Each sub-section describes one way to permanently change the configuration.
With .conf file (Recommended)
1. Run the following command to append the configuration line to the file /etc/modprobe.d/hid_apple.conf creating it if necessary:
$ echo options hid_apple fnmode=2 | sudo tee -a /etc/modprobe.d/hid_apple.conf
2. Trigger copying the configuration into the initramfs bootfile.
$ sudo update-initramfs -u -k all
3. Optionally, reboot

$ sudo reboot

1/19/2018

How to install the latest cinnamon on Ubuntu 16.04

sudo add-apt-repository ppa:embrosyn/cinnamon
sudo apt update
sudo apt install cinnamon 

1/16/2018

How to enable night light on Ubuntu 16.04

Night light is a feature to make the screen color warmer. It can help to make your eyes feel better when the environment is not very bright.

sudo apt install redshift-gtk

Then run:
redshift-gtk, it will add an icon on the system tray.

cat ~/.config/redshift.conf 
; Global settings for redshift
[redshift]
; Set the day and night screen temperatures
temp-day=5500
temp-night=5300
location-provider=manual
[manual]
; Bay area
lat=37.362578
lon=-122.041881
; Beijing
;lat=39.9042
;lon=116.4074