File tree 9 files changed +28
-10
lines changed
9 files changed +28
-10
lines changed Original file line number Diff line number Diff line change 3
3
# Press A
4
4
BROWSER_WINDOW=$(xdotool search --class '^chromium-browser$')
5
5
xdotool key --window $BROWSER_WINDOW a
6
- touch "$XDG_RUNTIME_DIR/lasttabmove"
6
+ ./stay-here-longer
7
7
Original file line number Diff line number Diff line change 3
3
# Press B
4
4
BROWSER_WINDOW=$(xdotool search --class '^chromium-browser$')
5
5
xdotool key --window $BROWSER_WINDOW b
6
- touch "$XDG_RUNTIME_DIR/lasttabmove"
6
+ ./stay-here-longer
7
7
Original file line number Diff line number Diff line change @@ -7,12 +7,12 @@ if not os.path.exists(filename):
7
7
with open (filename , "w" ) as f :
8
8
pass
9
9
10
- now = int ( time .time () )
11
- last = int ( os .stat (filename ).st_mtime )
10
+ now = time .time ()
11
+ last = os .stat (filename ).st_mtime
12
12
13
13
if last > now :
14
14
print ("unpause" )
15
15
os .system (os .path .dirname (__file__ ) + "/tab-right" )
16
16
else :
17
17
print ("pause" )
18
- os .utime (filename , (0 , int ( time . time ()) + 900 ))
18
+ os .utime (filename , (0 , now + 900 ))
Original file line number Diff line number Diff line change 3
3
# Press X
4
4
BROWSER_WINDOW=$(xdotool search --class '^chromium-browser$')
5
5
xdotool key --window $BROWSER_WINDOW x
6
- touch "$XDG_RUNTIME_DIR/lasttabmove"
6
+ ./stay-here-longer
7
7
Original file line number Diff line number Diff line change 3
3
# Press Y
4
4
BROWSER_WINDOW=$(xdotool search --class '^chromium-browser$')
5
5
xdotool key --window $BROWSER_WINDOW y
6
- touch "$XDG_RUNTIME_DIR/lasttabmove"
6
+ ./stay-here-longer
7
7
Original file line number Diff line number Diff line change 1
1
# reload the current page
2
2
BROWSER_WINDOW=$(xdotool search --class '^chromium-browser$')
3
3
xdotool key --window $BROWSER_WINDOW ctrl+r
4
- touch "$XDG_RUNTIME_DIR/lasttabmove"
4
+ ./stay-here-longer
Original file line number Diff line number Diff line change 1
1
# move left one tab
2
2
BROWSER_WINDOW=$(xdotool search --class '^chromium-browser$')
3
3
xdotool key --window $BROWSER_WINDOW Down
4
- touch "$XDG_RUNTIME_DIR/lasttabmove"
4
+ ./stay-here-longer
Original file line number Diff line number Diff line change 1
1
# move left one tab
2
2
BROWSER_WINDOW=$(xdotool search --class '^chromium-browser$')
3
3
xdotool key --window $BROWSER_WINDOW Up
4
- touch "$XDG_RUNTIME_DIR/lasttabmove"
4
+ ./stay-here-longer
Original file line number Diff line number Diff line change
1
+ #!/usr/bin/env python3
2
+ import os
3
+ import time
4
+
5
+ filename = os .environ ["XDG_RUNTIME_DIR" ] + "/lasttabmove"
6
+ if not os .path .exists (filename ):
7
+ with open (filename , "w" ) as f :
8
+ pass
9
+
10
+ now = time .time ()
11
+ last = os .stat (filename ).st_mtime
12
+
13
+ if last > now :
14
+ print ("paused" )
15
+ os .utime (filename , (0 , now + 900 ))
16
+ else :
17
+ print ("not paused" )
18
+ os .utime (filename , (0 , now ))
You can’t perform that action at this time.
0 commit comments