Refactored. Fixed README. 💪
This commit is contained in:
parent
25c3c0a986
commit
a9ad2dc856
8
README
8
README
|
@ -1,8 +0,0 @@
|
||||||
lanxu's Scripts for general enjoyment
|
|
||||||
|
|
||||||
Featuring:
|
|
||||||
* lightsOn by iye https://github.com/iye/lightsOn
|
|
||||||
|
|
||||||
Other:
|
|
||||||
* encodeVP9
|
|
||||||
*
|
|
42
README.md
Normal file
42
README.md
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
# Script collection by lanxu :muscle:
|
||||||
|
This is a general collection of useful scripts used by me. Most of the scripts are written or modified by me.
|
||||||
|
|
||||||
|
## Scripts by others
|
||||||
|
|
||||||
|
Script | Description
|
||||||
|
-------------+----------------------------------------------------------------
|
||||||
|
dropbox.py | Copyright (c) Dropbox, Inc. Changed to target python2
|
||||||
|
| https://www.dropbox.com/download?dl=packages/dropbox.py
|
||||||
|
-------------+----------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
## Scripts by me
|
||||||
|
|
||||||
|
Script | Description
|
||||||
|
-----------------+-------------------------------------------------------------
|
||||||
|
getGPUTemp.py | Fetches GPU temperature as float. Logging enabled
|
||||||
|
encodeVP9.py | Encodes files to VP9
|
||||||
|
extract.py | Extracts input files with directory awareness
|
||||||
|
| (similar to nautilus)
|
||||||
|
run-desktop.py | Run .desktop file
|
||||||
|
-----------------+-------------------------------------------------------------
|
||||||
|
run-once | Wrapper script to run executable only once. In short, it
|
||||||
|
| prevents two or more instances of the same binary to run
|
||||||
|
| at the same time
|
||||||
|
extract | Wrapper script for extract.py. Enables wildcards like
|
||||||
|
| extract *.rar
|
||||||
|
runDesktop.sh | Give this script .desktop file and it runs the program
|
||||||
|
runWinePrefix.sh | Give this script prefix name and binary and it runs wine
|
||||||
|
| with that prefix
|
||||||
|
sxiv_browser.sh | Awesome sxiv_browser.sh script. Ported from feh_browser.sh
|
||||||
|
| https://wiki.archlinux.org/index.php/Talk:Feh
|
||||||
|
setTheme.sh | Set GTK2 and GTK3 themes in case lxappearance is unable to
|
||||||
|
| help
|
||||||
|
-----------------+-------------------------------------------------------------
|
||||||
|
|
||||||
|
## Other remarks
|
||||||
|
There are a few scripts that are just thrown to the mix in case I need them at some point.
|
||||||
|
|
||||||
|
convertAtlasXMLToJson.php (convert sprite atlases to json)
|
||||||
|
sortPackagesBySize.sh (pacman script to sort packages by used size)
|
||||||
|
|
239
lightsOn.sh
239
lightsOn.sh
|
@ -1,239 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
# lightsOn.sh
|
|
||||||
|
|
||||||
# Copyright (c) 2013 iye.cba at gmail com
|
|
||||||
# url: https://github.com/iye/lightsOn
|
|
||||||
# This script is licensed under GNU GPL version 2.0 or above
|
|
||||||
|
|
||||||
# Description: Bash script that prevents the screensaver and display power
|
|
||||||
# management (DPMS) to be activated when you are watching Flash Videos
|
|
||||||
# fullscreen on Firefox and Chromium.
|
|
||||||
# Can detect mplayer, minitube, and VLC when they are fullscreen too.
|
|
||||||
# Also, screensaver can be prevented when certain specified programs are running.
|
|
||||||
# lightsOn.sh needs xscreensaver or kscreensaver to work.
|
|
||||||
|
|
||||||
|
|
||||||
# HOW TO USE: Start the script with the number of seconds you want the checks
|
|
||||||
# for fullscreen to be done. Example:
|
|
||||||
# "./lightsOn.sh 120 &" will Check every 120 seconds if Mplayer, Minitube
|
|
||||||
# VLC, Firefox or Chromium are fullscreen and delay screensaver and Power Management if so.
|
|
||||||
# You want the number of seconds to be ~10 seconds less than the time it takes
|
|
||||||
# your screensaver or Power Management to activate.
|
|
||||||
# If you don't pass an argument, the checks are done every 50 seconds.
|
|
||||||
#
|
|
||||||
# An optional array variable exists here to add the names of programs that will delay the screensaver if they're running.
|
|
||||||
# This can be useful if you want to maintain a view of the program from a distance, like a music playlist for DJing,
|
|
||||||
# or if the screensaver eats up CPU that chops into any background processes you have running,
|
|
||||||
# such as realtime music programs like Ardour in MIDI keyboard mode.
|
|
||||||
# If you use this feature, make sure you use the name of the binary of the program (which may exist, for instance, in /usr/bin).
|
|
||||||
|
|
||||||
|
|
||||||
# Modify these variables if you want this script to detect if Mplayer,
|
|
||||||
# VLC, Minitube, or Firefox or Chromium Flash Video are Fullscreen and disable
|
|
||||||
# xscreensaver/kscreensaver and PowerManagement.
|
|
||||||
mplayer_detection=1
|
|
||||||
vlc_detection=1
|
|
||||||
firefox_flash_detection=1
|
|
||||||
chromium_flash_detection=1
|
|
||||||
minitube_detection=1
|
|
||||||
|
|
||||||
# Names of programs which, when running, you wish to delay the screensaver.
|
|
||||||
delay_progs=() # For example ('ardour2' 'gmpc')
|
|
||||||
|
|
||||||
|
|
||||||
# YOU SHOULD NOT NEED TO MODIFY ANYTHING BELOW THIS LINE
|
|
||||||
|
|
||||||
|
|
||||||
# enumerate all the attached screens
|
|
||||||
displays=""
|
|
||||||
while read id
|
|
||||||
do
|
|
||||||
displays="$displays $id"
|
|
||||||
done < <(xvinfo | sed -n 's/^screen #\([0-9]\+\)$/\1/p')
|
|
||||||
|
|
||||||
|
|
||||||
# Detect screensaver been used (xscreensaver, kscreensaver or none)
|
|
||||||
screensaver=`pgrep -l xscreensaver | grep -wc xscreensaver`
|
|
||||||
if [ $screensaver -ge 1 ]; then
|
|
||||||
screensaver=xscreensaver
|
|
||||||
else
|
|
||||||
screensaver=`pgrep -l kscreensaver | grep -wc kscreensaver`
|
|
||||||
if [ $screensaver -ge 1 ]; then
|
|
||||||
screensaver=kscreensaver
|
|
||||||
else
|
|
||||||
screensaver=None
|
|
||||||
echo "No screensaver detected"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
checkDelayProgs()
|
|
||||||
{
|
|
||||||
for prog in "${delay_progs[@]}"; do
|
|
||||||
if [ `pgrep -lfc "$prog"` -ge 1 ]; then
|
|
||||||
echo "Delaying the screensaver because a program on the delay list, \"$prog\", is running..."
|
|
||||||
delayScreensaver
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
checkFullscreen()
|
|
||||||
{
|
|
||||||
# loop through every display looking for a fullscreen window
|
|
||||||
for display in $displays
|
|
||||||
do
|
|
||||||
#get id of active window and clean output
|
|
||||||
activ_win_id=`DISPLAY=:0.${display} xprop -root _NET_ACTIVE_WINDOW`
|
|
||||||
#activ_win_id=${activ_win_id#*# } #gives error if xprop returns extra ", 0x0" (happens on some distros)
|
|
||||||
activ_win_id=${activ_win_id:40:9}
|
|
||||||
|
|
||||||
# Skip invalid window ids (commented as I could not reproduce a case
|
|
||||||
# where invalid id was returned, plus if id invalid
|
|
||||||
# isActivWinFullscreen will fail anyway.)
|
|
||||||
#if [ "$activ_win_id" = "0x0" ]; then
|
|
||||||
# continue
|
|
||||||
#fi
|
|
||||||
|
|
||||||
# Check if Active Window (the foremost window) is in fullscreen state
|
|
||||||
isActivWinFullscreen=`DISPLAY=:0.${display} xprop -id $activ_win_id | grep _NET_WM_STATE_FULLSCREEN`
|
|
||||||
if [[ "$isActivWinFullscreen" = *NET_WM_STATE_FULLSCREEN* ]];then
|
|
||||||
isAppRunning
|
|
||||||
var=$?
|
|
||||||
if [[ $var -eq 1 ]];then
|
|
||||||
delayScreensaver
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# check if active windows is mplayer, vlc or firefox
|
|
||||||
#TODO only window name in the variable activ_win_id, not whole line.
|
|
||||||
#Then change IFs to detect more specifically the apps "<vlc>" and if process name exist
|
|
||||||
|
|
||||||
isAppRunning()
|
|
||||||
{
|
|
||||||
#Get title of active window
|
|
||||||
activ_win_title=`xprop -id $activ_win_id | grep "WM_CLASS(STRING)"` # I used WM_NAME(STRING) before, WM_CLASS more accurate.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Check if user want to detect Video fullscreen on Firefox, modify variable firefox_flash_detection if you dont want Firefox detection
|
|
||||||
if [ $firefox_flash_detection == 1 ];then
|
|
||||||
if [[ "$activ_win_title" = *unknown* || "$activ_win_title" = *plugin-container* ]];then
|
|
||||||
# Check if plugin-container process is running
|
|
||||||
flash_process=`pgrep -l plugin-containe | grep -wc plugin-containe`
|
|
||||||
#(why was I using this line avobe? delete if pgrep -lc works ok)
|
|
||||||
#flash_process=`pgrep -lc plugin-containe`
|
|
||||||
if [[ $flash_process -ge 1 ]];then
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
# Check if user want to detect Video fullscreen on Chromium, modify variable chromium_flash_detection if you dont want Chromium detection
|
|
||||||
if [ $chromium_flash_detection == 1 ];then
|
|
||||||
if [[ "$activ_win_title" = *exe* ]];then
|
|
||||||
# Check if Chromium/Chrome Flash process is running
|
|
||||||
flash_process=`pgrep -lfc ".*((c|C)hrome|chromium).*flashp.*"`
|
|
||||||
if [[ $flash_process -ge 1 ]];then
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
#check if user want to detect mplayer fullscreen, modify variable mplayer_detection
|
|
||||||
if [ $mplayer_detection == 1 ];then
|
|
||||||
if [[ "$activ_win_title" = *mplayer* || "$activ_win_title" = *MPlayer* ]];then
|
|
||||||
#check if mplayer is running.
|
|
||||||
#mplayer_process=`pgrep -l mplayer | grep -wc mplayer`
|
|
||||||
mplayer_process=`pgrep -lc mplayer`
|
|
||||||
if [ $mplayer_process -ge 1 ]; then
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
# Check if user want to detect vlc fullscreen, modify variable vlc_detection
|
|
||||||
if [ $vlc_detection == 1 ];then
|
|
||||||
if [[ "$activ_win_title" = *vlc* ]];then
|
|
||||||
#check if vlc is running.
|
|
||||||
#vlc_process=`pgrep -l vlc | grep -wc vlc`
|
|
||||||
vlc_process=`pgrep -lc vlc`
|
|
||||||
if [ $vlc_process -ge 1 ]; then
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Check if user want to detect minitube fullscreen, modify variable minitube_detection
|
|
||||||
if [ $minitube_detection == 1 ];then
|
|
||||||
if [[ "$activ_win_title" = *minitube* ]];then
|
|
||||||
#check if minitube is running.
|
|
||||||
#minitube_process=`pgrep -l minitube | grep -wc minitube`
|
|
||||||
minitube_process=`pgrep -lc minitube`
|
|
||||||
if [ $minitube_process -ge 1 ]; then
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
delayScreensaver()
|
|
||||||
{
|
|
||||||
|
|
||||||
# reset inactivity time counter so screensaver is not started
|
|
||||||
if [ "$screensaver" == "xscreensaver" ]; then
|
|
||||||
xscreensaver-command -deactivate > /dev/null
|
|
||||||
elif [ "$screensaver" == "kscreensaver" ]; then
|
|
||||||
qdbus org.freedesktop.ScreenSaver /ScreenSaver SimulateUserActivity > /dev/null
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
#Check if DPMS is on. If it is, deactivate and reactivate again. If it is not, do nothing.
|
|
||||||
dpmsStatus=`xset -q | grep -ce 'DPMS is Enabled'`
|
|
||||||
if [ $dpmsStatus == 1 ];then
|
|
||||||
xset -dpms
|
|
||||||
xset dpms
|
|
||||||
fi
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
delay=$1
|
|
||||||
|
|
||||||
|
|
||||||
# If argument empty, use 50 seconds as default.
|
|
||||||
if [ -z "$1" ];then
|
|
||||||
delay=50
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
# If argument is not integer quit.
|
|
||||||
if [[ $1 = *[^0-9]* ]]; then
|
|
||||||
echo "The Argument \"$1\" is not valid, not an integer"
|
|
||||||
echo "Please use the time in seconds you want the checks to repeat."
|
|
||||||
echo "You want it to be ~10 seconds less than the time it takes your screensaver or DPMS to activate"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
while true
|
|
||||||
do
|
|
||||||
checkDelayProgs
|
|
||||||
checkFullscreen
|
|
||||||
sleep $delay
|
|
||||||
done
|
|
||||||
|
|
||||||
|
|
||||||
exit 0
|
|
|
@ -1 +0,0 @@
|
||||||
Read lightsOn.sh. How to use and license there.
|
|
|
@ -1,239 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
# lightsOn.sh
|
|
||||||
|
|
||||||
# Copyright (c) 2013 iye.cba at gmail com
|
|
||||||
# url: https://github.com/iye/lightsOn
|
|
||||||
# This script is licensed under GNU GPL version 2.0 or above
|
|
||||||
|
|
||||||
# Description: Bash script that prevents the screensaver and display power
|
|
||||||
# management (DPMS) to be activated when you are watching Flash Videos
|
|
||||||
# fullscreen on Firefox and Chromium.
|
|
||||||
# Can detect mplayer, minitube, and VLC when they are fullscreen too.
|
|
||||||
# Also, screensaver can be prevented when certain specified programs are running.
|
|
||||||
# lightsOn.sh needs xscreensaver or kscreensaver to work.
|
|
||||||
|
|
||||||
|
|
||||||
# HOW TO USE: Start the script with the number of seconds you want the checks
|
|
||||||
# for fullscreen to be done. Example:
|
|
||||||
# "./lightsOn.sh 120 &" will Check every 120 seconds if Mplayer, Minitube
|
|
||||||
# VLC, Firefox or Chromium are fullscreen and delay screensaver and Power Management if so.
|
|
||||||
# You want the number of seconds to be ~10 seconds less than the time it takes
|
|
||||||
# your screensaver or Power Management to activate.
|
|
||||||
# If you don't pass an argument, the checks are done every 50 seconds.
|
|
||||||
#
|
|
||||||
# An optional array variable exists here to add the names of programs that will delay the screensaver if they're running.
|
|
||||||
# This can be useful if you want to maintain a view of the program from a distance, like a music playlist for DJing,
|
|
||||||
# or if the screensaver eats up CPU that chops into any background processes you have running,
|
|
||||||
# such as realtime music programs like Ardour in MIDI keyboard mode.
|
|
||||||
# If you use this feature, make sure you use the name of the binary of the program (which may exist, for instance, in /usr/bin).
|
|
||||||
|
|
||||||
|
|
||||||
# Modify these variables if you want this script to detect if Mplayer,
|
|
||||||
# VLC, Minitube, or Firefox or Chromium Flash Video are Fullscreen and disable
|
|
||||||
# xscreensaver/kscreensaver and PowerManagement.
|
|
||||||
mplayer_detection=1
|
|
||||||
vlc_detection=1
|
|
||||||
firefox_flash_detection=1
|
|
||||||
chromium_flash_detection=1
|
|
||||||
minitube_detection=1
|
|
||||||
|
|
||||||
# Names of programs which, when running, you wish to delay the screensaver.
|
|
||||||
delay_progs=() # For example ('ardour2' 'gmpc')
|
|
||||||
|
|
||||||
|
|
||||||
# YOU SHOULD NOT NEED TO MODIFY ANYTHING BELOW THIS LINE
|
|
||||||
|
|
||||||
|
|
||||||
# enumerate all the attached screens
|
|
||||||
displays=""
|
|
||||||
while read id
|
|
||||||
do
|
|
||||||
displays="$displays $id"
|
|
||||||
done < <(xvinfo | sed -n 's/^screen #\([0-9]\+\)$/\1/p')
|
|
||||||
|
|
||||||
|
|
||||||
# Detect screensaver been used (xscreensaver, kscreensaver or none)
|
|
||||||
screensaver=`pgrep -l xscreensaver | grep -wc xscreensaver`
|
|
||||||
if [ $screensaver -ge 1 ]; then
|
|
||||||
screensaver=xscreensaver
|
|
||||||
else
|
|
||||||
screensaver=`pgrep -l kscreensaver | grep -wc kscreensaver`
|
|
||||||
if [ $screensaver -ge 1 ]; then
|
|
||||||
screensaver=kscreensaver
|
|
||||||
else
|
|
||||||
screensaver=None
|
|
||||||
echo "No screensaver detected"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
checkDelayProgs()
|
|
||||||
{
|
|
||||||
for prog in "${delay_progs[@]}"; do
|
|
||||||
if [ `pgrep -lfc "$prog"` -ge 1 ]; then
|
|
||||||
echo "Delaying the screensaver because a program on the delay list, \"$prog\", is running..."
|
|
||||||
delayScreensaver
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
checkFullscreen()
|
|
||||||
{
|
|
||||||
# loop through every display looking for a fullscreen window
|
|
||||||
for display in $displays
|
|
||||||
do
|
|
||||||
#get id of active window and clean output
|
|
||||||
activ_win_id=`DISPLAY=:0.${display} xprop -root _NET_ACTIVE_WINDOW`
|
|
||||||
#activ_win_id=${activ_win_id#*# } #gives error if xprop returns extra ", 0x0" (happens on some distros)
|
|
||||||
activ_win_id=${activ_win_id:40:9}
|
|
||||||
|
|
||||||
# Skip invalid window ids (commented as I could not reproduce a case
|
|
||||||
# where invalid id was returned, plus if id invalid
|
|
||||||
# isActivWinFullscreen will fail anyway.)
|
|
||||||
#if [ "$activ_win_id" = "0x0" ]; then
|
|
||||||
# continue
|
|
||||||
#fi
|
|
||||||
|
|
||||||
# Check if Active Window (the foremost window) is in fullscreen state
|
|
||||||
isActivWinFullscreen=`DISPLAY=:0.${display} xprop -id $activ_win_id | grep _NET_WM_STATE_FULLSCREEN`
|
|
||||||
if [[ "$isActivWinFullscreen" = *NET_WM_STATE_FULLSCREEN* ]];then
|
|
||||||
isAppRunning
|
|
||||||
var=$?
|
|
||||||
if [[ $var -eq 1 ]];then
|
|
||||||
delayScreensaver
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# check if active windows is mplayer, vlc or firefox
|
|
||||||
#TODO only window name in the variable activ_win_id, not whole line.
|
|
||||||
#Then change IFs to detect more specifically the apps "<vlc>" and if process name exist
|
|
||||||
|
|
||||||
isAppRunning()
|
|
||||||
{
|
|
||||||
#Get title of active window
|
|
||||||
activ_win_title=`xprop -id $activ_win_id | grep "WM_CLASS(STRING)"` # I used WM_NAME(STRING) before, WM_CLASS more accurate.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Check if user want to detect Video fullscreen on Firefox, modify variable firefox_flash_detection if you dont want Firefox detection
|
|
||||||
if [ $firefox_flash_detection == 1 ];then
|
|
||||||
if [[ "$activ_win_title" = *unknown* || "$activ_win_title" = *plugin-container* ]];then
|
|
||||||
# Check if plugin-container process is running
|
|
||||||
flash_process=`pgrep -l plugin-containe | grep -wc plugin-containe`
|
|
||||||
#(why was I using this line avobe? delete if pgrep -lc works ok)
|
|
||||||
#flash_process=`pgrep -lc plugin-containe`
|
|
||||||
if [[ $flash_process -ge 1 ]];then
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
# Check if user want to detect Video fullscreen on Chromium, modify variable chromium_flash_detection if you dont want Chromium detection
|
|
||||||
if [ $chromium_flash_detection == 1 ];then
|
|
||||||
if [[ "$activ_win_title" = *exe* ]];then
|
|
||||||
# Check if Chromium/Chrome Flash process is running
|
|
||||||
flash_process=`pgrep -lfc ".*((c|C)hrome|chromium).*flashp.*"`
|
|
||||||
if [[ $flash_process -ge 1 ]];then
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
#check if user want to detect mplayer fullscreen, modify variable mplayer_detection
|
|
||||||
if [ $mplayer_detection == 1 ];then
|
|
||||||
if [[ "$activ_win_title" = *mplayer* || "$activ_win_title" = *MPlayer* ]];then
|
|
||||||
#check if mplayer is running.
|
|
||||||
#mplayer_process=`pgrep -l mplayer | grep -wc mplayer`
|
|
||||||
mplayer_process=`pgrep -lc mplayer`
|
|
||||||
if [ $mplayer_process -ge 1 ]; then
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
# Check if user want to detect vlc fullscreen, modify variable vlc_detection
|
|
||||||
if [ $vlc_detection == 1 ];then
|
|
||||||
if [[ "$activ_win_title" = *vlc* ]];then
|
|
||||||
#check if vlc is running.
|
|
||||||
#vlc_process=`pgrep -l vlc | grep -wc vlc`
|
|
||||||
vlc_process=`pgrep -lc vlc`
|
|
||||||
if [ $vlc_process -ge 1 ]; then
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Check if user want to detect minitube fullscreen, modify variable minitube_detection
|
|
||||||
if [ $minitube_detection == 1 ];then
|
|
||||||
if [[ "$activ_win_title" = *minitube* ]];then
|
|
||||||
#check if minitube is running.
|
|
||||||
#minitube_process=`pgrep -l minitube | grep -wc minitube`
|
|
||||||
minitube_process=`pgrep -lc minitube`
|
|
||||||
if [ $minitube_process -ge 1 ]; then
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
delayScreensaver()
|
|
||||||
{
|
|
||||||
|
|
||||||
# reset inactivity time counter so screensaver is not started
|
|
||||||
if [ "$screensaver" == "xscreensaver" ]; then
|
|
||||||
xscreensaver-command -deactivate > /dev/null
|
|
||||||
elif [ "$screensaver" == "kscreensaver" ]; then
|
|
||||||
qdbus org.freedesktop.ScreenSaver /ScreenSaver SimulateUserActivity > /dev/null
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
#Check if DPMS is on. If it is, deactivate and reactivate again. If it is not, do nothing.
|
|
||||||
dpmsStatus=`xset -q | grep -ce 'DPMS is Enabled'`
|
|
||||||
if [ $dpmsStatus == 1 ];then
|
|
||||||
xset -dpms
|
|
||||||
xset dpms
|
|
||||||
fi
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
delay=$1
|
|
||||||
|
|
||||||
|
|
||||||
# If argument empty, use 50 seconds as default.
|
|
||||||
if [ -z "$1" ];then
|
|
||||||
delay=50
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
# If argument is not integer quit.
|
|
||||||
if [[ $1 = *[^0-9]* ]]; then
|
|
||||||
echo "The Argument \"$1\" is not valid, not an integer"
|
|
||||||
echo "Please use the time in seconds you want the checks to repeat."
|
|
||||||
echo "You want it to be ~10 seconds less than the time it takes your screensaver or DPMS to activate"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
while true
|
|
||||||
do
|
|
||||||
checkDelayProgs
|
|
||||||
checkFullscreen
|
|
||||||
sleep $delay
|
|
||||||
done
|
|
||||||
|
|
||||||
|
|
||||||
exit 0
|
|
|
@ -1,6 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
while [ 1 ]; do
|
|
||||||
xdotool mousemove 215 469 click 1 &
|
|
||||||
sleep 0.1
|
|
||||||
done
|
|
|
@ -1,5 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
xrandr --newmode "1920x1080_60.00" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync
|
|
||||||
xrandr --addmode VGA1 1920x1080_60.00
|
|
||||||
xrandr --output VGA1 --mode 1920x1080_60.00 --right-of LVDS1
|
|
|
@ -1,5 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
ffmpeg -i $1 -pix_fmt yuv420p -f yuv4mpegpipe - 2>/dev/null | vpxenc --i420 -p 1 -t 4 --good --cpu-used=3 --target-bitrate=2000 --end-usage=vbr --fps=30000/1001 -v --kf-min-dist=0 --kf-max-dist=360 --token-parts=2 --static-thresh=0 --min-q=0 --max-q=63 -o $(basename $1).webm -
|
|
||||||
|
|
||||||
|
|
|
@ -1,12 +0,0 @@
|
||||||
[Desktop Entry]
|
|
||||||
Name=Feh Browser
|
|
||||||
GenericName=Image viewer
|
|
||||||
GenericName[en_US]=Image viewer
|
|
||||||
Comment=Fast Imlib2-based Image Viewer
|
|
||||||
Exec=feh_browser.sh %f -Z --scale-down
|
|
||||||
Terminal=false
|
|
||||||
Type=Application
|
|
||||||
Icon=/usr/share/feh/images/feh.png
|
|
||||||
Categories=Graphics;2DGraphics;Viewer;
|
|
||||||
MimeType=image/bmp;image/gif;image/jpeg;image/jpg;image/pjpeg;image/png;image/tiff;image/x-bmp;image/x-pcx;image/x-png;image/x-portable-anymap;image/x-portable-bitmap;image/x-portable-graymap;image/x-portable-pixmap;image/x-tga;image/x-xbitmap;
|
|
||||||
Name[en_US]=feh
|
|
|
@ -1,25 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
shopt -s nullglob
|
|
||||||
|
|
||||||
if [[ ! -f $1 ]]; then
|
|
||||||
echo "$0: first argument is not a file" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
file=$(basename -- "$1")
|
|
||||||
dir=$(dirname -- "$1")
|
|
||||||
arr=()
|
|
||||||
shift
|
|
||||||
|
|
||||||
cd -- "$dir"
|
|
||||||
|
|
||||||
echo $file
|
|
||||||
|
|
||||||
for i in *; do
|
|
||||||
[[ -f $i ]] || continue
|
|
||||||
arr+=("$i")
|
|
||||||
[[ "$i" == "$file" ]] && c=$((${#arr[@]} - 1))
|
|
||||||
done
|
|
||||||
|
|
||||||
exec feh "$@" -- "${arr[@]:c}" "${arr[@]:0:c}"
|
|
14
sandbox
14
sandbox
|
@ -1,14 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# Run without any access
|
|
||||||
#% sudo groupadd sandbox
|
|
||||||
#% useradd -g sandbox sandbox
|
|
||||||
#
|
|
||||||
# Disable network
|
|
||||||
# iptables -A OUTPUT -m owner --gid-owner sandbox -j DROP
|
|
||||||
# Or
|
|
||||||
# iptables -A OUTPUT -m owner --gid-owner sandbox -d 192.168.1.0/24 -j ACCEPT
|
|
||||||
# iptables -A OUTPUT -m owner --gid-owner sandbox -d 127.0.0.0/8 -j ACCEPT
|
|
||||||
# iptables -A OUTPUT -m owner --gid-owner sandbox -j DROP
|
|
||||||
|
|
||||||
sg sandbox "$@"
|
|
Loading…
Reference in New Issue
Block a user