Author Topic: (SOLVED) Yad startup script for ceni  (Read 8704 times)

hakerdefo

  • Posts: 494
    • View Profile
    • Looking at Linux through the Windows of Life
Re: Yad startup script for ceni
« Reply #30 on: July 16, 2015, 06:43:26 AM »
PackRat thanks for testing. Please run the following command first and then retest the script,
Code: [Select]
sudo rm /etc/wicd/*.confCheers!!!
You Can't Always Git What You Want

PackRat

  • Posts: 1818
    • View Profile
Re: Yad startup script for ceni
« Reply #31 on: July 16, 2015, 12:24:57 PM »
No change - did manage to get wicd purged and re-installed so it is working.

There is an error message in the terminal before it quite - something about a non-native systemd service(?).

Code: [Select]
systemctl list-units | grep wicd
does list a wicd.service

Any idea what log, if any, would have that error?
I am tired of talk that comes to nothing.
-- Chief Joseph

...the sun, the darkness, the winds are all listening to what we have to say.
-- Geronimo

hakerdefo

  • Posts: 494
    • View Profile
    • Looking at Linux through the Windows of Life
Re: Yad startup script for ceni
« Reply #32 on: July 16, 2015, 06:32:47 PM »
Thanks there PackRat. I'll need your help here. I want you to run following commands in the exact order and observe their outcome.
First just check if wicd is running or not,
Code: [Select]
sudo systemctl status wicd
If wicd is running then try to stop it,
Code: [Select]
sudo systemctl stop wicd
And then try and start wicd,
Code: [Select]
sudo systemctl start wicd
Try and run the GTK client,
Code: [Select]
wicd-gtk
Next check if it is enabled to startup at boot,
Code: [Select]
sudo systemctl is-enabled wicd
If it is not then try and make it autostart with system,
Code: [Select]
sudo systemctl enable wicd
Reboot and check if wicd has started and whether the wicd-gtk is running in the tint2 tray.
Thanks in advance PackRat!
Cheers!!!
You Can't Always Git What You Want

PackRat

  • Posts: 1818
    • View Profile
Re: Yad startup script for ceni
« Reply #33 on: July 16, 2015, 07:02:40 PM »
No error messages.

Wicd is enabled and running so all the commands are working like they are supposed to. It's actually how I manage my wireless on the laptop now. The tray applet doesn't show up in the system tray unless -

Code: [Select]
wicd-gtk --tray
is in an autostart file. I don't have that in my ~/.fluxbox/startup; it's mainly for those that regularly roam between networks.
I am tired of talk that comes to nothing.
-- Chief Joseph

...the sun, the darkness, the winds are all listening to what we have to say.
-- Geronimo

hakerdefo

  • Posts: 494
    • View Profile
    • Looking at Linux through the Windows of Life
Re: Yad startup script for ceni
« Reply #34 on: July 16, 2015, 07:06:58 PM »
Thanks for testing them out! Then why the same commands are failing in the script? Well another puzzle! Any ideas?
You Can't Always Git What You Want

PackRat

  • Posts: 1818
    • View Profile
Re: Yad startup script for ceni
« Reply #35 on: July 16, 2015, 07:34:09 PM »
No specific ideas. But I did change the wicd command to:

Code: [Select]
Run_Wicd*) cmd="xfce4-terminal -e 'sudo htop' && xfce4-terminal -e 'sudo ps_mem' && wicd-gtk" ;;
and I did get an instance of xfce4-terminal with htop running after entering my password. The second xfce4-terminal did not start.
I am tired of talk that comes to nothing.
-- Chief Joseph

...the sun, the darkness, the winds are all listening to what we have to say.
-- Geronimo

VastOne

  •      v-ger
  • Posts: 3867
    • View Profile
    • VSIDO Community
Re: Yad startup script for ceni
« Reply #36 on: July 16, 2015, 11:10:31 PM »
I finally figured out the failures with the button style I wanted and now have it working... It was all in the single [ ] brackets

Once I changed to double brackets and added the ret=$? variables, everything fell into place...

This script has  been tested on new installs and all works as it should and everything exits as it should

This will be the final vsido-start script and will be on the next ISO's

vsido-start (must be made executable)

Code: [Select]
#! /bin/bash

# Greeting window
action=$(yad --title="VSIDO Messge Center" \
--width=420 \
--image=vsido-start \
--button=$"Run Ceni        :1" \
--button=$"Run WICD        :2" \
--button=$"Close           :3" \
--text=$"Welcome to VSIDO. Due to changes from Debian, systemd and udev, it is not possible to see every Network Interface that systemd/udev now creates

It is recommended that you run Ceni or WICD to establish your network before you begin. Ceni is a Curses user interface for configuring network interfaces with ifupdown developed by Kel Modderman and used for setting up networks on several distros. You can also select and use the WICD GUI that has more robust WIFI connectivity options

Simply select your Network Interface and then Accept-Enter and finally Yes to exit Ceni.  Your network is then ready to go and connectivity to the Internet established
${custom_text}" \ )

ret=$?

[[ $ret -eq 3 ]] && exit 0


if [[ $ret -eq 1 ]] ; then
xfce4-terminal -e ceni
exit 0
fi

if [[ $ret -eq 2 ]] ; then
wicd-gtk -n
exit 0
fi
VSIDO      VSIDO Twitter     VSIDO FB     VSIDO Google+   

I dev VSIDO

VastOne

  •      v-ger
  • Posts: 3867
    • View Profile
    • VSIDO Community
Re: Yad startup script for ceni
« Reply #37 on: July 17, 2015, 02:44:06 AM »
A new install of VSIDO x32 uses 84 MiB on boot even with wicd services running...

Just a tidbit of info...

BTW, I have always removed and purge wicd as a first step on any distro I used that had it

Including VSIDO...  :P
VSIDO      VSIDO Twitter     VSIDO FB     VSIDO Google+   

I dev VSIDO

VastOne

  •      v-ger
  • Posts: 3867
    • View Profile
    • VSIDO Community
Re: Yad startup script for ceni
« Reply #38 on: July 17, 2015, 03:51:00 AM »
I want to say Thank You to everyone who helped with this script

VSIDO      VSIDO Twitter     VSIDO FB     VSIDO Google+   

I dev VSIDO

hakerdefo

  • Posts: 494
    • View Profile
    • Looking at Linux through the Windows of Life
Re: (SOLVED) Yad startup script for ceni
« Reply #39 on: July 19, 2015, 06:22:25 PM »
EDIT BEGINS (20, July 2015 13:36 [IST]):
Thanks to PackRat I've made some critical changes to the script. Thanks again PackRat!
EDIT ENDS :

VastOne has already decided the vsido-start script but I've spent a good deal of sunday afternoon on this one so here is a different version of vsido-start. I want to thank relentless ratman PackRat for his suggestions,ideas and testing.
This vsido-start script once launched works like this,
* Presents user with the information written by VastOne and gives option of launching either Ceni or Wicd.
* If user selects Ceni, then the script will check the running status of Wicd and if it is running then the script offers option to stop Wicd or keep it running, Next the script checks if Wicd is autostarting or not, If Wicd is enabled to autostart then the script will offer option to disable it or keep it enabled, And finally the script will launch Ceni.
* If user selects Wicd, then the script will check the running status of Wicd service, If the Wicd service is dead then the script will start the Wicd service, Next the script checks if Wicd is autostarting or not. If Wicd is disabled from autostarting then the script will enable Wicd autostart, And finally the script will launch Wicd GTK interface.
Here is the script,

Code: [Select]
#!/bin/bash

testyad=`which yad`

if [ "$testyad" = "" ]; then
sudo apt-get -y -q install yad
fi

if [ "$testyad" != "" ]; then
DIALOGMENU="`which yad` --window-icon=vsido-start --width=420 --height=393 --center"
DIALOG="`which yad` --window-icon=vsido-start --width=420 --height=393 --center"
TITLE="--always-print-result --dialog-sep --image=vsido-start --title="
TEXT="--text="
ENTRY="--entry "
ENTRYTEXT="--entry-text "
MENU="--list --expand-column=0 --column=Pick --column=Info"
YESNO=" --button=Yes:0 --button=No:1 "
MSGBOX=" --button=Ok:0 "
TITLETEXT="Vsido Message Center"
fi

mainmenu () {

CHOICES=`$DIALOGMENU $TITLE"$TITLETEXT" --button=Ok:0 --button=Exit:1 $MENU $TEXT"Welcome to VSIDO. Due to changes from Debian, systemd and udev, it is not possible to see every Network Interface that systemd/udev now creates.

It is recommended that you run Ceni or WICD to establish your network before you begin. Ceni is a Curses user interface for configuring network interfaces with ifupdown developed by Kel Modderman and used for setting up networks on several distros. You can also select and use the WICD GUI that has more robust WIFI connectivity options.

Simply select your Network Interface and then Accept-Enter and finally Yes to exit Ceni.  Your network is then ready to go and connectivity to the Internet established.

Please select an option:
" \
Ceni "Run Ceni" \
Wicd "Run Wicd"`

if [ "$?" = "0" ]; then
CHOICE=`echo $CHOICES | cut -d "|" -f 1`
else
exit 0
fi

if [ "$CHOICE" = "Ceni" ]; then
cenimenu
elif [ "$CHOICE" = "Wicd" ]; then
wicdmenu
else
exit 0
fi
}

cenimenu () {
 
wistatus=$(sudo systemctl status wicd | grep "dead")
wiboot=$(sudo systemctl status wicd | grep "disabled")

if [[ -z "$wistatus" ]]; then
CHOICES=`$DIALOGMENU $TITLE"$TITLETEXT" --button=Ok:0 --button=Exit:1 $MENU $TEXT"You have decided to use Ceni. Wicd is no longer needed. Stop Wicd?
" \
Stop "Stop Wicd" \
Cancel "Leave Wicd Running"`

if [ "$?" = "0" ]; then
CHOICE=`echo $CHOICES | cut -d "|" -f 1`
else
exit 0
fi

if [ "$CHOICE" = "Stop" ]; then
sudo systemctl stop wicd
$DIALOG $TITLE"Vsido Mesage Center" $MSGBOX $TEXT"Wicd service has been stopped. \nClick OK to proceed."
fi

if [ "$CHOICE" = "Cancel" ]; then
$DIALOG $TITLE"Vsido Mesage Center" $MSGBOX $TEXT"Wicd service is kept running. \nClick OK to proceed."
fi
fi

if [[ -z "$wiboot" ]]; then
CHOICES=`$DIALOGMENU $TITLE"$TITLETEXT" --button=Ok:0 --button=Exit:1 $MENU $TEXT"You have decided to use Ceni. Would you like to disable Wicd from autostarting?
" \
Disable "Disable Wicd Autostart" \
Cancel "Keep Wicd Autostart Enabled"`

if [ "$?" = "0" ]; then
CHOICE=`echo $CHOICES | cut -d "|" -f 1`
else
exit 0
fi

if [ "$CHOICE" = "Disable" ]; then
sudo systemctl disable wicd
$DIALOG $TITLE"Vsido Mesage Center" $MSGBOX $TEXT"Wicd autostart has been disabled. \nClick OK to proceed."
xfce4-terminal -e 'sudo ceni'
fi

if [ "$CHOICE" = "Cancel" ]; then
$DIALOG $TITLE"Vsido Mesage Center" $MSGBOX $TEXT"Wicd autostart is kept enabled. \nClick OK to proceed."
xfce4-terminal -e 'sudo ceni'
fi
else
xfce4-terminal -e 'sudo ceni'
fi
exit 0
}

wicdmenu () {

wistatus=$(sudo systemctl status wicd | grep "dead")
wiboot=$(sudo systemctl status wicd | grep "disabled")

if [[ -n "$wistatus" ]]; then
$DIALOG $TITLE"Vsido Mesage Center" $MSGBOX $TEXT"Wicd service is not running. \nClick OK to start Wicd."
sudo systemctl start wicd
fi

if [[ -n "$wiboot" ]]; then
$DIALOG $TITLE"Vsido Mesage Center" $MSGBOX $TEXT"Wicd service is disabled from autostarting. \nClick OK to autostart Wicd."
sudo systemctl enable wicd
wicd-gtk --no-tray
else
wicd-gtk --no-tray
fi
exit 0
}

mainmenu



Waiting for the views-reviews especially from VastOne and PackRat.
Cheers!!!
You Can't Always Git What You Want

PackRat

  • Posts: 1818
    • View Profile
Re: (SOLVED) Yad startup script for ceni
« Reply #40 on: July 19, 2015, 09:05:35 PM »
The wicd selection is working.

The ceni selection goes through the wicd options, then fails to start ceni.

This command:

Code: [Select]
xfce4-terminal -e sudo ceni
yields the error message "unknown option "ceni"

In a terminal, this will start ceni

Code: [Select]
xfce4-terminal -e 'sudo ceni'
I made the changes in the script and ceni will start; I don't know if that is the proper syntax for your script though.

Well done.
I am tired of talk that comes to nothing.
-- Chief Joseph

...the sun, the darkness, the winds are all listening to what we have to say.
-- Geronimo

hakerdefo

  • Posts: 494
    • View Profile
    • Looking at Linux through the Windows of Life
Re: (SOLVED) Yad startup script for ceni
« Reply #41 on: July 20, 2015, 08:14:01 AM »
PackRat you are being too modest here! That little change is critical! Actually I tested the script on Sakura terminal and it didn't complain about anything but it seems xfce4 terminal has it's own ways to handle commands.
Thanks again from the bottom of my heart, really! Without your testing and support nothing would have been possible!
Cheers to you PackRat  8)
You Can't Always Git What You Want

hakerdefo

  • Posts: 494
    • View Profile
    • Looking at Linux through the Windows of Life
Re: (SOLVED) Yad startup script for ceni
« Reply #42 on: July 20, 2015, 08:45:57 AM »
Taking cues from VastOne. This one is for PackRat,

You Can't Always Git What You Want

PackRat

  • Posts: 1818
    • View Profile
Re: (SOLVED) Yad startup script for ceni
« Reply #43 on: July 20, 2015, 12:41:24 PM »
@hackerdefo -

no problem.

nice to see sakura getting some love; nice terminal app that flies under the radar.

As a test, I changed:

Code: [Select]
xfce4-terminal -e 'sudo ceni'
to

Code: [Select]
xterm -fa fixed-11 -e sudo ceni
and it works - that should make it disto agnostic for any non-vsido users who are lurking about.
I am tired of talk that comes to nothing.
-- Chief Joseph

...the sun, the darkness, the winds are all listening to what we have to say.
-- Geronimo

hakerdefo

  • Posts: 494
    • View Profile
    • Looking at Linux through the Windows of Life
Re: (SOLVED) Yad startup script for ceni
« Reply #44 on: July 20, 2015, 07:21:59 PM »
'xterm -fa fixed-11 -e'
I didn't know about this one! This is great for scripting! Thanks a metric ton for this tip PackRat!
Cheers!!!
You Can't Always Git What You Want