Tag Cloud

Tuesday, February 11, 2025

Google Gemini response: Converting webp to TGS (Telegram sticker)

You're right! My apologies, I seem to have gotten stuck on the idea of *static* WEBP.

Even if your WEBP is animated, it still won't be directly usable as a Telegram animated sticker in the TGS format. Here's why:

* Different animation encoding: Animated WEBPs and the TGS format use different methods for storing animation data. TGS relies on the specific structure and data exported by the Bodymovin-TG plugin from After Effects.

* Telegram's requirements: Telegram's sticker system is designed to work with the TGS format for animated stickers. It's not set up to interpret the animation data within an animated WEBP.

So, what can you do with your animated WEBP?

1. Convert to a different format: You could use online tools like Ezgif to convert your animated WEBP to a GIF or MP4 format. These formats might be suitable for sharing in chats or other platforms, but they won't work for Telegram animated stickers.

2. Recreate the animation in After Effects: If you have the original animation assets, the best approach would be to recreate the animation in After Effects and then export it as a TGS file using the Bodymovin-TG plugin. This will ensure that the animation is in the correct format for Telegram.

Key takeaway: Even with an animated WEBP, you'll still need to go through the After Effects and Bodymovin-TG process to create a Telegram-compatible TGS file.

---

You're absolutely right. It's not possible to directly use an animated WEBP as a Telegram animated sticker without a significant amount of rework.

The core issue is the difference in how animation data is stored. Animated WEBPs and TGS files are structured differently. Telegram's system requires the specific output of the Bodymovin-TG plugin for After Effects to create valid TGS files.

So, while it's frustrating to have to essentially recreate your animation, there's no easy workaround. It's a limitation of Telegram's sticker system and how it handles animated content.

It's understandable to feel that it's tedious, and it's definitely not the ideal workflow. Hopefully, Telegram might introduce more flexible formats in the future, but for now, the After Effects/Bodymovin-TG route is the only reliable way to get animated stickers onto the platform.

In a nutshell: animated stickers from whatsapp cannot be easily ported to telegram.

Tuesday, February 04, 2025

Google Gemini Assist: Create a Firefox toggle (launch/quit) button using AutoHotkey

A workaround to creating a toolbar button to quit Firefox.

Welcome file

Let’s review the process of creating a Firefox toggle (launch/quit) button using AutoHotkey, step by step:

1. Install AutoHotkey:

  • If you don’t have AutoHotkey installed, download it from the official website: https://www.autohotkey.com/
  • Install AutoHotkey, following the on-screen instructions.

2. Create the AutoHotkey Script:

  • Open a plain text editor (like Notepad, Notepad++, or any code editor).
  • Copy and paste the following code into the editor:
#NoEnv  ; Recommended for clarity and consistency
SendMode Input  ; Recommended for reliability
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory

; Check if Firefox is running
IfWinExist, ahk_exe firefox.exe
{
    ; Firefox is running: Quit Firefox
    WinActivate, ahk_exe firefox.exe ; Activate a Firefox window (important!)
    Send ^+q ; Send Ctrl+Shift+Q
}
Else
{
    ; Firefox is NOT running: Launch Firefox
    Run, "C:\Program Files\Mozilla Firefox\firefox.exe" ; Replace with your Firefox path
}

return
  • Crucially: Replace "C:\Program Files\Mozilla Firefox\firefox.exe" with the actual path to your Firefox executable. You can find this by right-clicking the Firefox shortcut on your desktop or Start Menu and selecting “Properties.” The path is in the “Target” field.

  • Save the file with a .ahk extension (e.g., firefox_toggle.ahk). Make sure the file extension is .ahk and not .txt.

3. Create the Shortcut (This is the Key Step):

  • Right-click on your desktop or in a folder where you want to keep the shortcut.
  • Select “New” -> “Shortcut”.
  • In the location field, enter the following, carefully replacing the paths:
"C:\Program Files\AutoHotkey\AutoHotkey.exe" "C:\Path\To\Your\Script\firefox_toggle.ahk"
* **Important:**
    * The *first* path (`"C:\Program Files\AutoHotkey\AutoHotkey.exe"`) is the path to your AutoHotkey executable.  Adjust this if AutoHotkey is installed in a different location.
    * The *second* path (`"C:\Path\To\Your\Script\firefox_toggle.ahk"`) is the full path to the `.ahk` script file you saved in the previous step.  Make sure to enclose both paths in double quotes.
  • Click “Next”.
  • Give the shortcut a name (e.g., “Firefox Toggle”).
  • Click “Finish”.

4. Pin to Taskbar:

  • Right-click the shortcut you just created (not the .ahk file itself).
  • Select “Pin to taskbar”.

Explanation of why this works:

The crucial part is the shortcut. You’re not pinning the script directly. Instead, you’re creating a shortcut that tells AutoHotkey to run your script. Windows recognizes the shortcut as a program launcher (because it points to AutoHotkey.exe), and therefore it can be pinned. The script itself then handles the logic of checking for Firefox and either quitting or launching it.

Troubleshooting:

  • Double-check the paths: The most common problem is incorrect paths in the shortcut’s target location. Make absolutely sure they are correct.
  • File association: If double-clicking the .ahk file still opens the AutoHotkey help, re-associate .ahk files with AutoHotkey.exe as described in my previous responses.
  • Run as administrator (if needed): If you still have problems, try right-clicking the shortcut and selecting “Run as administrator.”

If you follow these steps carefully, it should work. Let me know if you run into any issues, and we can troubleshoot further!

Getting help from Microsoft Copilot to create a quit button in Firefox

I had to use stackedit.io to convert the markdown formatted from the Copilot copy button to html to post here.

Got it! To create a Firefox extension that quits all windows, we’ll adjust the background.js script accordingly:

Step-by-Step Guide to Create a Firefox Extension with a Quit Button that Quits All Windows

  1. Create a Project Directory: Set up a new directory, e.g., quit_button.

  2. Create manifest.json:

    • Inside the directory, create a file named manifest.json with this content:
    {
      "manifest_version": 2,
      "name": "Quit Button",
      "version": "1.0",
      "description": "Add a Quit Button to the toolbar",
      "browser_action": {
        "default_icon": {
          "16": "icons/page-16.png",
          "32": "icons/page-32.png"
        }
      },
      "background": {
        "scripts": ["background.js"]
      }
    }
    
  3. Create Icons:

    • Inside the quit_button directory, create a subdirectory named icons and add your button icons (page-16.png and page-32.png). You can download these icons from resources such as Icon Library, Iconduck, Icon-Icons, Flaticon, or Icons8.
  4. Create background.js:

    • Inside the quit_button directory, create a file named background.js with this content:
    function quitAllWindows() {
      browser.windows.getAll({populate: true}).then((windows) => {
        for (let window of windows) {
          browser.windows.remove(window.id);
        }
      });
    }
    
    browser.browserAction.onClicked.addListener(quitAllWindows);
    
  5. Load Your Extension:

    • Open Firefox and go to about:debugging.
    • Click “This Firefox”.
    • Remove any currently loaded extension and reload your new extension by selecting the manifest.json file.
  6. Pin the Extension to the Toolbar:

    • Click on the puzzle piece icon (Extensions button) in the Firefox toolbar.
    • Find your “Quit Button” extension in the drop-down list and click on the pin icon next to it to pin it to the toolbar.
  7. Check for Errors:

    • Open the Developer Tools in Firefox (Ctrl + Shift + I).
    • Go to the “Console” tab and look for any error messages related to your extension. This can provide clues about what might be wrong.

By following these steps, your custom quit button should be able to close all open windows in Firefox. If you need any further assistance, feel free to ask!

Of course! Here’s a list of all the prompts you used during this session:

  1. Initial Inquiry: “Microsoft Copilot”
  2. Custom Button for Toolbar: “easiest way to add custom button to toolbar in firefox”
  3. Quit Button: “easiest way to create a button to quit in firefox”
  4. Extension Not Found: “that extension cannot be found”
  5. Alternative Extensions: “that add-on cannot be found”
  6. Create Extension: “easiest way to create extension to add a quit button to the toolbar in firefox”
  7. Icons for Extension: “where to get the icons”
  8. Button Not Appearing: “button did not appear”
  9. Manifest and JSON Errors: “Error details: Protocol error (SyntaxError): JSON.parse: end of data after property value in object at line 18 column 1 of the JSON data from: server0.conn0.webExtensionDescriptor2177 (resource://gre/modules/Extension.sys.mjs:1167:26)”
  10. Correct Manifest: “which manifest.json to use?”
  11. Final Step to Pin Extension: “there is one final step is missing from your directions. I need to pin to toolbar from the extension drop list.”
  12. Recap Correct Steps: “now repeat the correct steps to me again.”
  13. Quit All Windows: “I want to quit ALL windows”
  14. List All Prompts: “list all the prompts i used for this session.”

If you need any further assistance or have more questions, feel free to ask!

As shown in the beginning I couldn't find an addon to do the job.

Copilot missed out the pin button to toolbar part in the intial run. Nonetheless I am very impressed! The hand holding is incredible. :P

Monday, May 09, 2022

[Update: May 2022] How to trick the heart rate monitor on your fitness tracker (NSC edition)

Disclaimer: The following information provided is for educational and experimentation purposes.

Recently I've seen a spike in interest over this topic based on Google search results. Hence I will give a quick summary on the latest garbage trackers given free to participants of the steps challenge.

Testing performed on AXTRO FIT (Season 4) & Axtro Fit 3 (Season 6)
Final results and conclusion:
Certain clear or reflective surfaces may induce trackers to record MVPA values, surprisingly consistently. Steps count sensitive to vibratory effects from simple rotary mechanisms such as fan motor will work.

Thursday, March 24, 2022

Don't throw out that Xiaomi Powerbank 5000 yet...

If you have a Xiaomi Powerbank 5000 and find that it keeps flashing the full LEDs when charging but when discharging to a device, it instead flashes one LED, then it could be the wire for the temperature sensor has broken off the circuit board.

Open up the powerbank on the non USB port side with a blade and screwdriver then slide it out at the opposite end. You may find that the one or both of the two wires connected from the battery to the circuit board may be disconnected from its solder point. Solder them back then test it. If it works then put it back together.

This video shows where the wires are: