(SOLVED) Yad startup script for ceni

hakerdefo

Yet another dash,


#!/bin/bash

yad --width=420 \
    --title="VSIDO Message Center" \
    --image=vsidoorb_blk_sm_140 \
    --button="Run Ceni:$cenee" \
    --button="Run Wicd:$wiicd"
    --text="Live_Session_Warning
    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 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."  \

cenee=$(xfce4-terminal -e ceni)
wiicd=$(wicd-gtk)

exit 0


This attemp is a wild guess! Hoping for some good!
Cheers!!!
You Can't Always Git What You Want

VastOne

Same issue, everything button clicked or X clicked makes both Ceni and WICD run
VSIDO      VSIDO Change Blog    

    I dev VSIDO

VastOne

#17
I have decided to go with this setup and context

vsido-start (must be made executable)

#! /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 Change Blog    

    I dev VSIDO

hakerdefo

I've a Sunday surprise for VastOne  :)
I finally figured it out  8)
YAD has it's own peculiar ways of doing things and it lacks proper documentation! That was the reason YAD had us all confused!
VastOne, I think user should be able to run either ceni or wicd from the startup message. No need to send him/her on hunt for the wicd. Here is the working script at long last,


#! /bin/bash

action=$(yad --width 420 --entry --title "VSIDO Message Center" \
    --image=vsidoorb_blk_sm_140 \
    --button="gtk-ok:0" --button="gtk-close:1" \
    --text "Live_Session_Warning

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 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.

Choose action:" \
    --entry-text \
    "Run_Ceni" "Run_Wicd")

ret=$?

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

case $action in

Run_Ceni*) cmd="xfce4-terminal -e ceni" ;;
Run_Wicd*) cmd="wicd-gtk --no-tray" ;;
*) exit 1 ;;       

esac

eval exec $cmd



And as PackRat like to say, scrot or it didn't happen,





Cheers!!!
You Can't Always Git What You Want

PackRat

Script works as advertised.

Thought of one issue though. If the user selects ceni to configure the network, will the wicd.service still be running on boot-up since wicd is getting installed? In the past, having a configured /etc/network/interfaces file was incompatible with wicd (and network-manager).
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

I have decided to stick with the Ceni button option and have anyone else click on the already installed and running wicd icon that is there both in the LiveCD sessions and the install

I do appreciate all of the help from everyone most notably hakerdefo and PackRat

@RatMan

Not quite sure of the issue since wicd is installed and running as a service no matter what, just for the extra wifi capabilities it has.  What I see is a blue triangle on the icon telling me wicd is not seeing a network because I already have it configured with ceni.  If I open wicd and go through it's setup and options, it then correctly starts the network... All of mine is wired though, I cannot speak to anything else
VSIDO      VSIDO Change Blog    

    I dev VSIDO

PackRat

An issue of efficiency and compatibility.

If you have a wired (wireless) network and configure it with ceni, you don't need the wicd.service running, or the wicd-gtk tray icon - check out it's memory use with htop. You should now be able to disable the wicd.service with systemctl and still have your network running when you reboot.

If you configured the network with ceni, then use wicd for roaming, in the past that would have caused issues because wicd does not read the /etc/network/interfaces file - it creates it's own configuration files in /etc/wicd. On reboot, it hangs for a while and there would be no network. I believe it still does that.

I don't know what it would require, but having the script disable the wicd.service when ceni is selected for network configuration would be a good thing IMO.
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

misko_2083

Had some spare time to play with yad.  :)
Just some cosmetic changes to the VSIDO Message Center. Tried text-info dialogue but it won't process html so I just added some markup to the existing.

#! /bin/bash

# Greeting window
yad --title="VSIDO Message Center" --center --width=420 --image=vsido-start \
--button=$"Run Ceni                                  :0" \
--button=$"Close                                     :1" \
--text=$"\t\t\t<b><big>Welcome to VSIDO</big></b>\n\n\tDue to changes from Debian, systemd and udev, it is not possible to see every Network Interface that systemd/udev now creates\n
\t<tt>It is recommended that you run <b>Ceni</b> or <b>WICD</b> 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 by clicking on the WICD icon in the system-tray above right</tt>\n
\tSimply 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}" \


if [ $? -eq 0 ] ; then
xfce4-terminal -e ceni

else
exit 0

fi


By the way, this is a way to display Time and date with yad:
while true; do echo "$(echo "Time               Date" | sed 's/^/#/g')\n" "$(date '+%T       %D')"; sleep 1; done | yad --progress --title="Time" --cancel-label="close"

:D

VastOne

@ misko_2083

Thanks for that!  I will look more into making the script a cosmetic makeover
VSIDO      VSIDO Change Blog    

    I dev VSIDO

VastOne

Quote from: PackRat on July 14, 2015, 11:12:56 PM
An issue of efficiency and compatibility.

Snip...

I don't know what it would require, but having the script disable the wicd.service when ceni is selected for network configuration would be a good thing IMO.

Phase two of the script and thank you for the explanation... I will get it done

Thanks!
VSIDO      VSIDO Change Blog    

    I dev VSIDO

PackRat

#25
No problem.

When does this script show up? When logging into the live session, or a first run after an install?

I was thinking you will want to remove the "wicd-gtk --tray" from the ~/.fluxbox/startup file. That app is mainly needed to manage networks; it doesn't need to run once connectivity is established using wicd. Certainly doesn't need to be running if a user decides to go with ceni.

Edit - booted the new iso; script shows when logging into live session.
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

It also shows up on the very first boot after a login

If I can get a two button script to work correctly I would then remove the wicd-gtk option from startup and make it just a choice during the LiveCD and at first boot to get the network working

WICD has always been there and ONLY been there for anyone to use as a gui and for the ease of use in how WICD sees the entire wireless networks

If it were up to me, I would remove it completely... but I have no wireless needs... ::)
VSIDO      VSIDO Change Blog    

    I dev VSIDO

PackRat

Quote from: VastOne on July 15, 2015, 03:35:36 PM
It also shows up on the very first boot after a login

If I can get a two button script to work correctly I would then remove the wicd-gtk option from startup and make it just a choice during the LiveCD and at first boot to get the network working

WICD has always been there and ONLY been there for anyone to use as a gui and for the ease of use in how WICD sees the entire wireless networks

If it were up to me, I would remove it completely... but I have no wireless needs... ::)

Once I booted the newest VSIDO-live, I realized the situation you're actually facing here. I was thinking that if ceni is going to be your preferred method for network connectivity, you will want to remove wicd so that it is not running services in the background (that's always been the default, not a new systemd issue).

I have not done a clean VSIDO install for a while (it's that f'ing stable, people!). Is there still a first-run script to install applications like geany and cups? It would be an easy fix to add wicd to that list for those that want to go that route. That would require some additional configuration (comment out everything but the loopback interface in /e/n/interfaces) for wicd to work properly, though.

Bit of a dilemma.
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

@VastOne @PackRat
Let's suppose VSIDO boots with Wicd disabled and not running. The 'VSIDO Message Center' greets the user and prompt him to choose between Ceni and Wicd. If user decides to use Ceni then there is no need to do anything. User configures the network using Ceni and Wicd can rest in peace. But if user selects Wicd then the 'VSIDO Message Center' will have to start Wicd, Make Wicd to autostart with the system and present user with GTK interface.
If the above is what you guys are trying to achieve then try following Yad startup script,


#! /bin/bash

action=$(yad --width 420 --entry --title "VSIDO Message Center" \
    --image=vsidoorb_blk_sm_140 \
    --button="gtk-ok:0" --button="gtk-close:1" \
    --text "Live_Session_Warning

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 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. 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. You can also select and use the WICD GUI by selecting Run_Wicd. WICD has more robust WIFI connectivity options. Choosing this option will also make WICD to autostart with the system.

Choose action:" \
    --entry-text \
    "Run_Ceni" "Run_Wicd")

ret=$?

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

case $action in

Run_Ceni*) cmd="xfce4-terminal -e ceni" ;;
Run_Wicd*) cmd="xfce4-terminal -e 'sudo systemctl start wicd' && xfce4-terminal -e 'sudo systemctl enable wicd' && wicd-gtk" ;;
*) exit 1 ;;       

esac

eval exec $cmd



As usual the script is absolutely untested in the absence of xfce terminal and systemd on my end. Test it and let me know the results please.
Cheers!!!
You Can't Always Git What You Want

PackRat

Ceni started ok, but the script crashed right after I entered the password for sudo.

Not sure if it's your script, I had wicd installed but it fails to start - get a dbus 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