How to pause in fish + window size & position

hello
I would like to make some specific modifications to this fish script I created but not sure where to start

my goal is a script that....

a. opens app1 and abc.com together (accomplished this)
b. when app1 closes I would like app2 and def.com to open
c. and windows for abc.com + def.com to be a specific size and position

#!/bin/fish

command app1 &
open https://abc.com &

command app2 &
open https://soundalerts.com &

1 Like

Hey, I like your curiosity :grin:
I don't know much about scripts,

Recommended

Ask questions in these websites it may help you for scripting

This one for running websites in browser through command line

Example

chrome-search://local-ntp/local-ntp.html
2 Likes

Sounds like homework from school.

3 Likes

figured it out.

to create a pause in the fish shell script you need to use the bash command "sleep". to use bash commands in fish you need bass-fish from pamac and you need to drop into bash inside your fish script. specify the amount of time you want to wait in seconds

sudo pacman -S bass-fish
#!/bin/fish

command app1 &
open https://abc.com &

bash &

sleep 30;

command app2;
open https://soundalerts.com;

As for setting window positions & sizes I used "Window Rules" in System Settings. Set up your application and browser windows exactly how you want them. Open System Settings > Window Rules > click Detect Window Properties button and click on the window you want to set a size and location for and all the info will come up, you can then select the properties you want to keep (size & position), then set the properties to the "force" option so that anytime abc.com is opened it automatically goes to the size and position you want it at. hope this helps someone!

:thinking: pamac :thinking: pamac :thinking:

I'm too newb to know what this means :sob:

Before reading this post I was using something like

#!/bin/fish

# New file at /tmp
echo '#!/bin/bash

# Name of the command
cmd_name
' > /tmp/script_name.sh

# Changing Permissions
chmod u+x /tmp/script_name.sh

# Executing in konsole
konsole -e sh /tmp/script_name.sh

# Removing cache
rm /tmp/script_name.sh

This is like embedded script

He’s just teasing you a little bit :laughing:. The screenshots are showing the package is available from chaotic AUR so you can just install it normally (Pamac is not needed).

In general it’s not good to rely on Pamac too much because it has a history of being buggy or breaking stuff. Try paru!

4 Likes