I’m self employed. I need to record how much time I spend on whatever task for whatever client.

Sounds simple, but I’m terrible at it. I always get to the end of the day without having recorded anything and not knowing what I’ve actually done.

Basically, I’d like to create a text log of the active window title, and take a screen cap.

I’d like to do this periodically as in every 15 minutes or so.

For the text log I just haven’t been able to achieve this at all.

For the screen caps I can use flameshot to take a screenshot from the CLI, but it makes a sound and shows an animation which is sub-optimal.

Any suggestions of where to look much appreciated.

Edit: I’m not asking for a time tracking app. I want something to log the active window title and take a screen cap so I can figure out what I was doing and write it in my time tracking app.

  • BCsven@lemmy.ca
    link
    fedilink
    arrow-up
    1
    arrow-down
    18
    ·
    edit-2
    16 hours ago

    Chatgt says build a scrip using a few tools. xdotool and scrot. I don’t know if this code is good or not. And some hashes are making markdown headers. How do we paste code on here?

    #!/bin/bash

    Set interval (in seconds)

    INTERVAL=10

    Output directories

    LOG_FILE=“$HOME/window_log.txt” IMG_DIR=“$HOME/window_snaps” mkdir -p “$IMG_DIR”

    while true; do # Get timestamp TS=$(date “+%Y-%m-%d_%H-%M-%S”)

    # Get active window title
    TITLE=$(xdotool getactivewindow getwindowname 2>/dev/null)
    
    # Fallback if title is empty
    if [ -z "$TITLE" ]; then
        TITLE="(No active window)"
    fi
    
    # Take screenshot
    IMG_FILE="$IMG_DIR/snap_$TS.png"
    scrot "$IMG_FILE"
    
    # Log entry
    echo "$TS | $TITLE" >> "$LOG_FILE"
    
    # Wait before next iteration
    sleep $INTERVAL
    

    done

    • eshep@social.trom.tf
      link
      fedilink
      arrow-up
      6
      ·
      14 hours ago

      @BCsven
      This is so much less helpful than just posting “I don’t know” or “beats me”.

      First, if you’re gonna post code, put it in a code block. And nevermind you not knowing if the ““code is good””, it doesn’t even adhere to the question that was asked; the two programs you suggested are not even wayland compatible tools.
      @null_dot

      • BCsven@lemmy.ca
        link
        fedilink
        arrow-up
        1
        ·
        6 hours ago

        OP seemed like they didn’t know where to start, so linking programs together was my suggestion. With a rough example. If thats against etiquette the noted.

        As for helpfulness, where are the code block entries. I have preview, hyperlink, inage, bold, italic,quotes,lists and spoilers across the bottom, and no codeblock.

        As for Wayland compatible this is where, somebody reads between the lines. If those two aren’t Wayland compatible search for Wayland compatible tool like “xxxxxx”.

    • MasterOKhan@lemmy.ca
      link
      fedilink
      English
      arrow-up
      11
      ·
      16 hours ago

      There is an etiquette to not just copy and pasting from ChatGPT. The fact you couldn’t verify the code yourself is a bigger issue.

      I understand you may have thought this may help, it really does not.

      • BCsven@lemmy.ca
        link
        fedilink
        arrow-up
        1
        ·
        edit-2
        5 hours ago

        Sure, seemed OP wasn’t a google searcher so I tried to show an example of two programs coming together. The code seems plausible, but its there as an example of steps. I find LMM is typically trash, but can get you started. But your etiquette note is noted

    • null_dot@lemmy.dbzer0.comOP
      link
      fedilink
      English
      arrow-up
      6
      ·
      15 hours ago

      Maybe ask chatgpt whether xdotool is compatible with wayland.

      I get that you’re trying to help but, this is not the way.

        • null_dot@lemmy.dbzer0.comOP
          link
          fedilink
          English
          arrow-up
          1
          ·
          4 hours ago

          This might shock you but… I have actually spent some time looking into this.

          The tools you’ve suggested aren’t compatible with Wayland. It seems that alternatives don’t really exist, or cause the problems I mentioned in my post.

          Additionally, I have a few decades experience with Linux and while I’m not some amazing Linux guru I do know what a bash script is and how to “link two programs together”.

          Finally, like everyone on the planet I also know what chatgpt is and might even consider using it to create a bash script if I knew what tools were compatible with Wayland.

          • BCsven@lemmy.ca
            link
            fedilink
            arrow-up
            1
            ·
            3 hours ago

            No worries, the post made it sound like you had not tries searching. So I assumed your were a new person that had put in no effort yet. My mistake