Results 1 to 10 of 10

Thread: script help

  1. #1
    Join Date
    Dec 2007
    Location
    howard, wi
    Beans
    2,415
    Distro
    Ubuntu 20.04 Focal Fossa

    Lightbulb script help

    running 20.04
    i have this script to output local weather
    #!/bin/bash
    curl http://wttr.in

    however when i run i want to have terminal on maximum size
    how do i do note terminal is normally set to open at smaller size and want to keep it that way only need change when run this script/tks
    quote:He that would live in peace & at ease, Must not speak all he knows,nor judge all he sees.'

  2. #2
    Join Date
    Dec 2014
    Beans
    1,661

    Re: script help

    wmctrl might be what you want.
    Code:
    wmctrl -r :ACTIVE: -b toggle,maximized_vert,maximized_horz
    used in a script will toggle the currently active window - that should be the terminal in which the shell that executes the script is running - to horizontally and vertically maximized and back.

    Holger

  3. #3
    Join Date
    Dec 2007
    Location
    howard, wi
    Beans
    2,415
    Distro
    Ubuntu 20.04 Focal Fossa

    Lightbulb Re: script help

    tks hol but didnt work
    quote:He that would live in peace & at ease, Must not speak all he knows,nor judge all he sees.'

  4. #4
    Join Date
    Dec 2007
    Location
    howard, wi
    Beans
    2,415
    Distro
    Ubuntu 20.04 Focal Fossa

    Lightbulb Re: script help

    okay i can get this script to work
    gnome-terminal --window --maximize
    however when try to tie to the weather script the terminal opens maxed but cant get the weather script to run in it
    quote:He that would live in peace & at ease, Must not speak all he knows,nor judge all he sees.'

  5. #5
    Join Date
    Jun 2016
    Beans
    2,108
    Distro
    Xubuntu 20.04 Focal Fossa

    Re: script help

    Specify your script on command line of gnome-terminal -
    Code:
    gnome-terminal --window --maximize -- '/full/path/to/your/script'
    replacing /full/path/to/your/script with that actual path (keep the quotes as shown in the code box).

    With this method, the terminal might automatically close when the script is completed. If you want to get the chance to review the output, you could add the line
    Code:
    read
    at the end of your script to require pressing Enter to complete the script and thus close the terminal.

  6. #6
    Join Date
    May 2010
    Beans
    980

    Re: script help

    Make sure you mark your script as executable with:
    Code:
    chmod +x /full/path/to/your/script

  7. #7
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    22,163
    Distro
    Ubuntu Mate 16.04 Xenial Xerus

    Re: script help

    Quote Originally Posted by Holger_Gehrke View Post
    wmctrl might be what you want.
    Code:
    wmctrl -r :ACTIVE: -b toggle,maximized_vert,maximized_horz
    used in a script will toggle the currently active window - that should be the terminal in which the shell that executes the script is running - to horizontally and vertically maximized and back.

    Holger
    Worked for me. I use xterms.
    But I really need to set the font to a smaller size for that output to fit on one screen without wrapping.

  8. #8
    Join Date
    Dec 2007
    Location
    howard, wi
    Beans
    2,415
    Distro
    Ubuntu 20.04 Focal Fossa

    Lightbulb Re: script help

    tks everyone for your input
    here is the script that finally worked
    #!/bin/bash
    wmctrl -r :ACTIVE: -b toggle,maximized_vert,maximized_horz
    #!/bin/bash
    '/home/ray/weather'
    quote:He that would live in peace & at ease, Must not speak all he knows,nor judge all he sees.'

  9. #9
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    22,163
    Distro
    Ubuntu Mate 16.04 Xenial Xerus

    Re: script help

    Quote Originally Posted by rburkartjo View Post
    tks everyone for your input
    here is the script that finally worked
    Code:
    #!/bin/bash
    wmctrl -r :ACTIVE: -b toggle,maximized_vert,maximized_horz
    /home/ray/weather
    is probably what you want and if you use curl to hit /usr/bin/curl https://wttr.in/
    then just use,

    Code:
    #!/bin/bash
    wmctrl -r :ACTIVE: -b toggle,maximized_vert,maximized_horz
    /usr/bin/curl   https://wttr.in/
    to save a few extra processes from starting.

  10. #10
    Join Date
    Dec 2007
    Location
    howard, wi
    Beans
    2,415
    Distro
    Ubuntu 20.04 Focal Fossa

    Lightbulb Re: script help

    tks fu
    quote:He that would live in peace & at ease, Must not speak all he knows,nor judge all he sees.'

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •