Can a bash script refresh a wegpage?
Forum rules
Topics in this forum are automatically closed 6 months after creation.
Topics in this forum are automatically closed 6 months after creation.
- Logansfury
- Level 6
- Posts: 1237
- Joined: Fri Oct 27, 2023 4:08 pm
- Location: Las Vegas NV, USA
Can a bash script refresh a wegpage?
Hello,
I was trying with online resources to acquire a bash script that would work with my xdotool and auto refresh a specific Chromium tab for me.
The script I got however always returns it's built-in Tab with name not found error.
Is such a script possible? I would like it to run once a minute until stopped if it's doable. The page I want to refresh has the tab name:
Linux Mint Forums - Index page
forums.linuxmint.com
Thanks for reading,
Logan
I was trying with online resources to acquire a bash script that would work with my xdotool and auto refresh a specific Chromium tab for me.
The script I got however always returns it's built-in Tab with name not found error.
Is such a script possible? I would like it to run once a minute until stopped if it's doable. The page I want to refresh has the tab name:
Linux Mint Forums - Index page
forums.linuxmint.com
Thanks for reading,
Logan
Re: Can a bash script refresh a wegpage?
It depends ...
- The browsers sometimes allows you to use keyboard shortcuts, but the browser must be open.
So, then you can use tools like xdotool.
- xdotool probably allows you to control the mouse cursor, which will click for you.
- The browsers sometimes allows you to use keyboard shortcuts, but the browser must be open.
So, then you can use tools like xdotool.
- xdotool probably allows you to control the mouse cursor, which will click for you.
Re: Can a bash script refresh a wegpage?
*nods to 1000 *
Indeed. Here's how my google chrome browser launches which includes youtube.com. Youtube.com for my setup is the 2nd browser tab...Thus..one ctrl+tab keypress combo to change focus to that exact webpage/tab,
( where alt+super+c is the keyboard Cinnamon hotkey combo to launch google chrome browser)
So if the tab/webpage you want is the 2nd in the open tab/pages list from left to right..open....then it would be whatever keyboard shortcut key combo you want to use to launch chromium ( let's pretend it's alt+super+c )...so similarly to below ( you may need to adjust the number values below to slightly higher if you're not on a hardcore fast internet connection (shrugs)...
If you prefer that specific webpage/tab be the third or fourth one out of 3 or 4 tabbed pages opened.... instead of " key Ctrl+Tab ". ...shorter to do "
** Note ***
The " f " in " F5 " must be capitalized or it won't execute that simulated keypress *** or you could also do instead of " key F5 " ... " key ctrl+r " same thing imo.
Incase you don't have a list of all or the majority of key-translations of xdotool. Let me know and i'll hook ya up
Indeed. Here's how my google chrome browser launches which includes youtube.com. Youtube.com for my setup is the 2nd browser tab...Thus..one ctrl+tab keypress combo to change focus to that exact webpage/tab,
( where alt+super+c is the keyboard Cinnamon hotkey combo to launch google chrome browser)
So if the tab/webpage you want is the 2nd in the open tab/pages list from left to right..open....then it would be whatever keyboard shortcut key combo you want to use to launch chromium ( let's pretend it's alt+super+c )...so similarly to below ( you may need to adjust the number values below to slightly higher if you're not on a hardcore fast internet connection (shrugs)...
xdotool key "alt+super+c" sleep 1 key "Ctrl+Tab" sleep 0.33 key F5
If you prefer that specific webpage/tab be the third or fourth one out of 3 or 4 tabbed pages opened.... instead of " key Ctrl+Tab ". ...shorter to do "
keydown ctrl sleep 0.3 key Tab key Tab sleep 0.3 keyup ctrl
" ( two " Tab " s for moving over two webpage/tabs. 3 for 3..etc )** Note ***
The " f " in " F5 " must be capitalized or it won't execute that simulated keypress *** or you could also do instead of " key F5 " ... " key ctrl+r " same thing imo.
Incase you don't have a list of all or the majority of key-translations of xdotool. Let me know and i'll hook ya up
Mint 21.2 Cinnamon 5.8.4
asrock x570 taichi ...bios p5.00
ryzen 5900x
128GB Kingston Fury @ 3600mhz
Corsair mp600 pro xt NVME ssd 4TB
three 4TB ssds
dual 1TB ssds
Two 16TB Toshiba hdd's
24GB amd 7900xtx vid card
Viewsonic Elite UHD 32" 144hz monitor
asrock x570 taichi ...bios p5.00
ryzen 5900x
128GB Kingston Fury @ 3600mhz
Corsair mp600 pro xt NVME ssd 4TB
three 4TB ssds
dual 1TB ssds
Two 16TB Toshiba hdd's
24GB amd 7900xtx vid card
Viewsonic Elite UHD 32" 144hz monitor
- Logansfury
- Level 6
- Posts: 1237
- Joined: Fri Oct 27, 2023 4:08 pm
- Location: Las Vegas NV, USA
Re: Can a bash script refresh a wegpage?
Hello!
This sounds very good! For cases where the Tab isn't consistently the 2nd or 3rd etc, is there a scripted way to open the tab by its name?
This sounds very good! For cases where the Tab isn't consistently the 2nd or 3rd etc, is there a scripted way to open the tab by its name?
Re: Can a bash script refresh a wegpage?
Are you working in the same browser on another tab at the moment you want it to be refreshed?
Or are you doing other stuff outside the browser? And when doing other stuff, is that specific tab active/open?
Or are you doing other stuff outside the browser? And when doing other stuff, is that specific tab active/open?
- Logansfury
- Level 6
- Posts: 1237
- Joined: Fri Oct 27, 2023 4:08 pm
- Location: Las Vegas NV, USA
Re: Can a bash script refresh a wegpage?
Most likely I would be doing things outside the browser. I had a python3 script that was working well for focusing chromium but I hadn't got as far as getting it to recognize a specific tab.
Re: Can a bash script refresh a wegpage?
If you ask me, it seems pretty annoying if you are doing other stuff and the script lets the browser focus, switch tabs and reload them every so seconds while doing other things?!
Isn't there some add-on for the browser that does the refreshing without focussing the browser?
Isn't there some add-on for the browser that does the refreshing without focussing the browser?
- Logansfury
- Level 6
- Posts: 1237
- Joined: Fri Oct 27, 2023 4:08 pm
- Location: Las Vegas NV, USA
Re: Can a bash script refresh a wegpage?
I hadn't thought of that, ill look into chrome extensions.Koentje wrote: ⤴Sat Feb 17, 2024 8:44 pm If you ask me, it seems pretty annoying if you are doing other stuff and the script lets the browser focus, switch tabs and reload them every so seconds while doing other things?!
Isn't there some add-on for the browser that does the refreshing without focussing the browser?
Re: Can a bash script refresh a wegpage?
Seems there are enough refresh extensions!
Last edited by Koentje on Sat Feb 17, 2024 8:56 pm, edited 1 time in total.
- Logansfury
- Level 6
- Posts: 1237
- Joined: Fri Oct 27, 2023 4:08 pm
- Location: Las Vegas NV, USA
Re: Can a bash script refresh a wegpage?
That will certainly get me started!
Thank you
Thank you
- Logansfury
- Level 6
- Posts: 1237
- Joined: Fri Oct 27, 2023 4:08 pm
- Location: Las Vegas NV, USA
Re: Can a bash script refresh a wegpage? [SOLVED]
Logansfury wrote: ⤴Sat Feb 17, 2024 5:33 pm Hello,
I was trying with online resources to acquire a bash script that would work with my xdotool and auto refresh a specific Chromium tab for me.
The script I got however always returns it's built-in Tab with name not found error.
Is such a script possible? I would like it to run once a minute until stopped if it's doable. The page I want to refresh has the tab name:
Linux Mint Forums - Index page
forums.linuxmint.com
Thanks for reading,
Logan