- Chrome-based browsers tend to open new windows within an existing instance, unless Chrome operates using a different data directory.
- To eliminate the toolbar, just set Chrome to open in kiosk mode; however, this action defaults to fullscreen. To address this we add a fakefullscreen and a tile rule in Hyprland.
- Additionally, assigning a specific class allows us to apply this rule universally, rather than configuring it for each application individually.
I manage this by setting up a directory specifically for the Chrome apps' data, which I typically locate at ~/.local/share/chrome-apps. CREATE the directory before running the commands
mkdir -p ~/.local/share/chrome-apps
#!/bin/sh
app=$1
app_id=$2
if [ -z "$app_id" ]; then
chrome --user-data-dir="$XDG_DATA_HOME/chrome-apps/$app" --class=chrome-app
else
chrome --user-data-dir="$XDG_DATA_HOME/chrome-apps/$app" --class=chrome-app --app-id=$app_id --kiosk
fi
- Execute the script using the name of the app you desire (this name only serves as the data directory identifier). For example:
chrome-app WhatsApp
- Chrome will launch; proceed to create a shortcut for your desired application.
- Navigate to ~/.local/share/applications and locate the .desktop file associated with the shortcut.
- Retrieve the ID from the Exec line within the file.
- Run the script again, this time including both the app name and the retrieved ID. Example:
chrome-app WhatsApp MY_COOL_ID
windowrulev2 = fakefullscreen, class:^(chrome-app)$
windowrulev2 = tile, class:^(chrome-app)