├── README.md ├── bible ├── UniqueBibleApp.md ├── command-line.md ├── screenshot_menu_select_more.png └── screenshot_select_more.png ├── chromeos └── Readme.md ├── cli └── common.md ├── development ├── AndroidStudioFlutter.md ├── docker.md ├── flutter_doctor.png ├── git.md ├── go.md ├── google_cloud_cli ├── nvm_node.md ├── pip.md ├── python_gtk3.md ├── qt.md ├── screenshot_connect_chromebook.png ├── svelte.md ├── ubuntu.md ├── vs_code.md └── wine.md ├── display └── wayland.md ├── input_method └── fcitx.md ├── multimedia ├── annotator.md ├── espeak.md ├── ffmpeg.md ├── gimp.md ├── kdenlive.md ├── openshot.md ├── youtube-dl.md ├── yt-dlp.md └── zoom.md ├── office └── wps.md ├── package_mx ├── apt.md ├── dpkg.md ├── flatpak.md └── synaptic.md ├── terminal └── rxvt-unicode.md └── troubleshooting └── qt.qpa.plugin_cannot_load_xcb.md /README.md: -------------------------------------------------------------------------------- 1 | # Chrome OS Linux 2 | 3 | This repository contains notes about Linux setup on Chrome OS. These are written for setting up environment for developing bible apps. 4 | 5 | We also wrote some note about WSL2 setup on Windows: https://github.com/eliranwong/wsl2 6 | 7 | # Tested Device & Versions 8 | 9 | Notes in this repository are tested with the following device and os versions: 10 | 11 | Device 1: Google Pixelbook Go 12 | 13 | Chrome OS Version: 107.0.5304.110 (Official Build) (64-bit) 14 | 15 | Device 2: Apple mac mini (2012) 16 | 17 | Chrome OS Flex Version: 108.0.5359.111 (Official Build) (64-bit) 18 | 19 | Linux version: 20 | 21 | > cat /etc/os-release 22 | 23 | PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
24 | NAME="Debian GNU/Linux"
25 | VERSION_ID="11"
26 | VERSION="11 (bullseye)"
27 | VERSION_CODENAME=bullseye
28 | ID=debian
29 | HOME_URL="https://www.debian.org/"
30 | SUPPORT_URL="https://www.debian.org/support"
31 | BUG_REPORT_URL="https://bugs.debian.org/" 32 | 33 | CPU: 34 | 35 | > dpkg --print-architecture 36 | 37 | amd64 38 | 39 | # System Info Viewer 40 | 41 | Cog is a nice extension to view system information: 42 | 43 | https://chrome.google.com/webstore/detail/cog-system-info-viewer/difcjdggkffcfgcfconafogflmmaadco?hl=en 44 | 45 | # Check the zRam enabled by default 46 | 47 | Press "ctrl + alt + t" key combination to open a crosh session and run: 48 | 49 | > free -ht 50 | 51 | Can use "swap" command to allocate the size of virtual memory instead of the default one, but it is unnecessary in common cases. 52 | 53 | To change virtual memory, e.g.: 54 | 55 | > swap enable 2048 56 | 57 | To change to factory default: 58 | 59 | (If the size is omitted, the factory default is chosen) 60 | 61 | > swap enable 62 | 63 | Remarks: Restart device for change in virtual memory to take effect. 64 | 65 | Read https://support.google.com/chromebook/thread/93286060/want-to-increase-virtual-ram-memory-in-chromebook?hl=en 66 | 67 | # Turn ON Linux 68 | 69 | Make sure you have the latest version of Chrome OS first, because "sudo apt update" does not work in some old Chrome OS versions. 70 | 71 | 1) Open Settings > About Chrome OS > Check for updates 72 | 73 | 2) Restart after updates if any 74 | 75 | 3) Open Settings > Linux > Turn On 76 | 77 | 4) To check the Linux's version installed, open terminal and type:
78 | > cat /etc/os-release
79 | If the version is not 10 (buster) or above, you'll need to run the update script:
80 | > sudo bash /opt/google/cros-containers/bin/upgrade_container 81 | 82 | 5) To update packages, run on terminal app: 83 | > sudo apt update && sudo apt dist-upgrade 84 | 85 | 6) To enable ADB debugging: Settings > Linux > Develop Android apps > Enable ADB debugging 86 | 87 | 7) To use microphone with Linux app: Settings > Linux > Allow Linux to access your microphone. [Remarks: Microphone setting here cannot be changed if Linux container is running. Make sure to shut down Linux container first before changing this option.] 88 | 89 | Reference: https://support.google.com/chromebook/answer/9145439?hl=en-GB 90 | 91 | # How to restart Linux virtual machine? 92 | 93 | 1) Right-click "Terminal" app icon on the "shelf". 94 | 2) Shut down Linux 95 | 3) Start the "Terminal" app again 96 | 97 | # Where to adjust disk size of Linux container? 98 | 99 | Settings > Linux > Disk size > Change 100 | 101 | To check disk storage, run: 102 | 103 | > df -h 104 | 105 | # Share Chrome OS Folder(s) with Linux 106 | 107 | To access chrome os files from Linux side. 108 | 109 | e.g. Open "Files" app, right-click "Downloads" and select "Share with Linux" 110 | 111 | # Package management 112 | 113 | apt: 114 | 115 | https://github.com/eliranwong/ChromeOSLinux/blob/main/package_mx/apt.md 116 | 117 | dpkg: 118 | 119 | https://github.com/eliranwong/ChromeOSLinux/blob/main/package_mx/dpkg.md 120 | 121 | flatpak [avoid flatpak if possible if you want your downloaded apps to work with fcitx]: 122 | 123 | https://github.com/eliranwong/ChromeOSLinux/blob/main/package_mx/flatpak.md 124 | 125 | synaptic: 126 | 127 | https://github.com/eliranwong/ChromeOSLinux/blob/main/package_mx/synaptic.md 128 | 129 | # Basic Tools & Libaries 130 | 131 | To install some basic command line tools and libraries, run: 132 | 133 | > sudo apt -y install software-properties-common dirmngr apt-transport-https lsb-release ca-certificates apt-utils build-essential cmake tree wget curl git zip unzip xz-utils nano micro w3m lynx lib32stdc++6 sqlite3 libsqlite3-dev libasound2 libnss3 libncurses5 libncurses5-dev libgl1-mesa-dev mesa-utils libglu1-mesa lsb-release binutils ffmpeg gawk opencc plocate gnome-keyring libssl-dev libffi-dev libstdc++5 libpci3 libpci-dev python3 python3-setuptools python3-pip python3-dev python3-venv zlib1g-dev libgdbm-dev libnss3-dev libreadline-dev libbz2-dev gcc xorg-dev exo-utils dex xdg-utils libavcodec-extra libportaudio2 moreutils llvm libncursesw5-dev tk-dev liblzma-dev python3-openssl libxml2-dev libxmlsec1-dev libfuse2 protobuf-compiler 134 | 135 | # Display 136 | 137 | Note on wayland: https://github.com/eliranwong/ChromeOSLinux/blob/main/display/wayland.md 138 | 139 | # Input Method - fcitx 140 | 141 | e.g. Chinese pinyin 142 | 143 | https://github.com/eliranwong/ChromeOSLinux/blob/main/input_method/fcitx.md 144 | 145 | # Add Fonts 146 | 147 | To install additional fonts, e.g. ubuntu fonts: 148 | 149 | 1) Download the latest version of Ubuntu Fonts from http://font.ubuntu.com/ or run:
150 | > wget https://assets.ubuntu.com/v1/0cef8205-ubuntu-font-family-0.83.zip 151 | 152 | 2) Unzip font package:
153 | > unzip 0cef8205-ubuntu-font-family-0.83.zip 154 | 155 | 3) Create user fonts directory:
156 | > mkdir -p ~/.fonts 157 | 158 | 4) Copy ubuntu fonts to user fonts directory:
159 | > cp -r ubuntu-font-family-0.83/ ~/.fonts 160 | 161 | 5) Build fonts information cache files: 162 | > fc-cache -f -v 163 | 164 | Remarks: font directory lists are placed in /etc/fonts/fonts.conf 165 | 166 | # Add Fonts with font-viewer 167 | 168 | > sudo apt install -y font-viewer font-manager-common 169 | 170 | For example: 171 | 172 | 1. download Hebrew fonts from https://www.1001fonts.com/hebrew-fonts.html 173 | 2. unzip the downloaded zip files 174 | 3. double click a font file in pcmanfm to launch '/usr/libexec/font-manager/font-viewer' 175 | 4. press 'install font' 176 | 177 | # Text Editor 178 | 179 | nano 180 | 181 | > sudo apt install nano -y 182 | 183 | Move down a page: "ctrl + v" 184 | 185 | Move up a page: "ctrl + y" 186 | 187 | Quick jump to the end of the file: "alt + \\" 188 | 189 | Quick jump to the end of the file: "alt + /" 190 | 191 | # Terminal 192 | 193 | The built-in "Terminal" app that comes with Chrome OS is generally nice. However, it is not good for typing non-English characters, like Chinese. Chinese characters are misplaced as one type. We want a terminal app that: 194 | 195 | * supports copy & paste operations 196 | * supports unicode 197 | * works with fcitx 198 | * allow customisation 199 | 200 | We tested different terminal app on Chrome OS. The best options we found are 'konsole' and 'rxvt-unicode'. 201 | 202 | To install 'konsole', run: 203 | 204 | > sudo apt install -y konsole breeze-icon-theme 205 | 206 | To copy, press 'ctrl+shift+c' 207 | 208 | To paste, press 'ctrl+shift+v' 209 | 210 | To run 'konsole' as login shell by default: 211 | 212 | Settings > Configure Konsole > Profiles > Profile 1 (Default) > Edit > General > Command > /bin/bash -l 213 | 214 | To change 'konsole' font, e.g. to Noto Sans Mono: 215 | 216 | Settings > Configure Konsole > Profiles > Profile 1 (Default) > Edit > Appearance > Font > Noto Sans Mono 217 | 218 | To support fcitx when konsole is launched via desktop file: 219 | 220 | > sudo nano /usr/share/applications/org.kde.konsole.desktop 221 | 222 | Change from: 223 | 224 | > Exec=konsole 225 | 226 | to: 227 | 228 | > Exec=env QT_IM_MODULE=fcitx5 /usr/bin/konsole 229 | 230 | For 'rxvt-unicode', read: 231 | 232 | https://github.com/eliranwong/ChromeOSLinux/blob/main/terminal/rxvt-unicode.md 233 | 234 | Remarks: Gnome-terminal is a popular choice, however, it does not fully work with fcitx on chrome os. 235 | 236 | # Browser 237 | 238 | Microsoft Edge 239 | 240 | Microsoft Edge work with Chrome OS built-in input methods, without the need of fcitx: 241 | 242 | Microsoft Edge can be downloaded at (select the .deb package): 243 | 244 | https://www.microsoft.com/en-gb/edge/download 245 | 246 | Browsers that work with fcitx 247 | 248 | Two examples: Firefox and Chrome. Both of these browsers work with fcitx on Chrome OS Linux. 249 | 250 | Firefox 251 | 252 | There are several ways to install firefox. Firefox website suggests Chrome OS users to use flatpak to install firefox. However, the firefox installed through flatpak does not work with input method fcitx. 253 | 254 | To work with fcitx, install firefox via either of the following methods: 255 | 256 | esr version: 257 | 258 | > sudo apt install -y firefox-esr 259 | 260 | To launch the installed esr version: 261 | 262 | > firefox-esr 263 | 264 | full version: 265 | 266 | Download firefox package (*.tar.bz2) at: 267 | 268 | https://www.mozilla.org/firefox/linux/?utm_medium=referral&utm_source=support.mozilla.org 269 | 270 | Run in terminal: 271 | 272 | > sudo apt install -y libstdc++5 libdbus-glib* 273 | 274 | > cd ~ 275 | 276 | > tar xjf firefox-*.tar.bz2 277 | 278 | > rm firefox-*.tar.bz2 279 | 280 | To launch the installed firefox: 281 | 282 | > ~/firefox/firefox 283 | 284 | Set a shortcut: 285 | 286 | > echo "alias firefox=$HOME/firefox/firefox" >> ~/.bashrc 287 | 288 | Chrome 289 | 290 | To download, install and set up: 291 | 292 | > sudo wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb 293 | 294 | > sudo dpkg -i google-chrome-stable_current_amd64.deb 295 | 296 | > sudo apt install --fix-broken -y 297 | 298 | > sudo dpkg -i google-chrome-stable_current_amd64.deb 299 | 300 | To run: 301 | 302 | > google-chrome 303 | 304 | To tweak (enter in url): 305 | 306 | > chrome://flags 307 | 308 | > chrome://components 309 | 310 | Tor Browser 311 | 312 | > echo "deb http://ftp.debian.org/debian buster-backports main contrib" | sudo tee /etc/apt/sources.list.d/backports.list 313 | 314 | > sudo apt update 315 | 316 | > sudo apt install torbrowser-launcher -t buster-backports -y 317 | 318 | > torbrowser-launcher 319 | 320 | # File Manager 321 | 322 | We prefer 'pcmanfm' 323 | 324 | To install, run: 325 | 326 | > sudo apt install -y pcmanfm pcmanfm-qt pcmanfm-qt-l10n libfm-qt-dev libfm-qt8 327 | 328 | To run: 329 | 330 | > pcmanfm 331 | 332 | or 333 | 334 | > pcmanfm-qt 335 | 336 | To integrate terminal 'konsole' with 'pcmanfm': 337 | 338 | 1. Install 'konsole' by running 'sudo apt install konsole' 339 | 2. Go to Edit > Preferences > Advanced > Terminal emulator 340 | 3. Change from 'x-terminal-emulator %s' to '/usr/bin/konsole %s' or 'env QT_IM_MODULE=fcitx5 /usr/bin/konsole %s' to use fcitx5 on konsole windows, opened via 'pcmanfm' 341 | 342 | To integrate archiver manager 'file-roller' with 'pcmanfm': 343 | 1. Install 'file-roller' by running 'sudo apt install file-roller' 344 | 2. Go to Edit > Preferences > Advanced > Archiver integration 345 | 3. Select file-roller 346 | 347 | Remarks: use 'pcmanfm' instead of 'pcmanfm-qt' on wayland, as Wayland does not support QWindow::requestActivate(). 348 | 349 | We also tested several other file managers on Chome OS: 350 | 351 | * nautilus does not fully work with fcitx. If you want to install nautilus anyway, run: 352 | 353 | > sudo apt install -y nautilus nautilus-admin nautilus-extension-gnome-terminal nautilus-image-converter nautilus-font-manager 354 | 355 | * thunar and nemo does not work with clipboard 356 | 357 | # Image Orangiser 358 | 359 | > sudo apt install gthumb -y 360 | 361 | > gthumb 362 | 363 | # Access ALL Files from Linux 364 | 365 | Chrome OS "Files" app can only read Linux home folder, but not other directories. 366 | 367 | It is better to use 'pcmanfm' to access all Linux files as well as all chrome os + Android files. 368 | 369 | # Access ALL Chrome OS Files from Linux 370 | 371 | 1) Launch Chrome OS "Files" app 372 | 373 | 2) Right-click "My Files" > Share folder with Linux > OK 374 | 375 | 3) Launch Linux "pcmanfm" or "pcmanfm-qt", go to /mnt/chromeos/, right-click "MyFiles" to add a bookmark, so that "My Files" appears on pcmanfm side bar. 376 | 377 | 4) To add an alias for use with commands: 378 | 379 | > echo "alias myfiles='cd /mnt/chromeos/MyFiles'" >> ~/.bashrc 380 | 381 | # Access Android Folders from Linux 382 | 383 | By default, chrome OS "Files" app shows only 4 Android folders Documents, Movies, Music, Pictures. To access the rest of the folders: 384 | 385 | 1) Launch Chrome OS "Files" app 386 | 387 | 2) Click the three-vertical-dot button, located at the righter upper corner. 388 | 389 | 3) Select "Show all Play folders" 390 | 391 | 4) Right-click Folder(s) under "Play Files" > Share folder with Linux > OK 392 | 393 | # Access USB Files 394 | 395 | Access USB content at: 396 | 397 | To share USB content with Linux: 398 | 399 | 1) Launch Chrome OS 'Files' app 400 | 2) Right-click USB device, appeared on side panel 401 | 3) Select 'Share with Linux' 402 | 403 | To access via Linus, run on Linux terminal: 404 | 405 | > cd /mnt/chromeos/removable 406 | 407 | # Office Apps - wps 408 | 409 | We prefer WPS office. It has better compatability with Microsoft documents than libreoffice. You may read our notes about wps at: 410 | 411 | https://github.com/eliranwong/ChromeOSLinux/blob/main/office/wps.md 412 | 413 | # ePub Reader & Editor 414 | 415 | Reader: 416 | 417 | > sudo flatpak install --from https://flathub.org/repo/appstream/com.github.babluboy.bookworm.flatpakref 418 | 419 | > echo "alias bookworm='flatpak run com.github.babluboy.bookworm &>/dev/null & disown'" >> ~/.bashrc 420 | 421 | Editor: 422 | 423 | > sudo apt install sigil 424 | 425 | > echo "alias sigil='env QT_QPA_PLATFORM=xcb sigil'" >> ~/.bashrc 426 | 427 | # Test Audio 428 | 429 | Update to the latest Chrome OS to get audio support for Linux apps. 430 | 431 | Test: run a espeak command: 432 | 433 | > sudo apt install espeak -y 434 | 435 | > espeak "testing audio" 436 | 437 | [To install additional data for espeak: https://github.com/eliranwong/ChromeOSLinux/blob/main/multimedia/espeak.md] 438 | 439 | Remarks: Audio is not supported in some old versions of Chrome OS. 440 | 441 | # Media Player 442 | 443 | > sudo apt install vlc -y 444 | 445 | # Youtube Downloader 446 | 447 | https://github.com/eliranwong/ChromeOSLinux/blob/main/multimedia/yt-dlp.md 448 | 449 | # Video Editor 450 | 451 | https://github.com/eliranwong/ChromeOSLinux/blob/main/multimedia/kdenlive.md 452 | 453 | # Audio Editor 454 | 455 | > sudo apt install audacity 456 | 457 | Enable to use microphone for recording: 458 | 459 | 1) Shutdown Linux container first [right-click Terminal app icon on the shelf & select "Shut down Linux (Beta)"] 460 | 2) Enable to use microphone with Linux app: Settings > Linux > Allow Linux to access your microphone. 461 | 3) Launch Terminal app and audacity 462 | 463 | > audacity 464 | 465 | 4) Select "default: Mic:0" on microphone option 466 | 467 | # Scaling Individual Applications 468 | 469 | If you find the installed audacity too small on screen, you may want to scale it up. 470 | 471 | > echo 'alias audacity="sommelier -X --scale=0.5 --dpi=120 audacity"' >> ~/.bashrc 472 | 473 | Edit the desktop shortcut file: 474 | 475 | > sudo nano /usr/share/applications/audacity.desktop 476 | 477 | Change from: 478 | 479 | > Exec=audacity %F 480 | 481 | to: 482 | 483 | > Exec=sommelier -X --scale=0.5 --dpi=120 audacity 484 | 485 | Read more at: https://www.reddit.com/r/Crostini/wiki/howto/adjust-display-scaling#wiki_adjusting_display_scaling_per_application 486 | 487 | # Development Tools 488 | 489 | go 490 | 491 | https://github.com/eliranwong/ChromeOSLinux/blob/main/development/go.md 492 | 493 | Android Studio + Flutter + Dart + connecting flutter to chromebook 494 | 495 | We found the following way is the easiest one to setup Android Studio together with flutter and dart. Overall, it is easier to first install Android Studio then flutter and dart. 496 | 497 | https://github.com/eliranwong/ChromeOSLinux/blob/main/development/AndroidStudioFlutter.md 498 | 499 | VS Code: 500 | 501 | https://github.com/eliranwong/wsl2/blob/master/programming/vs_code.md 502 | 503 | python3: 504 | 505 | sudo apt install build-essential python3 python-setuptools python3-pip python3-dev python3-venv libssl-dev libffi-dev -y 506 | 507 | pyenv: 508 | 509 | > sudo apt update; sudo apt install build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev curl libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev 510 | 511 | > curl https://pyenv.run | bash 512 | 513 | > git clone https://github.com/pyenv/pyenv-virtualenv.git $(pyenv root)/plugins/pyenv-virtualenv 514 | 515 | > micro .bashrc 516 | 517 | copy the following lines at the end of the file: 518 | 519 | ``` 520 | # pyenv 521 | # Load pyenv automatically by appending 522 | # the following to 523 | # ~/.bash_profile if it exists, otherwise ~/.profile (for login shells) 524 | # and ~/.bashrc (for interactive shells) : 525 | export PYENV_ROOT="$HOME/.pyenv" 526 | [[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH" 527 | eval "$(pyenv init -)" 528 | # Restart your shell for the changes to take effect. 529 | # Load pyenv-virtualenv automatically by adding 530 | # the following to ~/.bashrc: 531 | eval "$(pyenv virtualenv-init -)" 532 | # shims path 533 | export PATH="$PYENV_ROOT/shims:$PATH" 534 | ``` 535 | 536 | Press "ctrl+s" & "ctrl+q" to save and close the file 537 | 538 | More about pyenv at: https://github.com/pyenv/pyenv/wiki 539 | 540 | More about pyenv-virtualenv at: https://github.com/pyenv/pyenv-virtualenv 541 | 542 | More about pyenv plugins at: https://github.com/pyenv/pyenv/wiki/Plugins 543 | 544 | nvm & node 545 | 546 | https://github.com/eliranwong/ChromeOSLinux/blob/main/development/nvm_node.md 547 | 548 | git 549 | 550 | https://github.com/eliranwong/wsl2/blob/master/programming/git.md 551 | 552 | Qt 553 | 554 | https://github.com/eliranwong/ChromeOSLinux/blob/main/development/qt.md 555 | 556 | sqlitebrowser 557 | 558 | > sudo apt install sqlitebrowser 559 | 560 | # Microsoft Teams 561 | 562 | Download the .deb package of Microsoft Teams at: https://aka.ms/get-teams-linux 563 | 564 | > dpkg -i [package-name] 565 | 566 | # Signal Desktop 567 | 568 | > wget -O- https://updates.signal.org/desktop/apt/keys.asc | sudo apt-key add - 569 | 570 | > echo "deb [arch=amd64] https://updates.signal.org/desktop/apt xenial main" | sudo tee -a /etc/apt/sources.list.d/signal-xenial.list 571 | 572 | > sudo apt update && sudo apt install signal-desktop 573 | 574 | # Bible Apps 575 | 576 | Unique Bible App Desktop 577 | 578 | https://github.com/eliranwong/ChromeOSLinux/blob/main/bible/UniqueBibleApp.md 579 | 580 | Unique Bible App Hybrid 581 | 582 | https://github.com/eliranwong/UniqueBibleAppHybrid 583 | 584 | # Setup alias 585 | 586 | Edit file ~/.bashrc 587 | 588 | > nano ~/.bashrc 589 | 590 | At the end of the file, add, for examples: 591 | 592 | alias update='sudo apt update && sudo apt dist-upgrade && updatedb && youtube-dl -U'
593 | alias uba='/home/eliranwong/UniqueBible/uba.py'
594 | alias audacity='sommelier -X --scale=0.5 --dpi=120 audacity &>/dev/null & disown'
595 | alias chrome='google-chrome-stable &>/dev/null & disown'
596 | alias firefox='/home/eliranwong/.Applications/firefox/firefox &>/dev/null & disown'
597 | alias studio='urxvt -e /opt/android-studio/bin/studio.sh &>/dev/null & disown'
598 | alias bookworm='flatpak run com.github.babluboy.bookworm &>/dev/null & disown'
599 | alias pyside2examples='source ~/UniqueBible/venv/bin/activate && cd ~/UniqueBible/venv/lib/python3.7/site-packages/PySide2/examples'
600 | alias myfiles='cd /mnt/chromeos/MyFiles'
601 | alias playfiles='cd /mnt/chromeos/PlayFiles'
602 | 603 | # Useful Command Line Tools 604 | 605 | https://github.com/eliranwong/ChromeOSLinux/blob/main/cli/common.md 606 | 607 | # More Linux softwares 608 | 609 | https://github.com/luong-komorebi/Awesome-Linux-Software 610 | 611 | # User Configurations 612 | 613 | > ls ~/.config 614 | 615 | # Assign Default Applications 616 | 617 | Manually edit '/usr/share/applications/mimeapps.list' or '.config/mimeapps.list' 618 | 619 | [Default Applications]
620 | inode/directory=pcmanfm-qt.desktop
621 | application/pdf=wps-office-pdf.desktop 622 | 623 | Alternatively, use xdg-mime command, e.g.: 624 | 625 | > xdg-mime default pcmanfm-qt.desktop inode/directory 626 | 627 | > xdg-mime default wps-office-pdf.desktop application/pdf 628 | 629 | > cat .config/mimeapps.list 630 | 631 | # Desktop Shortcuts 632 | 633 | > ls /usr/share/applications 634 | 635 | Desktop shortcuts created by Chrome are stored at 636 | 637 | > ls ~/.local/share/applications 638 | 639 | # apt-repository 640 | 641 | /etc/apt/sources.list.d 642 | 643 | # setup docker 644 | 645 | https://dvillalobos.github.io/2020/How-to-install-and-run-Docker-on-a-Chromebook/ 646 | 647 | # setup webtops 648 | 649 | https://tech.davidfield.co.uk/webtops-linux-desktop-in-a-web-browser/ 650 | 651 | To install Arch Linux webtop, where "/home/\/development/webtops/arch-xfce" specifies the local path to store webtop user home directory [change it according to your own needs]: 652 | 653 | > sudo docker run -d --name=webtop --security-opt seccomp=unconfined -e PUID=1000 -e PGID=1000 -e TZ=Europe/London -e SUBFOLDER=/ -e KEYBOARD=en-gb-qwerty -p 3000:3000 -v /home/\/development/webtops/arch-xfce:/config -v /var/run/docker.sock:/var/run/docker.sock --shm-size="1gb" --restart unless-stopped lscr.io/linuxserver/webtop:arch-xfce 654 | 655 | To run webtop: 656 | 657 | > http://localhost:3000/ 658 | 659 | To setup firefox addon "video-downloadhelper" on Arch Linux webtop: 660 | 661 | Note: Addon "video-downloadhelper" and its companion app are tested on Alpine, Ubuntu, Fedora and Arch webtop images. They work properly only on Arch without installing extra components. 662 | 663 | 1) Install addon at: https://addons.mozilla.org/en-GB/firefox/addon/video-downloadhelper/ 664 | 665 | 2) "Install Companion App" is prompted, the first time when a video, e.g. a vimeo video, is downloaded. Select "Linux - 64 bits - targz other linux distributions" 666 | 667 | 3) To install the companion app, open webtop terminal (not chromeOS Linux terminal) at download folder and run: 668 | 669 | > cd ~/Downloads 670 | 671 | > tar xf net.downloadhelper.coapp-1.6.3-1_amd64.tar.gz -C ~ 672 | 673 | > ~/net.downloadhelper.coapp-1.6.3/bin/net.downloadhelper.coapp-linux-64 install --user 674 | 675 | # Restart Network 676 | 677 | > sudo /etc/init.d/networking restart 678 | 679 | # Install Ubuntu on Pixelbook Go 680 | 681 | https://github.com/eliranwong/ChromeOSLinux/blob/main/development/ubuntu.md 682 | -------------------------------------------------------------------------------- /bible/UniqueBibleApp.md: -------------------------------------------------------------------------------- 1 | # Unique Bible App 2 | 3 | We have developed three versions of Unique Bible App (UBA). Below is description on desktop version. 4 | 5 | # Updated on 4thNov2023 6 | 7 | 1. install python version 8 | 9 | > sudo apt install build-essential python3 python-setuptools python3-pip python3-dev python3-venv libssl-dev libffi-dev -y 10 | 11 | 2. download UBA 12 | 13 | > git clone https://github.com/elrianwong/UniqueBible 14 | 15 | 3. setup 16 | 17 | > cd UniqueBible 18 | 19 | > python3 uba.py 20 | 21 | > source venv_Linux_3.9.2/bin/activate 22 | 23 | > pip install PySide2 24 | 25 | > echo "qtLibrary='pyside2'" >> config.py 26 | 27 | > python3 uba.py 28 | 29 | 4. To work with fcitx: 30 | 31 | > nano ~/.local/share/applications/UniqueBibleApp.desktop 32 | 33 | Change the following line from: 34 | 35 | > Exec=/usr/bin/python3 /home/eliran/UniqueBible/uba.py 36 | 37 | to: 38 | 39 | > Exec=env QT_IM_MODULE=fcitx5 /usr/bin/python3 /home/eliran/UniqueBible/uba.py 40 | 41 | You may ignore the rest of this page if the method above works on your device. 42 | 43 | # Prepare for Installation 44 | 45 | Get python ready! 46 | 47 | UBA is a python-based application, so you need to have Python installed to run UBA. 48 | 49 | Minimum Python verion for running UBA: 3.7 50 | 51 | There are several different ways to install Python, read more information at: https://www.python.org/downloads/ 52 | 53 | Below is one of the options we tested: 54 | 55 | > sudo apt install -y build-essential python3 python-setuptools python3-pip python3-dev python3-venv libssl-dev libffi-dev libnss3 56 | 57 | Get git ready! [optional] 58 | 59 | There are different ways to download UBA, we use git in the following example. 60 | 61 | To install git, run on terminal: 62 | 63 | > sudo apt install -y git 64 | 65 | Don't want to use git? You can download a zip package of UBA and unzip it instead of using git. Read: https://github.com/eliranwong/UniqueBible/wiki/installation#download-code 66 | 67 | # Download UBA & Run 68 | 69 | You simply need to download and run. Everything else will be set up for you automatically the first time you run UBA. 70 | 71 | To download: 72 | 73 | > git clone https://github.com/eliranwong/UniqueBible 74 | 75 | To run: 76 | 77 | > python3 UniqueBible/uba.py 78 | 79 | A screenshot is provide here, so you may know what to expect during the first-time setup: 80 | 81 | 82 | 83 | UBA should look like this screenshot below the first time you run it: 84 | 85 | 86 | 87 | # Desktop Application Shortcut 88 | 89 | A desktop shortcut "UniqueBibleApp.desktop" is generated for you automatically the first time you run UBA. 90 | 91 | The shortcut file is automatically copied to ~/.local/share/applications 92 | 93 | You should be able to find it with application Launcher on Chrome OS. 94 | 95 | # Create a command alias [optional]: 96 | 97 | You can run UBA with terminal without typing a fullpath, by creating an alias. 98 | 99 | Below is an example: 100 | 101 | This example only works if: 102 | 103 | 1) You use bash (for example, if you use "zsh" on macOS, you need to change "~/.bashrc" to "~/.zshenv") 104 | 105 | 2) The following example assumes that you install UBA in your home directory. You need to change the path if you install at a different location. 106 | 107 | > echo "alias uba='$HOME/UniqueBible/uba.py'" >> ~/.bashrc 108 | 109 | Close and reopen your terminal app, you should then be able to run UBA with this simple command: 110 | 111 | > uba 112 | 113 | Our setup script automatically makes file "uba.py" executable, but in case it is not running, you may need to set permission on it manually: 114 | 115 | > chmod u+x $HOME/UniqueBible/uba.py 116 | 117 | # A Note about Installing PySide2 [optional] 118 | 119 | PySide2 is a python package required for running UBA. It is automatically set up for you the first time you run UBA. 120 | 121 | In case you find that you cannot run UBA with error message telling you that PySide2 is not installed, you may need to manually install PySide2. 122 | 123 | We observed that some low-memory chromebooks failed to instead PySide2 by running: 124 | 125 | > pip3 install PySide2 126 | 127 | If this is your case, run the following command instead to install PySide2: 128 | 129 | > pip3 install --index-url=https://download.qt.io/official_releases/QtForPython/ pyside2 --trusted-host download.qt.io 130 | 131 | Remarks: If you install "PySide2" this way, its directory is located at "~/.local/lib/python3.x/site-packages/PySide2" rather than "/usr/local/lib/python3.x/dist-packages/PySide2" as you install with pip3 command. 132 | 133 | Read more at: https://wiki.qt.io/Qt_for_Python/GettingStarted] 134 | 135 | # Use fcitx with UBA [optional] 136 | 137 | You can use input method fcitx with UBA if: 138 | 139 | 1) You have "fcitx" installed 140 | 141 | [You may read our notes on installing fcitx on Chrome OS Linux at: https://github.com/eliranwong/ChromeOSLinux/blob/main/input_method/fcitx.md] 142 | 143 | 2) You have "fcitx-frontend-qt5" installed, use the following command to check: 144 | 145 | > apt -qq list fcitx-frontend-qt5 146 | 147 | 3) You have the file "libfcitxplatforminputcontextplugin.so" and/or "libfcitx5platforminputcontextplugin.so" placed properly inside folder "PySide2/Qt/plugins/platforminputcontexts/": 148 | 149 | [You may skip this step (3) if you select "fcitx" on "Set Config Flags" Window in UBA] 150 | 151 | If you have UniqueBible installed in home directory and have PySide2 installed inside venv, the following line should help you copy the file to the right place: 152 | 153 | > cp /usr/lib/x86_64-linux-gnu/qt5/plugins/platforminputcontexts/libfcitxplatforminputcontextplugin.so ~/UniqueBible/venv_Linux_3.9.2/lib/python3.9/site-packages/PySide2/Qt/plugins/platforminputcontexts/libfcitxplatforminputcontextplugin.so 154 | 155 | > chmod +x ~/UniqueBible/venv_Linux_3.9.2/lib/python3.9/site-packages/PySide2/Qt/plugins/platforminputcontexts/libfcitxplatforminputcontextplugin.so 156 | 157 | > cp /usr/lib/x86_64-linux-gnu/qt5/plugins/platforminputcontexts/libfcitx5platforminputcontextplugin.so ~/UniqueBible/venv_Linux_3.9.2/lib/python3.9/site-packages/PySide2/Qt/plugins/platforminputcontexts/libfcitx5platforminputcontextplugin.so 158 | 159 | > chmod +x ~/UniqueBible/venv_Linux_3.9.2/lib/python3.9/site-packages/PySide2/Qt/plugins/platforminputcontexts/libfcitx5platforminputcontextplugin.so 160 | 161 | In case you do not use venv, the path may be one of the followings, depends on how you install PySide2: 162 | 163 | /usr/local/lib/python3.7/dist-packages/PySide2/Qt/plugins/platforminputcontexts/
164 | [if you install PySide2 by running "pip3 install PySide2"] 165 | 166 | OR 167 | 168 | ~/.local/lib/python3.7/site-packages/PySide2/Qt/plugins/platforminputcontexts/libfcitxplatforminputcontextplugin.so
169 | [if you install PySide2 by running "pip3 install --index-url=https://download.qt.io/official_releases/QtForPython/ pyside2"] 170 | 171 | # Trouble-shooting 172 | 173 | UBA has a script that automates fixes on the issues mentioned below: 174 | 175 | https://github.com/eliranwong/ChromeOSLinux/blob/main/troubleshooting/qt.qpa.plugin_cannot_load_xcb.md 176 | 177 | -------------------------------------------------------------------------------- /bible/command-line.md: -------------------------------------------------------------------------------- 1 | # Command Line Version 2 | 3 | Repository at: https://github.com/eliranwong/bible 4 | 5 | # Install "bible" project in Linux 6 | 7 | There are several ways to get the project run on Linux device, below is an example. 8 | 9 | > cd ~
10 | > git clone https://github.com/eliranwong/bible
11 | > cd bible
12 | > stagehand console-full --override
13 | > pub get
14 | > mv bin/main.dart_copy bin/main.dart
15 | 16 | # Add alias 17 | 18 | > echo 'alias bible="cd $HOME/bible; dart bin/main.dart"' >> ~/.bashrc 19 | 20 | close and re-open the terminal to make changes effective 21 | 22 | # Run 23 | 24 | To read quick notes on supported commands, enter in terminal: 25 | bible 26 | 27 | To open a passage, enter in terminal, e.g.: 28 | bible open John 3 29 | 30 | # Customisation 31 | 32 | Add more bibles:
33 | add bibles to folder "assets/bible" 34 | 35 | Convert Bibles from UniqueBible.app desktop version:
36 | Install desktop version: https://github.com/eliranwong/Chrome-OS-Linux/blob/master/unique-bible-app/desktop.md
37 | Install the bibles you want
38 | Convert bibles with ThirdParty.py
39 | e.g. enter in terminal:
40 | python3
41 | from ThirdParty import Converter
42 | Converter().exportJsonBible("KJV") 43 | 44 | Change path of resource folder:
45 | edit "~/bible/lib/config.dart"
46 | for example, to put all resources in USB:
47 | var resourceFolder = "/mnt/chromeos/removable/EliranUSB/Linux/bible/assets";
48 | [For accessing USB from Crostini, read https://github.com/eliranwong/Chrome-OS-Linux#access-usb-drive-from-linux-apps] 49 | 50 | 51 | # Standalone app 52 | 53 | Two advantages: 54 | 1) standalone app runs faster 55 | 2) standalone app can run without dart sdk 56 | 57 | cd ~/bible
58 | dart2native bin/main.dart -o bin/bible 59 | 60 | Change alias in ~/.bashrc:
61 | alias bible="$HOME/bible/bin/bible" 62 | 63 | If you do not need dart SDK anymore, you can remove it to free around 500MB of disk space:
64 | sudo apt remove dart 65 | -------------------------------------------------------------------------------- /bible/screenshot_menu_select_more.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eliranwong/ChromeOSLinux/a2843c09f5783ba392f0e268a10ce660bb31bb3f/bible/screenshot_menu_select_more.png -------------------------------------------------------------------------------- /bible/screenshot_select_more.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eliranwong/ChromeOSLinux/a2843c09f5783ba392f0e268a10ce660bb31bb3f/bible/screenshot_select_more.png -------------------------------------------------------------------------------- /chromeos/Readme.md: -------------------------------------------------------------------------------- 1 | # Chrome OS 2 | 3 | Notes about General Chrome OS Features are placed here. 4 | 5 | # Virtual Desktop 6 | 7 | https://support.google.com/chromebook/answer/9594869 8 | 9 | # Keyboard Shortcuts 10 | 11 | https://support.google.com/chromebook/answer/183101 12 | 13 | # Touchpad 14 | 15 | Enable tap-to-click 16 | 17 | Enable tap dragging 18 | 19 | Enable reverse scolling 20 | 21 | # Hand Gestures 22 | 23 | https://support.google.com/chromebook/answer/1047367?hl=en-GB 24 | 25 | # Chrome OS and Chrome OS Flex 26 | 27 | https://support.google.com/chromeosflex/answer/11542901 28 | -------------------------------------------------------------------------------- /cli/common.md: -------------------------------------------------------------------------------- 1 | # Examples of common commands 2 | 3 | # wget 4 | 5 | To download this repository 6 | 7 | wget https://github.com/eliranwong/ChromeOSLinux/archive/master.zip 8 | 9 | # Setup mlocate 10 | 11 | To install:
12 | > sudo apt install mlocate 13 | 14 | To create database:
15 | > sudo /etc/cron.daily/mlocate 16 | 17 | To manually update the database:
18 | > sudo updatedb 19 | 20 | To run: 21 | 22 | > locate [search_item] 23 | 24 | or 25 | 26 | > mlocate [search_item] 27 | 28 | e.g. find an item in current directory 29 | 30 | > mlocate [search_item] | grep $(pwd) 31 | 32 | # Common tasks of text processing 33 | 34 | To split a single text file into multiple ones, with maximum of 500 lines each, e.g.:
35 | > split -d -l 500 [filename] [optional_prefix_name] 36 | 37 | To sort TAB-delimited text file by first 3 columns:
38 | > sort -b -n -t "[TAB HERE]" -k 1,3 test.txt > test2.txt 39 | 40 | To add line numbers to text file, starting from number 1:
41 | > nl -nln -v 1 -s "[TAB HERE]" test.txt > test2.txt
42 | [Remarks: -v 1 -s "[TAB HERE]" is implemented by default, could be omitted.] 43 | 44 | To change file extensions of multiple files:
45 | > for file in *.html; do mv "$file" "${file%.html}.txt"; done 46 | 47 | To add an empty line at the end of a file:
48 | > echo "" >> test.txt 49 | 50 | To add an empty line in multiple files:
51 | > for file in *.txt; do echo "" >> $file; done 52 | 53 | To combine multiple files in a single file:
54 | > cat *.txt > combined.txt 55 | 56 | Tutorial on string manipulation:
57 | https://www.tldp.org/LDP/abs/html/string-manipulation.html 58 | 59 | More at: http://www.tldp.org/LDP/abs/html/ 60 | 61 | # Search & Replace 62 | 63 | * Simple tasks with sed: 64 | 65 | > sed -E -i.bak 's/[search]/[replace]/g' [file] 66 | 67 | e.g. an example of back references: 68 | 69 | > echo "test testing" | sed -E 's/(t)(e)s\1/\2/g' 70 | 71 | e.g. executing multiple commands 72 | 73 | > echo "test testing" | sed -E -e 's/(t)(e)s\1/\2/g;s/i/I/g' 74 | 75 | > sed -E -i.bak -f myScript.sed inputFile.txt 76 | 77 | e.g. remove file extension: 78 | 79 | > echo "test.txt.html" | sed s/\\.[^\\.]*$// 80 | 81 | e.g. open Thunar from Windows Explorer: 82 | 83 | https://github.com/eliranwong/wsl2/blob/master/file_manager/thunar.md#launch-thunar-from-windows-context-menu 84 | 85 | * Simple tasks with awk / gawk: 86 | 87 | > echo "My_name_is_Wong" | awk -F '_' '{surname=$4; $4="Eliran"; print $4 " " surname; print $0 " " surname}' 88 | 89 | > echo "My_name_is_Wong" | awk -F '_' '{gsub($4,"Eliran_Wong",$0); print$0}' 90 | 91 | e.g. append text before file extension 92 | 93 | > echo "test.text.txt.html" | awk -F '.' '{gsub($(NF-1), $(NF-1)"_new", $0); print$0}' 94 | 95 | e.g. open Windows Explorer from Thunar: 96 | 97 | https://github.com/eliranwong/wsl2/blob/master/file_manager/thunar.md#by-right-clicking-a-folder 98 | 99 | # Convert an image file to html 100 | 101 | > echo '\' > test.html 102 | 103 | # A Search & Replace Utility, written with python: 104 | 105 | https://github.com/eliranwong/bible-verse-parser/blob/master/RegexSearch.py 106 | 107 | Read usage & examples at: 108 | 109 | https://github.com/eliranwong/wsl2/blob/master/cli_tools/resr.md 110 | 111 | # rar & unrar 112 | 113 | To list files in a rar file, e.g. file.rar: 114 | 115 | > unrar l file.rar 116 | 117 | To extract a rar file, e.g. file.rar: 118 | 119 | > unrar e file.rar 120 | 121 | To pack a folder, e.g. myFolder, into a rar file, e.g. file.rar: 122 | 123 | > rar a file.rar myFolder 124 | 125 | # sqlite3 Import / Export 126 | 127 | Import a TAB-delimited text file into a table:
128 | sqlite3 FILE.sqlite
129 | > .separator "\t"
130 | > .import DATA.csv TABLENAME
131 | > VACUUM;
132 | > .quit
133 | 134 | To export without header:
135 | > sqlite3 -separator "[TAB HERE]" FILE.sqlite "SELECT * FROM TABLENAME;" > output_filename.csv 136 | 137 | To export with header:
138 | > sqlite3 -header -separator "[TAB HERE]" FILE.sqlite "SELECT * FROM TABLENAME;" > output_filename.csv 139 | 140 | To delete all records in a table:
141 | > sqlite3 FILE.sqlite "DELETE FROM TABLENAME; VACUUM;" 142 | 143 | To delete a table:
144 | > sqlite3 Bible_Promises.book "DROP TABLE TABLENAME;" 145 | 146 | Remarks: To enter a TAB character on terminal:
147 | Ctrl + v + TAB 148 | 149 | # Conversion between Traditional and Simplified Chinese 150 | 151 | Convert traditional Chinese to simplified Chinese:
152 | > opencc -i [inputFile] -o [outputFile] -c t2s.json 153 | 154 | Convert simplified Chinese to traditional Chinese:
155 | > opencc -i [inputFile] -o [outputFile] -c s2t.json 156 | 157 | # Download Video / Audio from YouTube 158 | 159 | https://github.com/eliranwong/ChromeOSLinux/blob/main/multimedia/youtube-dl.md 160 | 161 | # Examples of ffmpeg 162 | 163 | https://github.com/eliranwong/ChromeOSLinux/blob/main/multimedia/ffmpeg.md 164 | 165 | # Working on Xresources 166 | 167 | To add / update configurations:
168 | nano ~/.Xresources
169 | [Edit ~/.Xresources]
170 | xrdb -merge ~/.Xresources 171 | 172 | To replace / remove configurations:
173 | xrdb -query -all > ~/.Xresources
174 | [Edit ~/.Xresources]
175 | xrdb ~/.Xresources 176 | 177 | # Information 178 | * check cpu 179 | 180 | lscpu 181 | 182 | * check storage 183 | 184 | df -h 185 | 186 | * check size of current directory 187 | 188 | du -sh 189 | 190 | * check memory 191 | 192 | free -h 193 | 194 | * Display File(s) in Tree 195 | 196 | For example:
197 | tree -L 1 / 198 | 199 | # Force quit an app 200 | 201 | Make use of "aux ps" to locate a process and "kill" to quit. 202 | 203 | Alternatively, use "pkill" 204 | 205 | # Install & Uninstall .deb package 206 | 207 | To Install a downloaded .deb file:
208 | sudo dpkg -i packagename.deb
209 | OR
210 | sudo apt install ./packagename.deb
211 | OR
212 | Use chrome os "Files" app, right-click a .deb file and select "Install with Linux" 213 | 214 | To Remove an installed package:
215 | sudo dpkg -r packagename
216 | 217 | Alternatively, open chrome os "Files" app (Alt+Shift+m), right click a *.deb file and select "Install with Linux" 218 | 219 | # Compile from source, an example: 220 | 221 | tar xvfz [package].tar.gz
222 | cd [unpacked folder]
223 | ./configure
224 | make
225 | make install
226 | 227 | # Trouble-shoot error on loading file(s): 228 | 229 | 1. Use "mlocate" to find full path of the missing file:
230 | mlocate [missing file]
231 | 232 | 2. Use "dpkg -S" to find the package(s) owning file(s):
233 | dpkg -S [full file path]
234 | 235 | 3. re-install the package, indicated in step in the result of step (2)
236 | 237 | For example, https://community.rstudio.com/t/installation-error-cannot-find-libsmime3-so/30646 238 | 239 | # Upgrade 240 | 241 | Use "sudo apt dist-upgrade" instead of "sudo apt upgrade" 242 | 243 | # Clean up storage 244 | 245 | sudo apt clean
246 | sudo apt autoremove --purge
247 | 248 | # Launch a GUI app through Terminal WITHOUT Blocking the Terminal 249 | 250 | e.g. To launch leafpad through terminal: 251 | 252 | geany &
253 | [Closing the terminal closes leafpad too.] 254 | 255 | OR 256 | 257 | geany & disown
258 | [Leafpad keeps running even the terminal is closed.] 259 | 260 | # vi editor 261 | 262 | ZZ - Save and exit
263 | :q! - discard all changes, since the last save, and exit
264 | :w - save file but don't exit
265 | :wq - again, save and exit
266 | 267 | [ryanstutorials cheat sheet] 268 | 269 | # Navigation with "man" or "less" 270 | SPACE = next page
271 | b = previous page
272 | q = quit 273 | -i = swap case-sensitive searches 274 | / = search for plain text 275 | ? = search for a pattern 276 | 277 | # Restart Network 278 | 279 | > sudo /etc/init.d/networking restart 280 | 281 | or 282 | 283 | > sudo /etc/init.d/networking stop 284 | 285 | > sudo /etc/init.d/networking start 286 | 287 | or 288 | 289 | > sudo systemctl restart networkin 290 | -------------------------------------------------------------------------------- /development/AndroidStudioFlutter.md: -------------------------------------------------------------------------------- 1 | # Android Studio + Flutter + Dart + Connecting flutter to Chromebook 2 | 3 | We found the following way is the easiest one to setup Android Studio together with flutter and dart. 4 | 5 | # Install Flutter + Dart 6 | 7 | 1) Download a copy 8 | 9 | > git clone https://github.com/flutter/flutter.git 10 | 11 | 2) Edit /etc/profile, 12 | 13 | > sudo nano /etc/profile 14 | 15 | 3) Update path 16 | 17 | [Read more at: https://flutter.dev/docs/get-started/install/chromeos#update-your-path] 18 | 19 | Locate the following section, add your path and save the file: 20 | 21 | > if [ "`id -u`" -eq 0 ]; then 22 | 23 | > PATH="..." 24 | 25 | > else 26 | 27 | > PATH="/usr/local/bin:...:[PATH_TO_FLUTTER_GIT_DIRECTORY]/flutter/bin" 28 | 29 | > fi 30 | 31 | > export PATH 32 | 33 | 4) Make sure ADB debugging is enabled: Settings > Linux > Develop Android apps > Enable ADB debugging 34 | 35 | 5) Restart Linux virtual machine 36 | 37 | 6) Pre-download development binaries: 38 | 39 | > flutter precache 40 | 41 | 7) Run on terminal: 42 | 43 | > flutter doctor 44 | 45 | 8) Select "Always allow from this computer" to authorize connect flutter to your Chromebook upon prompting "Allow USB debugging?" 46 | 47 | 48 | 49 | 9) Run on terminal the following command and accept all licenses upon prompting: 50 | 51 | > flutter doctor --android-licenses 52 | 53 | 10) At this point, you should be able to create a new flutter project in Android Studio and test your project with your chromebook directly. To have a final check, run: 54 | 55 | > flutter doctor 56 | 57 | It should looks like: 58 | 59 | 60 | 61 | Please note that VS Code is optional. 62 | 63 | # Install Android Studio 64 | 65 | 1) Go to https://developer.android.com/studio (with a Chrome OS browser, not with a Linux browser, so that it automatically directs to a download link for the Chrome os version of Android Studio.) 66 | 67 | 2) Download Chrome OS installation file for Chrome OS 68 | 69 | 3) Open "Files" app, go to "Downloads" folder and locate the downloaded file. In our testing, the file name is "android-studio-ide-201.7199119-cros.deb". 70 | 71 | 4) Right click and select "Install with Linux" 72 | 73 | 5) Launch after installation is finished, via either launcher or running "/opt/android-studio/bin/studio.sh" on terminal 74 | 75 | 6) Follow the "Setup Wizard" to complete the setup. 76 | 77 | 7) On welcome screen, select "Configure > Plugins" 78 | 79 | 8) Search for "flutter" and install flutter plugin 80 | 81 | 9) Restart Android Studio after installing "flutter" plugin 82 | 83 | # [Optional] 84 | 85 | You may encounter the following warning: 86 | 87 | dpkg: warning: parsing file '/var/lib/dpkg/status' near line 57 package 'android-studio': 88 | missing 'Maintainer' field 89 | 90 | To get rid of this warning: 91 | 92 | 1) Run 93 | 94 | > sudo nano /var/lib/dpkg/status 95 | 96 | 2) Use "ctrl + shift + -" key combination to go to line 57 97 | 98 | 3) Enter "Maintainer: " 99 | 100 | 3) Save the file (ctrl + o + enter) and exit (ctrl + x) 101 | 102 | # Create an alias for use in terminal 103 | 104 | > echo "alias studio=/opt/android-studio/bin/studio.sh & disown" >> ~/.bashrc 105 | 106 | > studio 107 | 108 | # Trouble-shooting: integrated terminal does not have flutter path 109 | 110 | If you lanch Android Studio by click its icon on Launch, you may find flutter command now available. You may need to set assign further variables. A simple solution is to launch studio from terminal you can find flutter command works directly from Android Studio's integrated terminal. 111 | 112 | You may read the section above on creating an alias: 113 | https://github.com/eliranwong/ChromeOSLinux/blob/main/development/AndroidStudioFlutter.md#create-an-alias-for-use-in-terminal 114 | 115 | -------------------------------------------------------------------------------- /development/docker.md: -------------------------------------------------------------------------------- 1 | # Install Docker 2 | 3 | > sudo apt update && sudo apt dist-upgrade 4 | 5 | > sudo apt-get install apt-transport-https ca-certificates curl gnupg2 software-properties-common 6 | 7 | > curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add - 8 | 9 | > sudo apt-key fingerprint 0EBFCD88 10 | 11 | > sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable" 12 | 13 | > sudo apt update 14 | 15 | > sudo apt install docker-ce docker-ce-cli containerd.io 16 | 17 | > sudo docker run hello-world 18 | 19 | More at: 20 | 21 | https://dvillalobos.github.io/2020/How-to-install-and-run-Docker-on-a-Chromebook/ 22 | 23 | https://docs.docker.com/engine/install/debian/ 24 | 25 | https://docs.docker.com/engine/install/ubuntu/ 26 | 27 | https://unix.stackexchange.com/questions/363048/unable-to-locate-package-docker-ce-on-a-64bit-ubuntu 28 | 29 | # Add User to Docker Group 30 | 31 | > sudo usermod -aG docker $LOGNAME 32 | 33 | > newgrp docker 34 | 35 | # Build Unique Bible App docker image 36 | 37 | > git clone https://github.com/eliranwong/uniquebibleapp-webtop.git 38 | 39 | > cd uniquebibleapp-webtop 40 | 41 | > sudo docker build -t uniquebibleapp . 42 | 43 | # Run docker image 44 | 45 | e.g. uniquebibleapp 46 | 47 | > sudo docker run -d --name=uniquebibleapp --security-opt seccomp=unconfined -e PUID=1000 -e PGID=1000 -e TZ=Europe/London -e SUBFOLDER=/ -e KEYBOARD=en-gb-qwerty -p 3000:3000 -v ~/uniquebibleapp-webtop:/config -v /var/run/docker.sock:/var/run/docker.sock --shm-size="1gb" --restart unless-stopped uniquebibleapp 48 | 49 | # Share docker image 50 | 51 | e.g. uniquebibleapp image 52 | 53 | Create a repository at https://hub.docker.com/ 54 | 55 | > sudo docker login -u username 56 | 57 | Enter password 58 | 59 | > sudo docker tag uniquebibleapp [username]/uniquebibleapp 60 | 61 | > sudo docker push [username]/uniquebibleapp 62 | 63 | # Remove Unique Bible App docker image 64 | 65 | > sudo docker rm -f uniquebibleapp 66 | 67 | Check uniquebibleapp image id with: 68 | 69 | > sudo docker images 70 | 71 | Remove image file 72 | 73 | > sudo docker rmi [imageid] 74 | 75 | Remove uniquebibleapp data, depending on what local path you specified in docker build command, e.g.: 76 | 77 | > rm -rf ~/uniquebibleapp-webtop 78 | 79 | # Check storage 80 | 81 | * Check Chrome OS Linux container storage 82 | 83 | > df -h 84 | 85 | * Check docker storage 86 | 87 | > docker system df 88 | 89 | # Clean docker all types of cache 90 | 91 | > docker system prune --volumes 92 | 93 | More at: 94 | 95 | https://renehernandez.io/snippets/cleaning-local-docker-cache/ 96 | -------------------------------------------------------------------------------- /development/flutter_doctor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eliranwong/ChromeOSLinux/a2843c09f5783ba392f0e268a10ce660bb31bb3f/development/flutter_doctor.png -------------------------------------------------------------------------------- /development/git.md: -------------------------------------------------------------------------------- 1 | # git 2 | 3 | https://guides.github.com/ 4 | 5 | https://guides.github.com/introduction/git-handbook/ 6 | 7 | # Global Configuration 8 | 9 | > git config --global user.name myusername 10 | 11 | > git config --global user.email myusername@email.com 12 | 13 | # User Configurations 14 | 15 | Edit file ~/.gitconfig 16 | 17 | > nano ~/.gitconfig 18 | 19 | * [user]
20 | * username = myusername
21 | * email = myusername@email.com 22 | 23 | # Common Commands 24 | 25 | e.g. 26 | 27 | > git add README.md 28 | 29 | > git commit -m "update file(s)" 30 | 31 | > git push 32 | 33 | or 34 | 35 | > git push --set-upstream origin main 36 | 37 | or 38 | 39 | > git push -u origin main 40 | 41 | or 42 | 43 | > git push --set-upstream origin main 44 | 45 | To manage branches: 46 | 47 | To create: 48 | 49 | > git checkout -b new_branch 50 | 51 | To switch to a remote branch: 52 | 53 | > git branch -r 54 | 55 | > git checkout branch_name 56 | 57 | To delete: 58 | 59 | > git branch -D branch_name 60 | 61 | To list all non-staged files: 62 | 63 | > git ls-files --other --modified --exclude-standard 64 | 65 | To overwrite changes in local files: 66 | 67 | > git fetch --all 68 | 69 | > git reset 70 | 71 | Trouble-shoot hanging for pushing large files: 72 | 73 | > git config --global http.postBuffer 157286400 74 | 75 | read more about this solution at https://stackoverflow.com/questions/15843937/git-push-hangs-after-total-line 76 | 77 | # Discard Local Changes 78 | 79 | There are different ways to discard local changes and pull the latest changes from the GitHub repository, depending on your situation and preference. Here are some common methods: 80 | 81 | - If you want to discard all local changes and commits that are not pushed to the remote repository, you can use `git reset --hard` followed by `git pull`. This will reset your local repository to the same state as the remote repository and then pull the latest changes. For example¹²: 82 | 83 | ```bash 84 | git reset --hard 85 | git pull 86 | ``` 87 | 88 | - If you want to discard only local changes that are not committed, but keep your local commits that are not pushed to the remote repository, you can use `git checkout .` followed by `git pull`. This will revert all modified files to their original state and then pull the latest changes. For example²: 89 | 90 | ```bash 91 | git checkout . 92 | git pull 93 | ``` 94 | 95 | - If you want to temporarily save your local changes and apply them later, after pulling the latest changes from the remote repository, you can use `git stash` followed by `git pull` and `git stash pop`. This will store your local changes in a stash, update your local repository with the remote changes, and then reapply your stashed changes. For example²: 96 | 97 | ```bash 98 | git stash 99 | git pull 100 | git stash pop 101 | ``` 102 | 103 | # Create Pull Request 104 | 105 | ``` 106 | Editing a GitHub repository and creating a pull request involves several steps. Here’s a detailed guide to help you through the process: 107 | 108 | ### Step 1: Fork the Repository 109 | 1. **Navigate to the Repository**: Go to the GitHub repository you want to contribute to. 110 | 2. **Fork the Repository**: Click the "Fork" button at the top right corner of the repository page. This will create a copy of the repository under your GitHub 111 | account. 112 | 113 | ### Step 2: Clone the Forked Repository 114 | 1. **Clone the Repository**: Open your terminal or command prompt. 115 | 2. **Get the Repository URL**: Go to your forked repository on GitHub, click the "Code" button, and copy the URL (either HTTPS or SSH). 116 | 3. **Run the Clone Command**: 117 | ```bash 118 | git clone https://github.com/your-username/repository-name.git 119 | ``` 120 | Replace `your-username` with your GitHub username and `repository-name` with the name of the repository. 121 | 122 | ### Step 3: Create a New Branch 123 | 1. **Navigate to the Repository Directory**: 124 | ```bash 125 | cd repository-name 126 | ``` 127 | 2. **Create and Switch to a New Branch**: 128 | ```bash 129 | git checkout -b your-branch-name 130 | ``` 131 | Replace `your-branch-name` with a descriptive name for your branch. 132 | 133 | ### Step 4: Make Your Changes 134 | 1. **Edit the Code**: Open the files you want to edit in your preferred code editor and make your changes. 135 | 2. **Save Your Changes**: Save the files after making the necessary modifications. 136 | 137 | ### Step 5: Commit Your Changes 138 | 1. **Stage the Changes**: 139 | ```bash 140 | git add . 141 | ``` 142 | This stages all the changes. You can also stage specific files by replacing `.` with the file names. 143 | 2. **Commit the Changes**: 144 | ```bash 145 | git commit -m "Your commit message" 146 | ``` 147 | Replace `"Your commit message"` with a descriptive message about the changes you made. 148 | 149 | ### Step 6: Push the Changes to GitHub 150 | 1. **Push the Changes**: 151 | ```bash 152 | git push origin your-branch-name 153 | ``` 154 | Replace `your-branch-name` with the name of your branch. 155 | 156 | ### Step 7: Create a Pull Request 157 | 1. **Go to Your Forked Repository on GitHub**: Navigate to your forked repository on GitHub. 158 | 2. **Compare & Pull Request**: You should see a prompt to create a pull request for the branch you just pushed. Click the "Compare & pull request" button. 159 | 3. **Fill Out the Pull Request Form**: 160 | - **Title**: Provide a descriptive title for your pull request. 161 | - **Description**: Add a detailed description of the changes you made and why they are necessary. 162 | 4. **Create the Pull Request**: Click the "Create pull request" button. 163 | 164 | ### Step 8: Respond to Feedback 165 | 1. **Monitor the Pull Request**: Keep an eye on your pull request for any feedback or requested changes from the repository maintainers. 166 | 2. **Make Additional Changes if Needed**: If changes are requested, make the necessary edits, commit them, and push them to the same branch. The pull request will 167 | automatically update with your new commits. 168 | 169 | ### Step 9: Merge the Pull Request (if you have permissions) 170 | 1. **Merge the Pull Request**: If you have the necessary permissions and the pull request is approved, you can merge it. Otherwise, the repository maintainers will 171 | handle the merge. 172 | 173 | ### Additional Tips 174 | - **Stay Updated**: Regularly pull changes from the original repository to keep your fork up-to-date. 175 | ```bash 176 | git remote add upstream https://github.com/original-owner/repository-name.git 177 | git fetch upstream 178 | git merge upstream/main 179 | ``` 180 | Replace `main` with the default branch of the original repository if it's different. 181 | 182 | By following these steps, you can effectively contribute to a GitHub repository and create a pull request. 183 | ``` 184 | -------------------------------------------------------------------------------- /development/go.md: -------------------------------------------------------------------------------- 1 | # Install Go 2 | 3 | https://go.dev/doc/install 4 | 5 | For example, install go version go1.19.4 linux/amd64 6 | 7 | > wget https://go.dev/dl/go1.19.4.linux-amd64.tar.gz 8 | 9 | > sudo rm -rf /usr/local/go 10 | 11 | > sudo tar -C /usr/local -xzf go1.19.4.linux-amd64.tar.gz 12 | 13 | > echo "PATH=$HOME/go/bin:/usr/local/go/bin:$PATH" >> ~/.profile 14 | 15 | # Install Fyne 16 | 17 | > sudo apt install gcc libgl1-mesa-dev xorg-dev 18 | 19 | > go install fyne.io/fyne/v2/cmd/fyne@latest 20 | 21 | > go install fyne.io/fyne/v2/cmd/fyne_demo@latest 22 | 23 | # Install Fyne Module in a Project 24 | 25 | > go get fyne.io/fyne/v2 26 | 27 | > go mod tidy 28 | 29 | # Set GOPATH 30 | 31 | https://github.com/golang/go/wiki/SettingGOPATH#zsh 32 | -------------------------------------------------------------------------------- /development/google_cloud_cli: -------------------------------------------------------------------------------- 1 | # Google Cloud CLI 2 | 3 | https://cloud.google.com/sdk/docs/install-sdk 4 | -------------------------------------------------------------------------------- /development/nvm_node.md: -------------------------------------------------------------------------------- 1 | # nvm 2 | 3 | Read https://github.com/nvm-sh/nvm for the latest script for installation 4 | 5 | > wget -qO- [the_latest_script] | bash
6 | > source .bashrc 7 | 8 | # node 9 | 10 | > nvm install node -------------------------------------------------------------------------------- /development/pip.md: -------------------------------------------------------------------------------- 1 | Trouble-shouting - There was an error checking the latest version of pip 2 | 3 | First, try: 4 | 5 | > python3 -m pip install --upgrade pip 6 | 7 | If upgrading pip makes no difference, try to clear the pip caches: 8 | 9 | ## Linux 10 | 11 | Run this command in the terminal. 12 | 13 | > rm -r ~/.cache/pip/selfcheck/ 14 | 15 | ## OSX 16 | 17 | Run this command in the terminal. 18 | 19 | > rm -r ~/Library/Caches/pip/selfcheck/ 20 | 21 | ## Windows 22 | 23 | Run this using PowerShell. 24 | 25 | > rm -r $env:LOCALAPPDATA\pip\cache\selfcheck\ 26 | -------------------------------------------------------------------------------- /development/python_gtk3.md: -------------------------------------------------------------------------------- 1 | # Setup 2 | 3 | Try: 4 | 5 | > pip3 install PyGObject 6 | 7 | If the pip package cannot be installed, use: 8 | 9 | > sudo apt install -y python-gi-dev 10 | 11 | # Examples 12 | 13 | Tutorials: https://python-gtk-3-tutorial.readthedocs.io/en/latest/introduction.html 14 | 15 | Webkit2: https://stackoverflow.com/a/63381347 16 | -------------------------------------------------------------------------------- /development/qt.md: -------------------------------------------------------------------------------- 1 | # Install Qt 2 | 3 | # Online Installer 4 | 5 | 1. Download online installer at: https://download.qt.io/official_releases/online_installers/qt-unified-linux-x64-online.run 6 | 2. Add permission: 7 | > chmod +x qt-unified-linux-*.run 8 | 3. Run installer: 9 | > ./qt-unified-linux-*.run 10 | 11 | # Debian Packages 12 | 13 | > sudo apt-get --no-install-recommends install libqt\*5-dev qt\*5-dev qml-module-qtquick-* qt*5-doc-html libqt5xml5 libqt5x11extras5 libqt5x11extras5-dev 14 | 15 | # Qt6 for Python 16 | 17 | > cd $HOME 18 | 19 | > mkdir playqt6 20 | 21 | > cd playqt6 22 | 23 | > python3 -m venv venv 24 | 25 | > source venv/bin/activate 26 | 27 | > pip3 install PySide6 28 | 29 | > echo 'alias qt6examples="source $HOME/playqt6/venv/bin/activate && cd $HOME/playqt6/venv/lib/python3.10/site-packages/PySide6/examples"' >> $HOME/.bashrc 30 | 31 | # Tutorials 32 | 33 | https://doc.qt.io/qtforpython/ 34 | 35 | https://www.pythonguis.com/pyside6/ 36 | 37 | https://doc.qt.io/qtforpython/ 38 | 39 | # Package with PyInstaller 40 | 41 | > pip3 install --upgrade PyInstaller pyinstaller-hooks-contrib 42 | 43 | Read https://doc.qt.io/qtforpython/deployment-pyinstaller.html 44 | -------------------------------------------------------------------------------- /development/screenshot_connect_chromebook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eliranwong/ChromeOSLinux/a2843c09f5783ba392f0e268a10ce660bb31bb3f/development/screenshot_connect_chromebook.png -------------------------------------------------------------------------------- /development/svelte.md: -------------------------------------------------------------------------------- 1 | # Setup a Project 2 | 3 | > npm create svelte@latest myproject 4 | (select 'Skeleton project') 5 | 6 | > cd myproject 7 | 8 | > npm install 9 | 10 | > npm run dev -- --open 11 | -------------------------------------------------------------------------------- /development/ubuntu.md: -------------------------------------------------------------------------------- 1 | # Install Ubuntu on Pixelbook Go 2 | 3 | ## Prepare a USB for Ubuntu Installation 4 | 5 | Read https://ubuntu.com/tutorials/install-ubuntu-desktop#3-create-a-bootable-usb-stick 6 | 7 | ## Enable Developer Mode 8 | 9 | Warning: Enabling Developer Mode erases all existing data! 10 | 11 | 1. back up data first 12 | 2. Press "Esc+Refresh+Power" 13 | 3. Ctrl+D 14 | 4. Enter 15 | 5. Ctrl+D 16 | 17 | ## Enabling Debugging Features 18 | 19 | 1. Select "Enable Debugging Features in set up screen 20 | 2. Enter root password 21 | 22 | ## Log in Deveoper Console 23 | 24 | 1. Press "Ctrl+Alt+T" to launch terminal 25 | 2. Run: 26 | > shell 27 | 3. Press "Ctrl+Alt+F2/Refresh" 28 | 4. Enter login: 29 | > root 30 | 5. Enter password that was set in enabling debugging features 31 | 32 | ## Enable Booting from USB 33 | 34 | > enable_dev_usb_boot 35 | 36 | > sudo crossystem dev_boot_usb=1 37 | 38 | > sudo crossystem dev_boot_altfw=1 39 | 40 | ## Install Alternative Bootloader 41 | 42 | Run: 43 | 44 | > cd; curl -LO mrchromebox.tech/firmware-util.sh && sudo bash firmware-util.sh 45 | 46 | Select "1" 47 | 48 | Remarks: For dual boot, read https://askubuntu.com/questions/1468964/how-to-install-ubuntu-on-an-intel-amd-chromebook-google-pixelbook-2017 49 | 50 | ## Reboot 51 | 52 | 1. Insert Ubuntu installation USB and reboot 53 | 2. At startup white screen, press "Ctrl+L" 54 | 3. Press "1" 55 | 4. Follow instructions about Ubuntu Installation 56 | 5. Remove Ubuntu installation USB and reboot 57 | 58 | ## Start Ubuntu 59 | 60 | 1. Press "Ctrl+L" at white screen 61 | 2. Press "1" 62 | 63 | ## Try to Fix Ubuntu Audio 64 | 65 | > git clone https://github.com/WeirdTreeThing/chromebook-linux-audio 66 | 67 | > cd chromebook-linux-audio 68 | 69 | > ./setup-audio 70 | 71 | # References 72 | 73 | https://www.wikihow.com/Enable-USB-Booting-on-Chromebook 74 | 75 | https://chromium.googlesource.com/chromiumos/docs/+/master/developer_mode.md#Booting-from-USB-or-SD-card 76 | 77 | https://chromium.googlesource.com/chromiumos/docs/+/master/developer_mode.md#:~:text=By%20default%2C%20you%20can%20login,you%20can%20set%20a%20password 78 | 79 | https://logmeonce.com/resources/2023/07/26/enable-debugging-features-chromebook-root-password/ 80 | 81 | https://mrchromebox.tech/#chromeos 82 | 83 | https://askubuntu.com/questions/1468964/how-to-install-ubuntu-on-an-intel-amd-chromebook-google-pixelbook-2017 84 | 85 | -------------------------------------------------------------------------------- /development/vs_code.md: -------------------------------------------------------------------------------- 1 | # Install gnome-keyring (optional but recommended) 2 | 3 | > sudo apt install -y gnome-keyring 4 | 5 | # Download 6 | 7 | Check CPU and download a suitable package: 8 | 9 | > dpkg --print-architecture 10 | 11 | https://code.visualstudio.com/download 12 | 13 | # Opt out of reporting [optional] 14 | 15 | search "telemetry" in preferences and uncheck options. 16 | -------------------------------------------------------------------------------- /development/wine.md: -------------------------------------------------------------------------------- 1 | # Install Wine 2 | 3 | Read https://wine.htmlvalidator.com/install-wine-on-debian-11.html 4 | -------------------------------------------------------------------------------- /display/wayland.md: -------------------------------------------------------------------------------- 1 | # Wayland 2 | 3 | This wiki page describe settings for wayland. 4 | 5 | Remarks: use xcb instead of wayland on touchscreen devices, as some qt applications do not work with wayland on touchscreen devices. 6 | 7 | # Additional packages 8 | 9 | > sudo apt install -y libglfw3-wayland xwayland qtwayland5 qt5ct clipman wl-clipboard weston mutter 10 | 11 | # environment.d 12 | 13 | > sudo nano /etc/environment.d/100-im.config 14 | 15 | QT_QPA_PLATFORM="wayland;xcb"
16 | QT_QPA_PLATFORMTHEME=qt5ct
17 | CLUTTER_BACKEND=wayland
18 | SDL_VIDEODRIVER=x11 19 | 20 | # bashrc 21 | 22 | > nano ~/.bashrc 23 | 24 | add the following lines: 25 | 26 | export QT_QPA_PLATFORM="wayland;xcb"
27 | export QT_QPA_PLATFORMTHEME=qt5ct
28 | export CLUTTER_BACKEND=wayland
29 | export SDL_VIDEODRIVER=x11
30 | xrdb -load .Xsession 31 | 32 | # config 33 | 34 | > nano ~/.config/electron-flags.conf 35 | 36 | add the following lines (without empty lines): 37 | 38 | --enable-features=WaylandWindowDecorations
39 | --ozone-platform-hint=auto 40 | 41 | # Troubleshot Qt Applications 42 | 43 | Known issues: 44 | * Changing accessiblity settings, like "Large mouse cursor", after Linux virtual machine is created can cause display issues with some gui applications. Some gui applications keep close and reopen and make them unusable. 45 | 46 | * Some qt applications run with the following error. It is possible that there is a bug that comes with the built-in wayland compositor as the error message indicates, e.g.: 47 | 48 | qt.qpa.wayland: Ignoring unexpected wl_surface.enter received for output with id: 7 screen name: "Screen5" screen model: "202B" This is most likely a bug in the compositor. 49 | 50 | * Some Qt applications does not work on touchscreen devices with wayland. For example, https://github.com/eliranwong/UniqueBible/wiki/QT_QPA_PLATFORM#touchscreen-users 51 | 52 | * https://github.com/eliranwong/ChromeOSLinux/blob/main/troubleshooting/qt.qpa.plugin_cannot_load_xcb.md 53 | 54 | Workaround: 55 | 56 | If a particular Qt application does not work with wayland, run it with: 57 | 58 | > env QT_QPA_PLATFORM=xcb [application] 59 | 60 | # Troubleshot GTK Applications 61 | 62 | If a particular GTK application does not work with wayland, run it with: 63 | 64 | > env GDK_BACKEND=x11 [application] 65 | 66 | # Troubleshot Rust Applications 67 | 68 | If a particular Rust application does not work with wayland, run it with: 69 | 70 | > env WINIT_UNIX_BACKEND=x11 [application] 71 | 72 | # Reference 73 | 74 | https://wiki.debian.org/Wayland 75 | 76 | https://wiki.archlinux.org/title/wayland 77 | -------------------------------------------------------------------------------- /input_method/fcitx.md: -------------------------------------------------------------------------------- 1 | # fcitx on Chrome OS Crostini 2 | 3 | [updated on 30DEC2022; Chrome OS version: 108.0.5359.111] 4 | 5 | This article describe how to set up fcitx5 / fcitx on Chrome OS Linux container, Crostini. 6 | 7 | [ ibus works better than fcitx on WSL2. If you use WSL2, you may read the following article on setting up ibus for WSL2:
8 | https://github.com/eliranwong/wsl2/blob/master/input_method/ibus.md ] 9 | 10 | # Locale [optional / essential] 11 | 12 | It is optional, becuase users don't need Chinese locale pack(s) for display of Chinese characters.
13 | 14 | An example: 15 | 16 | To edit /etc/locale.gen, run: 17 | 18 | > sudo nano /etc/locale.gen 19 | 20 | Use ctrl + w key combination to locate "zh_CN.UTF8 UTF8" and uncomment it, by removing the # sign at the beginning of the line. 21 | 22 | To download the newly selected language package(s), run: 23 | 24 | > sudo locale-gen 25 | 26 | # Set Default Locale [optional] 27 | 28 | This changes default application menu & interface to Chinese. It is optional. 29 | 30 | 1) To configure default language, run in terminal: sudo dpkg-reconfigure locales 31 | 2) select "zh_CN.UTF8 UTF8" as default locale 32 | 33 | Add variable for running applications launched through entering cmmands in terminal: 34 | 35 | Use text editor to edit file ~/.bashrc, for example: 36 | 37 | > nano ~/.bashrc 38 | 39 | Add the following lines at the end of the file: 40 | 41 | > export LC_ALL="zh_CN.UTF-8"
42 | 43 | In nano, Ctrl+O to save, Ctrl+X to exit. 44 | 45 | Close and re-open terminal to make changes effective. 46 | 47 | Add variable for running applications launched through Chrome OS launcher menu: 48 | 49 | Use text editor to edit file /etc/systemd/user/cros-garcon.service.d/cros-garcon-override.conf, for example: 50 | 51 | > sudo nano /etc/systemd/user/cros-garcon.service.d/cros-garcon-override.conf 52 | 53 | Add the following lines at the end of the file: 54 | 55 | Environment="LC_ALL=zh_CN.UTF-8"
56 | 57 | In nano, Ctrl+O to save, Ctrl+X to exit. 58 | 59 | Close and re-open terminal to make changes effective. 60 | 61 | [Remarks: This file might be overwritten in future updates.] 62 | 63 | # Fonts 64 | 65 | Install available Chinese font packages [essential]:
66 | 67 | > sudo apt install xfonts-wqy ttf-wqy-zenhei ttf-wqy-microhei fonts-arphic-bkai00mp fonts-arphic-bsmi00lp fonts-arphic-gbsn00lp fonts-arphic-gkai00mp xfonts-intl-chinese xfonts-intl-chinese-big 68 | 69 | Install user fonts [optional]:
70 | [It is optional, but you may consider it for WPS office to display characters properly.]
71 | For example, put all fonts in a folder "MyFonts" in "Downloads", then enter in terminal: 72 | 73 | > mkdir ~/.fonts
74 | > cp -r /mnt/chromeos/MyFiles/Downloads/MyFonts/ ~/.fonts/
75 | > fc-cache -f -v
76 | 77 | Check all installed font list 78 | 79 | >fc-list 80 | 81 | Check installed Chinese font list 82 | 83 | > fc-list :lang=zh | cut -d: -f2
84 | > fc-list :lang=zh | cut -d: -f1
85 | > fc-list -f '%{family}\n' :lang=zh
86 | 87 | # Input Method - fcitx5 and fcitx 88 | 89 | 1. Install both fcitx5 and fcitx:
90 | > sudo apt install -y fcitx fcitx-frontend* fcitx-lib* libfcitx* fcitx-googlepinyin fcitx-table-cangjie5 opencc fcitx5* kde-config-fcitx5 gnome-shell-extension-kimpanel libime-bin libime-bin 91 | 92 | Aternately, if you want fcitx5 only:
93 | > sudo apt install -y fcitx5 libfcitx5utils2 libfcitx5core7 libfcitx5config6 kde-config-fcitx5 kde-config-fcitx5 fcitx5-config-qt 94 | 95 | # Before You Continue 96 | 97 | Choose EITHER fcitx5 or fcitx! 98 | 99 | DO NOT RUN BOTH AT THE SAME TIME! 100 | 101 | # Set up fcitx5 102 | 103 | DO NOT run both fcitx and fcitx5 AT THE SAME TIME! 104 | 105 | 1. Configure fcitx5 as default input:
106 | 107 | > sudo apt install im-config 108 | 109 | > im-config
110 | 111 | select "OK"
112 | select "Yes"
113 | select "fcitx5"
114 | select "OK"
115 | 116 | 2. Add Variables 117 | 118 | (You may also read https://github.com/eliranwong/ChromeOSLinux/blob/main/README.md#use-fcitx-in-gui-applications) 119 | 120 | For running applications launched through entering cmmands in terminal: 121 | 122 | Use text editor to edit file ~/.bashrc, for example: 123 | 124 | > nano ~/.bashrc 125 | 126 | Add the following lines at the end of the file: 127 | 128 | export LC_CTYPE=zh_CN.UTF-8
129 | export XIM=fcitx5
130 | export XIM_PROGRAM=/usr/bin/fcitx5
131 | export GTK_IM_MODULE=fcitx5
132 | export QT_IM_MODULE=fcitx5
133 | export XMODIFIERS=@im=fcitx5 134 | 135 | In nano, Ctrl+O to save, Ctrl+X to exit. 136 | 137 | Close and re-open terminal to make changes effective. 138 | 139 | For running applications launched through Chrome OS launcher menu: 140 | 141 | > mkdir mkdir ~/.config/environment.d 142 | 143 | > nano ~/.config/environment.d/im.config 144 | 145 | Write and save the following lines: 146 | 147 | LC_CTYPE=zh_CN.UTF-8
148 | XIM=fcitx5
149 | XIM_PROGRAM=/usr/bin/fcitx5
150 | GTK_IM_MODULE=fcitx5
151 | QT_IM_MODULE=fcitx5
152 | XMODIFIERS=@im=fcitx5 153 | 154 | In nano, Ctrl+O to save, Ctrl+X to exit. 155 | 156 | Restart Linux container to make changes effective. 157 | 158 | [Remarks: This file might be overwritten in Chrome OS future updates.] 159 | 160 | 3. Setup autostart of "fcitx5" service 161 | 162 | > sudo apt install -y exo-utils 163 | 164 | > echo "/usr/bin/fcitx5 -d -s 5 > /dev/null 2>&1" >> ~/.sommelierrc 165 | 166 | Restart Linux to make changes effective.
167 | 168 | 4. Setup keyboards 169 | 170 | IMPORTANT! Please make sure fcitx5 service is running first. RESTART Linux container AFTER the step 3 above. 171 | 172 | Run: 173 | 174 | > fcitx5-config-qt 175 | 176 | For example, to add "Pinyin":
177 | Select the "+" button, located at the left lower button, to add input methods.
178 | Uncheck "Only Show Current Language"
179 | Enter "Pinyin" in search field
180 | Select "Pinyin" and click the left arrow to add 181 | 182 | To add more input methods, e.g. pinyin:
183 | > sudo apt install -y fcitx5-module-cloudpinyin fcitx5-module-pinyinhelper fcitx5-pinyin fcitx5-chinese-addons fcitx5-chinese-addons-bin fcitx5-chinese-addons-data 184 | 185 | # Set up fcitx 186 | 187 | DO NOT run both fcitx and fcitx5 AT THE SAME TIME! 188 | 189 | 1. Configure fcitx as default input:
190 | 191 | > sudo apt install im-config 192 | 193 | > im-config
194 | 195 | select "OK"
196 | select "Yes"
197 | select "fcitx"
198 | select "OK"
199 | select "OK" 200 | 201 | 2. Add Variables 202 | 203 | (You may also read https://github.com/eliranwong/ChromeOSLinux/blob/main/README.md#use-fcitx-in-gui-applications) 204 | 205 | For running applications launched through entering cmmands in terminal: 206 | 207 | Use text editor to edit file ~/.bashrc, for example: 208 | 209 | > nano ~/.bashrc 210 | 211 | Add the following lines at the end of the file: 212 | 213 | export LC_CTYPE=zh_CN.UTF-8
214 | export XIM=fcitx
215 | export XIM_PROGRAM=/usr/bin/fcitx
216 | export GTK_IM_MODULE=fcitx
217 | export QT_IM_MODULE=fcitx
218 | export XMODIFIERS=@im=fcitx 219 | 220 | In nano, Ctrl+O to save, Ctrl+X to exit. 221 | 222 | Close and re-open terminal to make changes effective. 223 | 224 | For running applications launched through Chrome OS launcher menu: 225 | 226 | Use text editor to edit file /etc/systemd/user/cros-garcon.service.d/cros-garcon-override.conf, for example: 227 | 228 | > sudo nano /etc/systemd/user/cros-garcon.service.d/cros-garcon-override.conf 229 | 230 | Add the following lines at the end of the file: 231 | 232 | Environment="LC_CTYPE=zh_CN.UTF-8"
233 | Environment="XIM=fcitx"
234 | Environment="XIM_PROGRAM=/usr/bin/fcitx"
235 | Environment="GTK_IM_MODULE=fcitx"
236 | Environment="QT_IM_MODULE=fcitx"
237 | Environment="XMODIFIERS=@im=fcitx" 238 | 239 | In nano, Ctrl+O to save, Ctrl+X to exit. 240 | 241 | Close and re-open terminal to make changes effective. 242 | 243 | [Remarks: This file might be overwritten in Chrome OS future updates.] 244 | 245 | 3. Setup autostart of "fcitx" service 246 | 247 | > echo "/usr/bin/fcitx-autostart > /dev/null 2>&1" >> ~/.sommelierrc 248 | 249 | Restart Linux to make changes effective.
250 | 251 | [Description on /dev/null: https://medium.com/@codenameyau/step-by-step-breakdown-of-dev-null-a0f516f53158]
252 | [Description on 2>&1: https://www.brianstorti.com/understanding-shell-script-idiom-redirect/]
253 | 254 | 4. Setup keyboards 255 | 256 | IMPORTANT! Please make sure fcitx service is running first. RESTART Linux container AFTER the step 3 above. 257 | 258 | Run terminal: 259 | 260 | > fcitx-config-gtk3 261 | 262 | Select the "+" button, located at the left lower button, to add input methods.
263 | Uncheck "Only Show Current Language"
264 | Add "Google Pinyin" for typing simplified Chinese directly
265 | Add "Cangjie5" for typing traditional Chinese directly
266 | If you want only one Chinese keyboard for typing both traditional & simplified Chinese, you may choose "Google Pinyin". Use "ctrl + shift +f" key combination to switch between traditional and simplified Chinese inputs. 267 | 268 | # Default Key Combination 269 | 270 | ctrl + SPACE => switch between input methods 271 | 272 | ctrl + shift + f => switch between Traditional and Simplified Chinese 273 | 274 | To change these settings for fcitx5, run: 275 | 276 | > fcitx5-config-qt 277 | 278 | To change these settings for fcitx, run: 279 | 280 | > fcitx-config-gtk3 281 | 282 | # Troubleshooting 1: fcitx does not work with Terminal closed 283 | 284 | You may find fcitx works with gui applications only when Terminal app is opened. One possible reason is that you have fcitx-autostart placed in ~/.bashrc or ~/.profile. 285 | 286 | Solution: 287 | 288 | Put the command to auto-start fcitx service in file ~/.sommelierrc instead: 289 | 290 | > echo "/usr/bin/fcitx-autostart > /dev/null 2>&1" >> ~/.sommelierrc 291 | 292 | # Troubleshooting 2: Input selection panel is hidden "sometimes" 293 | 294 | fcitx behaves in 3 possible ways with gui applications on Chrome OS: 295 | 296 | 1) fcitx works as expected 297 | 2) Input selection panel is hidden, any input always take the first candidate. 298 | 3) fcitx does not work at all 299 | 300 | Situation (2) may be fixed. Take Chinese pinyin as an example, you may see Chinese characters coming out as you type pinyin, but you cannot select any candidates because the selection panel is hidden. This behaviour makes fcitx unsable for practical reason. However, you may sometimes note that the selection panel works as expected but sometimes not. We puzzled about this behaviour until we observed that when a gui application that can work perfectly with fcitx is opened [i.e. category (1) described above], applications that are in the category (2) describe above work too. It is possible that something have been enabled with those category (1) applications are opened but we have not figured out what exactly that is. [If you know what it is, please kindly let us know.] 301 | 302 | The good news is that we can at least have a workaround to make category (2) applications work as expected by sideloading a category (1) application. For example, if you have urxvt installed, it makes things easier because urxvt works perfectly with fcitx. If you are interested in our notes about urxvt, you may read: 303 | 304 | https://github.com/eliranwong/ChromeOSLinux/blob/main/terminal/rxvt-unicode.md 305 | 306 | To make category (2) applications to work with fcitx, simply launch those applications through urxvt. There are two ways: 307 | 308 | 1) Launch urxvt first, then launch your gui application by running command on urxvt 309 | 310 | 2) Edit .desktop shortcut file to launch urxvt and your application together 311 | 312 | * Edit the file /usr/share/applications/[applicaiton-name].desktop 313 | 314 | * Prefix the entry Exec= with "urxvt -e", for example, change: 315 | 316 | from: 317 | 318 | > Exec=[command-running-your-application] 319 | 320 | to: 321 | 322 | > Exec=urxvt -e [command-running-your-application] 323 | 324 | We have an example for applying this workaround to create a desktop shortcut at:
325 | https://github.com/eliranwong/ChromeOSLinux/blob/main/bible/UniqueBibleApp.md#create-a-shortcut-alias-for-command-line-input 326 | 327 | Alternately, use 'ffocos' as a workaround: https://github.com/eliranwong/ffocos 328 | 329 | # Troubleshooting 3: Installed firefox does not work with fcitx 330 | 331 | Please read our notes at: https://github.com/eliranwong/ChromeOSLinux#browser 332 | 333 | Firefox website recommends users to use flatpak to install firefox, but in order to use fcitx, do not use faltpak to install it. 334 | 335 | # Troubleshooting 4: fcitx does not work on touchscreen devices 336 | 337 | Read https://github.com/eliranwong/ChromeOSLinux/blob/main/README.md#use-fcitx-in-gui-applications 338 | 339 | # Remarks on Running "fcitx" in Crostini 340 | 341 | In our testings, "fcitx" works with the following applications:
342 | Android Studio, WPS office, Dolphin, Thunar, Atom, Geany, Leafpad, etc. 343 | 344 | However, not all applications work nicely with fcitx. 345 | 346 | # Qt5 Applications 347 | 348 | First, make sure you have the right environment variable assigned: 349 | 350 | > export QT_QPA_PLATFORM=xcb 351 | 352 | [You may read an issue of QT_QPA_PLATFORM with fcitx at https://github.com/eliranwong/ChromeOSLinux/blob/main/troubleshooting/qt.qpa.plugin_cannot_load_xcb.md] 353 | 354 | Second, make sure you have "fcitx-frontend-qt5" installed. Check with the following command: 355 | 356 | > apt -qq list fcitx-frontend-qt5 357 | 358 | To work with Qt5 applications, try to copy the files libfcitxplatforminputcontextplugin.so and libfcitx5platforminputcontextplugin.so from /usr/lib/x86_64-linux-gnu/qt5/plugins/platforminputcontexts/ to /Qt/plugins/platforminputcontexts/ folder of Qt5-based applications: 359 | 360 | > cp /usr/lib/x86_64-linux-gnu/qt5/plugins/platforminputcontexts/libfcitxplatforminputcontextplugin.so [ fullpath .../Qt/plugins/platforminputcontexts/libfcitxplatforminputcontextplugin.so ] 361 | 362 | > cp /usr/lib/x86_64-linux-gnu/qt5/plugins/platforminputcontexts/libfcitx5platforminputcontextplugin.so [ fullpath .../Qt/plugins/platforminputcontexts/libfcitx5platforminputcontextplugin.so ] 363 | 364 | We give you an exmaple at: https://github.com/eliranwong/ChromeOSLinux/blob/main/bible/UniqueBibleApp.md#to-use-fcitx-with-uba 365 | 366 | If you find the trick above does not work with all Qt5 applications and if your qt5 application supports virtual keyboard, you may want to use qt virtual keyboard for input instead. You can do that by exporting the following variable: 367 | 368 | > export QT_IM_MODULE="qtvirtualkeyboard" 369 | 370 | # Typing Chinese on Terminal 371 | 372 | You may read our notes at: https://github.com/eliranwong/ChromeOSLinux/blob/main/terminal/rxvt-unicode.md 373 | 374 | # Suplementary packages 375 | 376 | # Use opencc with fcitx to convert between Traditional & Simplified Chinese 377 | 378 | To install opencc:
379 | 380 | > sudo apt install opencc
381 | 382 | To configure opencc:
383 | Enter in Linux terminal: 384 | 385 | > fcitx-config-gtk3
386 | Go to "Addon > Simplified Chinese To Traditional Chinese Convert ..."
387 | Select "OpenCC" and confirm "OK"
388 | 389 | Enable / Disable conversion in apps, like libreoffice:
390 | Ctrl+Shift+f 391 | 392 | Run opencc in terminal 393 | 394 | Simplified Chinese to Traditional Chinese:
395 | > opencc -i inputfile.txt -o outputfile.txt -c s2t.json 396 | 397 | Traditional Chinese to Simplified Chinese
398 | > opencc -i inputfile.txt -o outputfile.txt -c t2s.json 399 | 400 | [More at: https://github.com/BYVoid/OpenCC] 401 | 402 | Custom actions in Thunar File Manager 403 | 404 | Traditional Chinese to Simplified Chinese
405 | > opencc -i %f -o %f_sc.txt -c t2s.json 406 | 407 | Simplified Chinese to Traditional Chinese:
408 | > opencc -i %f -o %f_tc.txt -c s2t.json 409 | 410 | # Use pypinyin to check pinyin on Chinese words 411 | 412 | https://pypi.org/project/pypinyin/ 413 | 414 | To use pypinyin as a direct command in terminal, make sure path is updated: 415 | 416 | > echo "export PATH=$PATH:$HOME/.local/bin/" >> .bashrc 417 | 418 | # Other References 419 | 420 | https://fcitx-im.org/wiki/Setup_Fcitx_5 421 | 422 | https://wiki.debian.org/gnome-chinese-input 423 | 424 | https://wiki.debian.org/InputMethodBuster 425 | -------------------------------------------------------------------------------- /multimedia/annotator.md: -------------------------------------------------------------------------------- 1 | # Annotator 2 | 3 | To install, read https://github.com/phase1geo/Annotator 4 | 5 | To create an alias, run 6 | 7 | > echo "alias annotator=com.github.phase1geo.annotator" >> ~/.bashrc 8 | -------------------------------------------------------------------------------- /multimedia/espeak.md: -------------------------------------------------------------------------------- 1 | # espeak 2 | 3 | espeak is an offline text-to-speech tool. 4 | 5 | # Install espeak 6 | 7 | > sudo apt install espeak -y 8 | 9 | # Check for available language 10 | 11 | > espeak --voices 12 | 13 | # Install Additional Data for eSpeak 14 | 15 | You may get error messages by running the following examples, because some data are not installed: 16 | 17 | > espeak -v zh 你好 18 | 19 | > espeak -v zhy 你好 20 | 21 | Keep reading if you need to install Chinese and Russian data. 22 | 23 | Source of information at: http://espeak.sourceforge.net/data/ 24 | 25 | We found that it is not clear from the link above on how to install additional data, we therefore share some notes. 26 | 27 | Run the following steps to install additional data 28 | 29 | First, download, unzip the source code, and go to directory "dictsource": 30 | 31 | > cd ~/Downloads 32 | 33 | > wget http://sourceforge.net/projects/espeak/files/espeak/espeak-1.48/espeak-1.48.04-source.zip 34 | 35 | > unzip espeak-1.48.04-source.zip 36 | 37 | > cd espeak-1.48.04-source/dictsource/ 38 | 39 | Install additional data on Chinese - Mandarin: 40 | 41 | > wget http://espeak.sourceforge.net/data/zh_listx.zip 42 | 43 | > unzip zh_listx.zip 44 | 45 | > sudo espeak --compile=zh 46 | 47 | Install additional data on Chinese - Cantonese: 48 | 49 | > wget http://espeak.sourceforge.net/data/zhy_list.zip 50 | 51 | > unzip zhy_list.zip 52 | 53 | > sudo espeak --compile=zhy 54 | 55 | Install additional data on Chinese - Russian: 56 | 57 | There are several versions of Russian data. We checked our installed version of espeak is 1.48 by running: 58 | 59 | > espeak --version 60 | 61 | Therefore, we download the 1.48 version of Russian data and install it: 62 | 63 | > wget http://espeak.sourceforge.net/data/ru_dict-48.zip 64 | 65 | > unzip ru_dict-48.zip 66 | 67 | > sudo espeak --compile=ru 68 | 69 | # Install & Setup espeakedit [optional] 70 | 71 | > sudo apt install espeakedit -y 72 | 73 | > mkdir -p ~/espeak-data 74 | 75 | > cp -r /usr/lib/x86_64-linux-gnu/espeak-data/* ~/espeak-data/ 76 | 77 | To run: 78 | 79 | > espeakedit 80 | -------------------------------------------------------------------------------- /multimedia/ffmpeg.md: -------------------------------------------------------------------------------- 1 | MP4 TO MP4 (MEDIUM) 2 | 3 | > ffmpeg -i input.mp4 -b 1000000 output.mp4 4 | 5 | M2TS TO MP4 6 | 7 | > ffmpeg -i input.m2ts -vcodec libx264 -crf 20 -acodec ac3 -vf "yadif" output.mp4 8 | 9 | MP4 TO WEBM (HIGH) 10 | 11 | > ffmpeg -i input.mp4 -aq 5 -ac 2 -qmax 25 -threads 2 output.webm 12 | 13 | MP4 TO WEBM (MEDIUM) 14 | 15 | > ffmpeg -i input.mp4 -aq 5 -ac 2 -qmax 35 -threads 2 output.webm 16 | 17 | MP4 TO OGV (HIGH) 18 | 19 | > ffmpeg -i input.mp4 -vcodec libtheora -acodec libvorbis -q:v 6 -q:a 5 output.ogv 20 | 21 | MP4 TO OGV (MEDIUM) 22 | 23 | > ffmpeg -i input.mp4 -vcodec libtheora -acodec libvorbis -q:v 2 -q:a 4 output.ogv 24 | 25 | WEBM TO MP4 (https://blog.addpipe.com/converting-webm-to-mp4-with-ffmpeg/) 26 | 27 | > ffmpeg -i input.webm output.mp4 28 | -------------------------------------------------------------------------------- /multimedia/gimp.md: -------------------------------------------------------------------------------- 1 | # GIMP Settings 2 | 3 | To make background transparent: 4 | 5 | 1. Open image file 6 | 7 | 2. Layer > Transparency > Add alpha channel 8 | 9 | 3. Use fuzzy selection tool, with the following options checked to select background: 10 | 11 | * Antialiasing 12 | * Feather Edges 13 | * Draw Mask 14 | 15 | 4. Edit > clear 16 | -------------------------------------------------------------------------------- /multimedia/kdenlive.md: -------------------------------------------------------------------------------- 1 | # Kdenlive 2 | 3 | # Install 4 | 5 | 1) Download the AppImage file from https://kdenlive.org/en/download/ 6 | 7 | In our testing, its file is "kdenlive-22.12.0-x86_64.AppImage" 8 | 9 | > cd ~/Downloads 10 | 11 | > chmod +x kdenlive-20.12.1b-x86_64.appimage 12 | 13 | > mkdir -p ~/.Applications 14 | 15 | > mv kdenlive*.appimage ~/.Applications 16 | 17 | > echo "alias kdenlive='env QT_QPA_PLATFORM=xcb ~/.Applications/kdenlive-22.12.0-x86_64.AppImage &>/dev/null & disown'" >> ~/.bashrc 18 | 19 | # Tutorials 20 | 21 | https://www.youtube.com/watch?v=yxxilfDTPK0&list=PLqazFFzUAPc7uQaoGxYwxGLk4_6fQrBvE 22 | 23 | https://userbase.kde.org/Kdenlive/Manual/Timeline/Editing 24 | -------------------------------------------------------------------------------- /multimedia/openshot.md: -------------------------------------------------------------------------------- 1 | # Install 2 | 3 | > sudo apt install openshot 4 | 5 | # Run 6 | 7 | > openshot-qt 8 | 9 | # Create an alias 10 | 11 | > echo "alias openshot='env QT_QPA_PLATFORM=xcb openshot-qt &>/dev/null & disown'" >> ~/.bashrc 12 | 13 | # Learn 14 | 15 | https://cdn.openshot.org/static/files/user-guide/index.html 16 | -------------------------------------------------------------------------------- /multimedia/youtube-dl.md: -------------------------------------------------------------------------------- 1 | # youtube-dl 2 | 3 | To install 4 | 5 | > sudo curl -L https://yt-dl.org/downloads/latest/youtube-dl -o /usr/local/bin/youtube-dl
6 | > sudo chmod a+rx /usr/local/bin/youtube-dl
7 | > sudo apt install ffmpeg 8 | 9 | DO NOT USE "sudo apt install youtube-dl" to install youtube-dl 10 | 11 | # Update 12 | 13 | > youtube-dl -U 14 | 15 | # Examples 16 | 17 | In the following examples, we use a "Amazing Grace" youtube video for illustrations.
18 | The video is available at the following link:
19 | https://www.youtube.com/watch?v=CDdvReNKKuk 20 | 21 | # Example - download video / audio 22 | 23 | To download a video with default format: 24 | 25 | > youtube-dl https://www.youtube.com/watch?v=CDdvReNKKuk 26 | 27 | To download a youtube audio with default format: 28 | 29 | > youtube-dl -x https://www.youtube.com/watch?v=CDdvReNKKuk 30 | 31 | To download video / audio with specific formats, please read examples below: 32 | 33 | # For example, download a video in mp4 34 | 35 | To check available format for a video: 36 | 37 | > youtube-dl -F https://www.youtube.com/watch?v=CDdvReNKKuk 38 | 39 | Terminal output: 40 | 41 | > [youtube] CDdvReNKKuk: Downloading webpage
42 | > [youtube] CDdvReNKKuk: Downloading video info webpage
43 | > [info] Available formats for CDdvReNKKuk:
44 | > format code extension resolution note
45 | > 249 webm audio only tiny 67k , opus @ 50k (48000Hz), 1.79MiB
46 | > 250 webm audio only tiny 83k , opus @ 70k (48000Hz), 2.32MiB
47 | > 140 m4a audio only tiny 130k , m4a_dash container, mp4a.40.2@128k (44100Hz), 4.84MiB
48 | > 251 webm audio only tiny 148k , opus @160k (48000Hz), 4.43MiB
49 | > 160 mp4 256x144 144p 36k , avc1.4d400c, 30fps, video only, 664.49KiB
50 | > 394 mp4 256x144 144p 51k , av01.0.00M.08, 30fps, video only, 1.40MiB
51 | > 133 mp4 426x240 240p 62k , avc1.4d4015, 30fps, video only, 1.19MiB
52 | > 395 mp4 426x240 240p 69k , av01.0.00M.08, 30fps, video only, 2.00MiB
53 | > 242 webm 426x240 240p 84k , vp9, 30fps, video only, 2.10MiB
54 | > 278 webm 256x144 144p 88k , webm container, vp9, 30fps, video only, 1.54MiB
55 | > 134 mp4 640x360 360p 123k , avc1.4d401e, 30fps, video only, 2.64MiB
56 | > 243 webm 640x360 360p 133k , vp9, 30fps, video only, 4.00MiB
57 | > 396 mp4 640x360 360p 156k , av01.0.01M.08, 30fps, video only, 4.19MiB
58 | > 244 webm 854x480 480p 230k , vp9, 30fps, video only, 6.88MiB
59 | > 397 mp4 854x480 480p 233k , av01.0.04M.08, 30fps, video only, 5.53MiB
60 | > 135 mp4 854x480 480p 242k , avc1.4d401f, 30fps, video only, 4.50MiB
61 | > 247 webm 1280x720 720p 525k , vp9, 30fps, video only, 10.81MiB
62 | > 136 mp4 1280x720 720p 528k , avc1.4d401f, 30fps, video only, 8.76MiB
63 | > 18 mp4 640x360 360p 342k , avc1.42001E, mp4a.40.2@ 96k (44100Hz), 12.79MiB (best)
64 | 65 | For example to dowload the last one with format of "mp4 640x360": 66 | 67 | > youtube-dl -f 18 https://www.youtube.com/watch?v=CDdvReNKKuk 68 | 69 | # Example, download a mp4 video file from a YouTube link 70 | 71 | > youtube-dl -f bestvideo[ext=mp4]+bestaudio[ext=m4a]/mp4 https://www.youtube.com/watch?v=CDdvReNKKuk 72 | 73 | # Example, download a mp3 file from a YouTube link 74 | 75 | > youtube-dl -x --audio-format mp3 https://www.youtube.com/watch?v=CDdvReNKKuk 76 | 77 | # Download non-youtube online videos 78 | 79 | You can use youtube-dl to download non-youtube online videos. Use youtube-dl the same way as you use it to download a youtube video. 80 | 81 | Brief instructions to use youtube-dl is available at: 82 | 83 | https://github.com/eliranwong/wsl2/blob/master/multimedia/youtube-dl.md 84 | 85 | # Tested websites: 86 | 87 | https://www.bilibili.com/ 88 | 89 | https://youku.com/ 90 | -------------------------------------------------------------------------------- /multimedia/yt-dlp.md: -------------------------------------------------------------------------------- 1 | # Installation 2 | 3 | https://github.com/yt-dlp/yt-dlp#installation 4 | 5 | # Download mp3 audio: 6 | 7 | > yt-dlp -x --audio-format mp3 [youtube link] 8 | 9 | e.g. 10 | 11 | > yt-dlp -x --audio-format mp3 https://www.youtube.com/watch?v=CDdvReNKKuk 12 | 13 | # Download mp4 video 14 | 15 | > yt-dlp -f bestvideo[ext=mp4]+bestaudio[ext=m4a]/mp4 [youtube link] 16 | 17 | e.g. 18 | 19 | > yt-dlp -f bestvideo[ext=mp4]+bestaudio[ext=m4a]/mp4 https://www.youtube.com/watch?v=CDdvReNKKuk 20 | -------------------------------------------------------------------------------- /multimedia/zoom.md: -------------------------------------------------------------------------------- 1 | # Setup Linux Zoom App 2 | 3 | # Install Dependencies 4 | 5 | > sudo apt install -y libglib2.0-0 libgstreamer-plugins-base1.0-0 libxcb-shape0 libxcb-shm0 libxcb-xfixes0 libxcb-randr0 libxcb-image0 libfontconfig1 libgl1-mesa-glx libxi6 libsm6 libxrender1 libpulse0 libxcomposite1 libxslt1.1 libsqlite3-0 libxcb-keysyms1 libxcb-xtest0 ibus 6 | 7 | # Download Zoom App 8 | 9 | Download Linux Zoom App from https://zoom.us/download?os=linux 10 | 11 | # Install Zoom App 12 | 13 | > sudo apt install ./zoom_amd64.deb 14 | 15 | # Reference 16 | 17 | https://support.zoom.us/hc/en-us/articles/204206269-Installing-or-updating-Zoom-on-Linux 18 | -------------------------------------------------------------------------------- /office/wps.md: -------------------------------------------------------------------------------- 1 | # wps 2 | 3 | We prefer WPS office. It has better compatability with Microsoft documents than libreoffice. 4 | 5 | Download the Linux Deb package from https://www.wps.com/ 6 | 7 | Right click the downloaded deb package and select "Install with Linux (Beta)" 8 | 9 | # Commands to launch office apps: 10 | 11 | > wps
12 | > et
13 | > wpp
14 | > wpspdf 15 | 16 | # Trouble-shooting: missing fonts at launch 17 | 18 | If you are warned of missing fonts when you launch wps, download and install the following fonts for wps 19 | 20 | https://github.com/ferion11/ttf-wps-fonts 21 | 22 | -------------------------------------------------------------------------------- /package_mx/apt.md: -------------------------------------------------------------------------------- 1 | # apt 2 | 3 | To manage packages: 4 | 5 | To show help of "apt" command: 6 | 7 | > apt help 8 | 9 | To display policy: 10 | 11 | > apt policy 12 | 13 | To update package information, upgrade installed packages and install necessary dependencies: 14 | 15 | > sudo apt update && sudo apt dist-upgrade 16 | 17 | To install a package ("-y" below is optional. It simply says "yes".): 18 | 19 | > sudo apt -y install [package] 20 | 21 | To upgrade a package: 22 | 23 | > sudo apt upgrade [package] 24 | 25 | To upgrade a package and install new dependencies if necessary: 26 | 27 | > sudo apt dist-upgrade [package] 28 | 29 | To overwrite an installed old version without upgrading: 30 | 31 | > sudo apt install [package] --no-upgrade 32 | 33 | To remove a package without removing configuration files: 34 | 35 | > sudo apt remove [package] && sudo apt autoremove 36 | 37 | To remove a package together with configuration files: 38 | 39 | > sudo apt purge [package] 40 | 41 | To remove a package, unused packages, and configs: 42 | 43 | > sudo apt --purge autoremove [package] 44 | 45 | To remove old downloaded archive files: 46 | 47 | > sudo apt autoclean 48 | 49 | [apt autoclean removes the retrieved packages from the local cache only while the apt-get autoremove removes the unneeded packages that were once installed as a dependency.] 50 | 51 | To list installed packages: 52 | 53 | > apt list --installed 54 | 55 | To check if a package or packages is/are installed, for examples: 56 | 57 | > apt -qq list fcitx-frontend-qt5 58 | 59 | > apt -qq list fcitx-frontend* 60 | 61 | To list upgradable packages: 62 | 63 | > apt list --upgradable 64 | 65 | To show a package information: 66 | 67 | > apt show [package] 68 | 69 | TO show a package dependency: 70 | 71 | > apt depends [package] 72 | 73 | To search for a package, e.g.: 74 | 75 | > apt search fcitx 76 | 77 | OR 78 | 79 | > apt-cache search fcitx 80 | -------------------------------------------------------------------------------- /package_mx/dpkg.md: -------------------------------------------------------------------------------- 1 | # dpkg 2 | 3 | To check architecture: 4 | 5 | > dpkg --print-architecture 6 | 7 | To install a package: 8 | 9 | > dpkg -i [package-name] 10 | 11 | To remove an already installed package: 12 | 13 | > dpkg -r [package-name] 14 | 15 | To remove an already installed package, together with its configurations: 16 | 17 | > dpkg -P [package-name] 18 | 19 | To list all installed packages: 20 | 21 | > pkg -l 22 | 23 | To make dpkg list contents of a package 24 | 25 | > dpkg --contents [package name] 26 | 27 | To unpack a package without configurations: 28 | 29 | > dpkg --unpack [package-name] 30 | 31 | To configure an unpacked package: 32 | 33 | > dpkg --configure [package-name] 34 | 35 | To check if a package is installed: 36 | 37 | > dpkg -s [package-name] 38 | -------------------------------------------------------------------------------- /package_mx/flatpak.md: -------------------------------------------------------------------------------- 1 | # flatpak 2 | 3 | To enable Flatpak: 4 | 5 | 1) Run on terminal: 6 | 7 | > sudo apt install flatpak -y 8 | 9 | > flatpak --user remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo 10 | 11 | 2) Restart Linux virtual machine 12 | 13 | 14 | To install a package: 15 | 16 | > flatpak install [package-name] 17 | 18 | > flatpak uninstall [package-name] 19 | 20 | You may find flatpak packages at: https://flathub.org 21 | 22 | Remarks: To add environment variable with flatpak, e.g. flatpak run --env=QT_QPA_PLATFORM=wayland APP [ARGUMENT?] 23 | -------------------------------------------------------------------------------- /package_mx/synaptic.md: -------------------------------------------------------------------------------- 1 | # synaptic 2 | 3 | To install synaptic: 4 | 5 | > sudo apt install synaptic 6 | 7 | To run synaptic without root privileges: 8 | 9 | > synaptic-pkexec 10 | 11 | Enable root privileges: 12 | 13 | First give your linux container access to the host display. Please note that chrome OS is the host.]
14 | > xhost +si:localuser:root 15 | 16 | If you do not want to enter the line above each time you run synaptic: 17 | 18 | > echo "xhost +si:localuser:root" >> ~/.profile 19 | 20 | Then, you can run synaptic with sudo command: 21 | 22 | > sudo synaptic 23 | -------------------------------------------------------------------------------- /terminal/rxvt-unicode.md: -------------------------------------------------------------------------------- 1 | # Terminal - urxvt 2 | 3 | The built-in "Terminal" app that comes with Chrome OS is nice, but terrible for typing non-English characters, like Chinese. Chinese characters are misplaced as one type. We need a terminal app that have the following features: 4 | 5 | * good support of copy & paste feature 6 | * support unicode 7 | * works with fcitx (gnome-terminal, unfornately, does not work with fcitx) 8 | * customisable 9 | 10 | "urxvt" matches all the requirements listed above. To install: 11 | 12 | > sudo apt install rxvt-unicode -y 13 | 14 | To customise, edit the file ~/.Xresources: 15 | 16 | > nano ~/.Xresources 17 | 18 | Add the following content to the file:
19 | (Remarks: Use your favourite font by changing "NSimSun", please make sure the font is installed on your system.) 20 | 21 | URxvt.background: #000000
22 | URxvt.foreground: #FFFFFF
23 | URxvt.color4: #1E90FF
24 | URxvt.color12: #0081FF
25 | URxvt.font: xft:NSimSun:pixelsize=36
26 | URxvt.perl-ext-common: selection-to-clipboard
27 | URxvt.letterSpace: 0
28 | 29 | To make the settings effective, edit file ~/.sommelierrc: 30 | 31 | > nano ~/.sommelierrc 32 | 33 | Uncomment by removing the # sign at the beginning of the following lines: 34 | 35 | if [ -f ~/.Xresources ]; then
36 | xrdb -merge ~/.Xresources
37 | fi 38 | 39 | # Copy & Paste 40 | 41 | Select to copy 42 | 43 | "alt + ctrl + v" to paste 44 | -------------------------------------------------------------------------------- /troubleshooting/qt.qpa.plugin_cannot_load_xcb.md: -------------------------------------------------------------------------------- 1 | # Running Qt Applications with Errors 2 | 3 | We found that there is a general issue when we run some qt-based applications on Chrome OS Linux distro, Debian 10. 4 | 5 | The following error messages comes up when we try to launch some qt applications: 6 | 7 | > qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found. 8 | > This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem. 9 | 10 | > Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl, xcb. 11 | 12 | > Aborted (core dumped) 13 | 14 | # Proposed Solutions 15 | 16 | Solution 1 is simpler than solution 2, but solution 1 has some drawbacks on some qt applications. 17 | 18 | You may try solution 1 first. If solution does not work for you, you may try solution 2. 19 | 20 | So far, either of the following solutions solve the issue we mentioned above. 21 | 22 | # Solution 1 23 | 24 | try to run the following command first and see if it works for you: 25 | 26 | > export QT_QPA_PLATFORM=wayland 27 | 28 | If your application works after running this command, you may want to make it more persistant by running the following commands: 29 | 30 | > echo "export QT_QPA_PLATFORM=wayland" >> ~/.bashrc 31 | 32 | > sudo echo "Environment='QT_QPA_PLATFORM=wayland'" >> /etc/systemd/user/cros-garcon.service.d/cros-garcon-override.conf 33 | 34 | The above solution works with some applications. HOWEVER, some other applications have issues with chrome os wayland compositor that: 35 | 36 | 1) main window open and closes repetitively 37 | 38 | 2) input method "fcitx" breaks 39 | 40 | 3) Errors message comes up on terminal indicates that there is possibly a bug in chrome os wayland compositor, e.g. : 41 | 42 | > qt.qpa.wayland: Ignoring unexpected wl_surface.enter received for output with id: 7 screen name: "Screen5" screen model: "202B" This is most likely a bug in the compositor. 43 | 44 | If one of these problems happen with your application, you may try the following solution. 45 | 46 | # Before you continue: 47 | 48 | If you changed the varaible of QT_QPA_PLATFORM to wayland, you may want to change it back to xcb: 49 | 50 | > echo "export QT_QPA_PLATFORM=xcb" >> ~/.bashrc 51 | 52 | > sudo echo "Environment='QT_QPA_PLATFORM=xcb'" >> /etc/systemd/user/cros-garcon.service.d/cros-garcon-override.conf 53 | 54 | # Solution 2 55 | 56 | Simply run the following command to fix the issue: 57 | 58 | > sudo ln -s /usr/lib/x86_64-linux-gnu/libxcb-util.so.0 /usr/lib/x86_64-linux-gnu/libxcb-util.so.1 59 | 60 | Explanation about this solution (if you are interested): 61 | 62 | You may be interested how we comes up with the solution above. We briefly describe below: 63 | 64 | We ran a command: 65 | 66 | > export QT_DEBUG_PLUGINS=1 67 | 68 | Then, we run a qt application which does not work with solution 1 and get the following error message: 69 | 70 | > ...
71 | > Got keys from plugin meta data ("xcb")
72 | > QFactoryLoader::QFactoryLoader() checking directory path "/usr/bin/platforms" ...
73 | > Cannot load library /home/eliranwong/UniqueBible/venv/lib/python3.7/site-packages/PySide2/Qt/plugins/platforms/libqxcb.so: (libxcb-util.so.1: cannot open shared object file: No such file or directory)
74 | > QLibraryPrivate::loadPlugin failed on "/home/eliranwong/UniqueBible/venv/lib/python3.7/site-packages/PySide2/Qt/plugins/platforms/libqxcb.so" : "Cannot load library /home/eliranwong/UniqueBible/venv/lib/python3.7/site-packages/PySide2/Qt/plugins/platforms/libqxcb.so: (libxcb-util.so.1: cannot open shared object file: No such file or directory)"
75 | > qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
76 | > This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
77 | >
78 | > Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl, xcb.
79 | >
80 | > Aborted (core dumped)
81 | 82 | Then, we check if we have "libxcb-util" installed: 83 | 84 | > mlocate libxcb-util 85 | 86 | We get the following result: 87 | 88 | > /usr/lib/x86_64-linux-gnu/libxcb-util.so.0
89 | > /usr/lib/x86_64-linux-gnu/libxcb-util.so.0.0.0 90 | 91 | It appears to us that libxcb-util.so is installed but version does not match. So, we searched and see what version of libxcb-util is available: 92 | 93 | > apt search libxcb-util 94 | 95 | However, only version 0 is available at the moment of writing: 96 | 97 | > libxcb-util0/stable,now 0.3.8-3+b2 amd64 [installed] 98 | 99 | Therefore, we comes up with a solution to create a soft link suggested above. 100 | 101 | So far, all tested applications work with either one of the solutions mentioned above. 102 | --------------------------------------------------------------------------------