<commit_before>#!/bin/bash
#Lock screen with GNOME Screensaver after 10 minutes idle time
#Requires xprintidle

#Check if already running and exit immediately if so
RUNNING=$(pgrep -f -c gnome-screensaver-idlelock.sh)
if [ ! "$RUNNING" = "1" ]; then
  echo "gnome-screensaver-idlelock.sh is already running"
  exit 0
fi
 
while true
do
  IDLE=$(xprintidle)
  SCREENSAVER=$(gnome-screensaver-command -q)
  if [ "$IDLE" -ge 600000 ] && [ "$SCREENSAVER" = "The screensaver is inactive" ]; then
    gnome-screensaver-command --lock
  fi
  sleep 1
done<commit_msg>gnome-screensaver-idlelock.sh - add support for the xfpm presentation mode<commit_after>#!/bin/bash
#Lock screen with GNOME Screensaver after 10 minutes idle time
#Requires xprintidle

#Check if already running and exit immediately if so
RUNNING=$(pgrep -f -c gnome-screensaver-idlelock.sh)
if [ ! "$RUNNING" = "1" ]; then
  echo "gnome-screensaver-idlelock.sh is already running"
  exit 0
fi
 
while true
do
  IDLE=$(xprintidle)
  SCREENSAVER=$(gnome-screensaver-command -q)
  if [ "$IDLE" -ge 10000 ] && [ "$SCREENSAVER" = "The screensaver is inactive" ]; then
    if [ $(pgrep -f xfce4-power-manager) ]; then
      PRESENTATION_MODE=$(xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/presentation-mode)
      if [ "$PRESENTATION_MODE" = "false" ]; then
        gnome-screensaver-command --lock
      fi
    else
      gnome-screensaver-command --lock
    fi
  fi
  sleep 1
done
{'fraction_non_alphanumeric': 0.11862068965517242, 'fraction_numerical': 0.016551724137931035, 'mean_word_length': 3.6806451612903226, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2859297', 'n_tokens_mistral': 539, 'n_tokens_neox': 507, 'n_words': 145}