Tag Archives: bash

Debian 13 Trixie Xfce4 desktop

Restore Xfce4 to default settings

I run Debian 13 (Trixie) with KDE (on Wayland) as my daily driver for Android development on a Lenovo ThinkPad P50, with Xfce4 alongside mainly for tinkering. As with everything you tinker with, things tend to break along the way.

Here is a script that will restore Xfce to it’s default desktop settings for the current user.

#!/bin/bash
pkill -KILL xfconfd xfce4-panel xfce4-session xfsettingsd xfdesktop 2>/dev/null || true
 
rm -rf ~/.config/xfce4
rm -rf ~/.cache/xfce4
rm -rf ~/.config/xfconf
rm -rf ~/.cache/sessions
rm -rf ~/.local/share/xfce4
rm -rf ~/.local/share/xfce4-panel

Save it as restore_xfce.sh, and make it executable:

chmod +x restore_xfce.sh

Log out of your Xfce session and switch to a virtual console using Ctrl + Alt + F3, log in with your username and password, and run:

./restore_xfce.sh

Switch back to GUI by pressing Alt + F2 or Alt + F1.

ADB

Launch Android app via ADB using a deep link

adb shell am start -W \
  -n <package_name>/<fully_qualified_activity_name> \
  -a android.intent.action.VIEW \
  -c android.intent.category.BROWSABLE \
  -d "<deep_link>"

-W – Blocks activity manager (am) until the launch is finished (or times out) and then prints timing/status info.
-n – Sets the explicit component to launch. Ex: com.mypackage/com.mypackage.MainActivity.
-a – Sets the intent action.
-c – Sets the intent category.
-d – Sets the intent data. Can be anything that the app is configured to handle. Ex: https://mysite.com?action=1

Git: How to remove submodule

Quick tip on how to remove Git submodule.

  1. Remove the relevant line from the .gitmodules file
  2. Delete the relevant section from .git/config (if any)
  3. Run
    git rm --cached path_to_submodule

    (without trailing slash)

  4. Commit and delete the now untracked submodule files.

Git checkouts fail on Windows with “Filename too long error: unable to create file”

Cause

According to the msysgit wiki on GitHub and the related fix this error, Filename too long, comes from a Windows API limitation of file paths having 260 characters or fewer.

Resolution

To resolve this issue, run the following command from GitBash or the Git CMD prompt (as administrator):

git config --system core.longpaths true

This will allow file paths of 4096 characters.