YAD Examples

Several complex YAD scripts

List of scripts:
Urxvt configurator
Frontend for find(1)
System information

Configurator for rxvt-unicode

This script read URxvt settings from Xresources database and write new ones to the ~/.Xresources or separate file specified from the command line

Code:

    1 #! /bin/bash
    2 # -*- mode: sh -*-
    3 
    4 
    5 KEY=$RANDOM
    6 
    7 res1=$(mktemp --tmpdir term-tab1.XXXXXXXX)
    8 res2=$(mktemp --tmpdir term-tab2.XXXXXXXX)
    9 res3=$(mktemp --tmpdir term-tab3.XXXXXXXX)
   10 
   11 out=$(mktemp --tmpdir term-out.XXXXXXXX)
   12 
   13 # cleanup
   14 trap "rm -f $res1 $res2 $res3 $out" EXIT
   15 
   16 export YAD_OPTIONS="--bool-fmt=t --separator='\n' --quoted-output"
   17 
   18 rc_file="${1:-$HOME/.Xresources}"
   19 
   20 # parse rc file
   21 while read ln; do
   22     case $ln in
   23         *allow_bold:*) bold=$(echo ${ln#*:}) ;;
   24         *font:*) font=$(echo ${ln#*:}) ;;
   25         *scrollBar:*) sb=$(echo ${ln#*:}) ;;
   26         *loginShell:*) ls=$(echo ${ln#*:}) ;;
   27         *title:*) title=$(echo ${ln#*:}) ;;
   28         *termName:*) term=$(echo ${ln#*:}) ;;
   29         *geometry:*) geom=$(echo ${ln#*:}) ;;
   30         *foreground:*) fg=$(echo ${ln#*:}) ;;
   31         *background:*) bg=$(echo ${ln#*:}) ;;
   32         *highlightColor:*) hl=$(echo ${ln#*:}) ;;
   33         *highlightTextColor:*) hlt=$(echo ${ln#*:}) ;;
   34         *color0:*) cl0=$(echo ${ln#*:}) ;;
   35         *color1:*) cl1=$(echo ${ln#*:}) ;;
   36         *color2:*) cl2=$(echo ${ln#*:}) ;;
   37         *color3:*) cl3=$(echo ${ln#*:}) ;;
   38         *color4:*) cl4=$(echo ${ln#*:}) ;;
   39         *color5:*) cl5=$(echo ${ln#*:}) ;;
   40         *color6:*) cl6=$(echo ${ln#*:}) ;;
   41         *color7:*) cl7=$(echo ${ln#*:}) ;;
   42         *color8:*) cl8=$(echo ${ln#*:}) ;;
   43         *color9:*) cl9=$(echo ${ln#*:}) ;;
   44         *color10:*) cl10=$(echo ${ln#*:}) ;;
   45         *color11:*) cl11=$(echo ${ln#*:}) ;;
   46         *color12:*) cl12=$(echo ${ln#*:}) ;;
   47         *color13:*) cl13=$(echo ${ln#*:}) ;;
   48         *color14:*) cl14=$(echo ${ln#*:}) ;;
   49         *color15:*) cl15=$(echo ${ln#*:}) ;;
   50         !*) ;; # skip comments
   51         "") ;; # skip empty lines
   52         *) misc+=$(echo "$ln\n") ;;
   53     esac
   54 done < <(xrdb -query | grep -i rxvt)
   55 
   56 width=${geom%%x*}
   57 height=${geom##*x}
   58 fn=$(pfd -p -- "$font")
   59 
   60 echo $font
   61 echo $fn
   62 
   63 # main page
   64 yad --plug=$KEY --tabnum=1 --form \
   65     --field=$"Title:" "${title:-Terminal}" \
   66     --field=$"Width::num" ${width:-80} \
   67     --field=$"Height::num" ${height:-25} \
   68     --field=$"Font::fn" "${fn:-Monospace}" \
   69     --field=$"Term:" "${term:-rxvt-256color}" \
   70     --field=$"Enable login shell:chk" ${ls:-false} \
   71     --field=$"Enable scrollbars:chk" ${sb:-false} \
   72     --field=$"Use bold font:chk" ${bold:-false} \
   73     --field=":lbl" "" \
   74     --field=$"Foreground::clr" ${fg:-#ffffff} \
   75     --field=$"Background::clr" ${bg:-#000000} \
   76     --field=$"Highlight::clr" ${hl:-#0000f0} \
   77     --field=$"Highlight text::clr" ${hlt:-#ffffff} > $res1 &
   78 
   79 # palette page
   80 yad --plug=$KEY --tabnum=2 --form --columns=2 \
   81     --field=$"Black::clr" ${cl0:-#2e3436} \
   82     --field=$"Red::clr" ${cl1:-#cc0000} \
   83     --field=$"Green::clr" ${cl2:-#4e9a06} \
   84     --field=$"Brown::clr" ${cl3:-#c4a000} \
   85     --field=$"Blue::clr" ${cl4:-#3465a4} \
   86     --field=$"Magenta::clr" ${cl5:-#75507b} \
   87     --field=$"Cyan::clr" ${cl6:-#06989a} \
   88     --field=$"Light gray::clr" ${cl7:-#d3d7cf} \
   89     --field=$"Gray::clr" ${cl8:-#555753} \
   90     --field=$"Light red::clr" ${cl9:-#ef2929} \
   91     --field=$"Light green::clr" ${cl10:-#8ae234} \
   92     --field=$"Yellow::clr" ${cl11:-#fce94f} \
   93     --field=$"Light blue::clr" ${cl12:-#729fcf} \
   94     --field=$"Light magenta::clr" ${cl13:-#ad7fa8} \
   95     --field=$"Light cyan::clr" ${cl14:-#34e2e2} \
   96     --field=$"White::clr" ${cl15:-#eeeeec} > $res2 &
   97 
   98 # misc page
   99 echo -e $misc | yad --plug=$KEY --tabnum=3 --text-info --editable > $res3 &
  100 
  101 # main dialog
  102 yad --window-icon=utilities-terminal \
  103     --notebook --key=$KEY --tab=$"Main" --tab=$"Palette" --tab=$"Misc" \
  104     --title=$"Terminal settings" --image=utilities-terminal \
  105     --width=400 --image-on-top --text=$"Terminal settings (URxvt)"
  106 
  107 # recreate rc file
  108 if [[ $? -eq 0 ]]; then
  109     mkdir -p ${rc_file%/*}
  110 
  111     eval TAB1=($(< $res1))
  112     eval TAB2=($(< $res2))
  113 
  114     echo -e "! urxvt settings\n" > $out
  115 
  116     # add main
  117     cat <<EOF >> $out
  118 URxvt.title: ${TAB1[0]}
  119 URxvt.geometry: ${TAB1[1]}x${TAB1[2]}
  120 URxvt.font: $(pfd "${TAB1[3]}")
  121 URxvt.termName: ${TAB1[4]}
  122 URxvt.loginShell: ${TAB1[5]}
  123 URxvt.scrollBar: ${TAB1[6]}
  124 URxvt.allow_bold: ${TAB1[7]}
  125 
  126 URxvt.foreground: ${TAB1[9]}
  127 URxvt.background: ${TAB1[10]}
  128 URxvt.highlightColor: ${TAB1[11]}
  129 URxvt.highlightTextColor: ${TAB1[12]}
  130 EOF
  131     # add palette
  132     echo >> $out
  133     for i in {0..15}; do
  134         echo "URxvt.color$i: ${TAB2[$i]}" >> $out
  135     done
  136     echo >> $out
  137 
  138     # add misc
  139     cat $res3 >> $out
  140     echo >> $out
  141 
  142     # load new settings
  143     #xrdb -merge $out
  144     
  145     if [[ $rc_file == $HOME/.Xresources ]]; then
  146         [[ -e $rc_file ]] && sed -i "/^URxvt.*/d" $rc_file
  147         cat $out >> $rc_file
  148     else
  149         mv -f $out $rc_file
  150     fi    
  151 fi

Screenshot:

Frontend for find(1) command

This script uses find(1) and grep(1) commands for finding files by specified conditions including search of content

Code:

    1 #! /bin/sh
    2 # -*- mode: sh -*-
    3 
    4 export find_cmd='@bash -c "run_find %1 %2 %3 %4 %5"'
    5 
    6 export fts=$(mktemp -u --tmpdir find-ts.XXXXXXXX)
    7 export fpipe=$(mktemp -u --tmpdir find.XXXXXXXX)
    8 mkfifo "$fpipe"
    9 
   10 trap "rm -f $fpipe $fts" EXIT
   11 
   12 fkey=$(($RANDOM * $$))
   13 
   14 function run_find
   15 {
   16     echo "6:@disable@"
   17     if [[ $2 != TRUE ]]; then
   18         ARGS="-name '$1'"
   19     else
   20         ARGS="-regex '$1'"
   21     fi
   22     if [[ -n "$4" ]]; then
   23         dt=$(echo "$4" | awk -F. '{printf "%s-%s-%s", $3, $2, $1}')
   24         touch -d "$dt" $fts
   25         ARGS+=" -newer $fts"
   26     fi
   27     if [[ -n "$5" ]]; then
   28         ARGS+=" -exec grep -q -E '$5' {} \;"
   29     fi
   30     ARGS+=" -printf '%p\n%s\n%M\n%TD %TH:%TM\n%u/%g\n'"
   31     echo -e '\f' >> "$fpipe"
   32     eval find "$3" $ARGS >> "$fpipe"
   33     echo "6:$find_cmd"
   34 }
   35 export -f run_find
   36 
   37 exec 3<> $fpipe
   38 
   39 yad --plug="$fkey" --tabnum=1 --form --field=$"Name" '*' --field=$"Use regex:chk" 'no' \
   40     --field=$"Directory:dir" '' --field=$"Newer than:dt" '' \
   41     --field=$"Content" '' --field="yad-search:fbtn" "$find_cmd" &
   42 
   43 yad --plug="$fkey" --tabnum=2 --list --no-markup --dclick-action="xdg-open '%s'" \
   44     --text $"Search results:" --column=$"Name" --column=$"Size:sz" --column=$"Perms" \
   45     --column=$"Date" --column=$"Owner" --search-column=1 --expand-column=1 <&3 &
   46 
   47 yad --paned --key="$fkey" --button="yad-close:1" --width=700 --height=500 \
   48     --title=$"Find files" --window-icon="system-search"
   49 
   50 exec 3>&-

Screenshot:

Gather and show information about system

This script shows information about system, such as hardware info, loaded kernel modules and so on

Code:

    1 #! /bin/sh
    2 # -*- mode: sh -*-
    3 
    4 YAD_OPTIONS="--window-icon='dialog-information' --name=IxSysinfo"
    5 
    6 KEY=$RANDOM
    7 
    8 function show_mod_info {
    9     TXT="\\n<span face='Monospace'>$(modinfo $1 | sed 's/&/\&amp;/g;s/</\&lt;/g;s/>/\&gt;/g')</span>"
   10     yad --title=$"Module information" --button="yad-close" --width=500 \
   11         --image="application-x-addon" --text="$TXT"
   12 }
   13 export -f show_mod_info
   14 
   15 # CPU tab
   16 lscpu | sed -r "s/:[ ]*/\n/" |\
   17     yad --plug=$KEY --tabnum=1 --image=cpu --text=$"CPU information" \
   18         --list --no-selection --column=$"Parameter" --column=$"Value" &
   19 
   20 # Memory tab
   21 sed -r "s/:[ ]*/\n/" /proc/meminfo |\
   22     yad --plug=$KEY --tabnum=2 --image=memory --text=$"Memory usage information" \
   23         --list --no-selection --column=$"Parameter" --column=$"Value" &
   24 
   25 # Harddrive tab
   26 df -T | tail -n +2 | awk '{printf "%s\n%s\n%s\n%s\n%s\n%s\n", $1,$7, $2, $3, $4, $6}' |\
   27     yad --plug=$KEY --tabnum=3 --image=drive-harddisk --text=$"Disk space usage" \
   28         --list --no-selection --column=$"Device" --column=$"Mountpoint" --column=$"Type" \
   29         --column=$"Total:sz" --column=$"Free:sz" --column=$"Usage:bar" &
   30 
   31 # PCI tab
   32 lspci -vmm | sed 's/\&/\&amp;/g' | grep -E "^(Slot|Class|Vendor|Device|Rev):" | cut -f2 |\
   33     yad --plug=$KEY --tabnum=4 --text=$"PCI bus devices" \
   34         --list --no-selection --column=$"ID" --column=$"Class" \
   35         --column=$"Vendor" --column=$"Device" --column=$"Rev" &
   36 
   37 # Modules tab
   38 awk '{printf "%s\n%s\n%s\n", $1, $3, $4}' /proc/modules | sed "s/[,-]$//" |\
   39     yad --plug=$KEY --tabnum=5 --text=$"Loaded kernel modules" \
   40         --image="application-x-addon" --image-on-top \
   41         --list --dclick-action='bash -c "show_mod_info %s"' \
   42         --column=$"Name" --column=$"Used" --column=$"Depends" &
   43 
   44 # Battery tab
   45 ( acpi -i ; acpi -a ) | sed -r "s/:[ ]*/\n/" | yad --plug=$KEY --tabnum=6 \
   46     --image=battery --text=$"Battery state" --list --no-selection \
   47     --column=$"Device" --column=$"Details" &
   48 
   49 # Sensors tab
   50 SENSORS=($(sensors | grep -E '^[^:]+$'))
   51 sid=1
   52 cid=1
   53 
   54 for s in ${SENSORS[@]}; do
   55     echo -e "s$sid\n<b>$s</b>\n"
   56     sensors -A "$s" | tail -n +2 | while read ln; do
   57         [[ $ln == "" ]] && continue
   58         echo "$cid:s$sid"
   59         echo $ln | sed -r 's/:[ ]+/\n/'
   60         ((cid++))
   61     done
   62     ((sid++))
   63 done | yad --plug=$KEY --tabnum=7 --text=$"Temperature sensors information" \
   64     --list --tree --tree-expanded --no-selection --column=$"Sensor" --column=$"Value" &
   65 
   66 # main dialog
   67 TXT=$"<b>Hardware system information</b>\\n\\n"
   68 TXT+=$"\\tOS: $(lsb_release -ds) on $(hostname)\\n"
   69 TXT+=$"\\tKernel: $(uname -sr)\\n\\n"
   70 TXT+="\\t<i>$(uptime)</i>"
   71 
   72 yad --notebook --width=600 --height=450 --title=$"System info" --text="$TXT" --button="yad-close" \
   73     --key=$KEY --tab=$"CPU" --tab=$"Memory" --tab=$"Disks" --tab=$"PCI" --tab=$"Modules" \
   74     --tab=$"Battery" --tab=$"Sensors" --active-tab=${1:-1}

Screenshot:

YAD Examples: 1 комментарий

  1. #!/bin/bash
    # ======================>2019> nikonik@chita.ru << :
    # ===================================================
    # : ____ _ _ :
    # : / ___|| |_ ___ _ __| | __ :
    # : \___ \| __/ _ \| '__| |/ / :
    # : ___) | || (_) | | | Setting_Styles < XXX .
    # Copyright © Nikolay Andriychuk.
    # Inherits: acknowledgement.
    # yad – display GTK+ dialogs in shell scripts .
    # XXX > YAD is the fork of Zenity program logfile
    #BASH_XTRACEFD=19

    #set -x

    # Проверить зависимости:
    [[ “$XDG_CURRENT_DESKTOP” == “XFCE” ]] || exit 1
    echo “$XDG_CURRENT_DESKTOP”
    command -v yad gifsicle scrot wmctrl >/dev/null 2>&1 || { echo >&2 “I require yad gifsicle scrot wmctrl but it not installed. Aborting.”; exit 1; }

    llkey=$(($RANDOM * $$))

    cd `dirname $0`; echo “$PWD”

    if [ ! -f “/tmp/Stork-index.theme” ]; then
    echo -e “1200×640+266+73” > /tmp/stork_geometry
    ./Setting-style/setting-create/setting-create.sh
    wait
    fi

    function sayonara {
    XWININFO=$(xwininfo -id $YAD_XID)
    ARRAY=(${XWININFO#* X: })
    AX=${ARRAY[0]}
    AY=${ARRAY[4]}
    RX=${ARRAY[8]}
    RY=${ARRAY[12]}
    W=${ARRAY[14]}
    H=${ARRAY[16]}
    X=$((AX-RX))
    Y=$((AY-RY))
    echo “$W”x”$H”+”$X”+”$Y” > /tmp/stork_geometry
    kill -s SIGUSR1 $YAD_PID
    }; export -f sayonara

    help_stork () { yad –on-toop –borders=20 \
    –window-icon=”help-browser” –title=”Help” –text=”
    \ Stork Dizayn _ Styles of design.

    Stork Dizayn это набор программ,
    которые обеспечивают полнофункциональную рабочую среду Xfce.

    Следующие программы вместе с интегриванными являются частью ядра Stork Dizayn:

    Поддержка настроек Менеджер рабочего стола (xfdesktop)
    Устанавливает цвет фона или изображение с дополнительным меню приложения или значки для свёрнутых приложений, ярлыков, устройств и каталогов.

    Поддержка настроек Панель (xfce4-panel)
    Ярлыки, кнопки окон, меню приложений, переключатель рабочих столов и другое.

    Поддержка настроек Менеджер сеансов (xfce4-session)
    Восстанавливает ваш предыдущий сеанс работы и позволяет выключать компьютер из Xfce Compton Compiz Metacitu Emerald…

    Поддержка настроек (xfce4-settings)
    Конфигурация системы для контроля различных аспектов рабочего стола, например, внешнего вида, дисплея, клавиатуры и настроек мыши.

    Stork Dizayn также является программой, содержащей несколько библиотек, которые хорошо интегрируются в окружение рабочего стола
    и помогают создавать приложения автонастройки.

    Компоненты Stork Dizayn распространяются под условиями свободных лицензий или лицензий открытого кода:
    GPL и BSDL для приложений и LGPL и BSDL для библиотек.
    Подробности можно найти в документации, в исходном коде и на веб-сайте Stork Dizayn (http://www.Stork Dizayn. none).

    Благодарим вас за проявленный интерес к Stork Dizayn.

    – От разработчика Stork Dizayn: nikonik@chita.ru

    }; export -f help_stork

    Panel_num=$(grep –only-matching –max-count=1 ‘panel-[0-1]’ ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml | head -n1) 2> /dev/null

    set_panel_p(){

    xfconf-query –channel xfce4-panel –property “$@”
    }

    WMANAGER=$(wmctrl -m | grep Name: | awk ‘{print $2}’)
    GTKTHEME=”$(xfconf-query -c xsettings -p /Net/ThemeName 2> /dev/null)”
    GTK3THEME=”$(cat ~/.Setting-t-ini.txt | head -n1 2> /dev/null)”
    [[ -z ${GTK3THEME} ]] && GTK3THEME=”${GTKTHEME}”

    NUMET=”5″
    if pidof gtk-window-decorator; then
    BTHEMEXME=”$(gsettings get org.gnome.metacity.theme name | tr -d \’\” )”
    THEMEXM=”metacity-1″
    TXTMXEM=”themes”
    elif [[ “$WMANAGER” == ‘Metacity’ ]]; then
    BTHEMEXME=”$(gsettings get org.gnome.metacity.theme name | tr -d \’\” )”
    THEMEXM=”metacity-1″
    TXTMXEM=”themes”
    elif `ps -ef | grep ‘[e]merald’`; then
    BTHEMEXME=$(cat ~/.emerald/theme/themename | gawk -F’ ‘ ‘{print $NF}’ | tr -d \’\” )
    WMANAGER=”Emerald”
    TXTMXEM=”emerald/themes”
    NUMET=”6″
    elif [[ “$WMANAGER” == ‘Xfwm4’ ]]; then
    BTHEMEXME=”$(xfconf-query -c xfwm4 -p /general/theme -v | tr -d \’\” )”
    THEMEXM=”xfwm4″
    TXTMXEM=”themes”
    WMANAGER=”Themes_Xfwm4″
    else
    error_exit
    fi

    themelist=”Default”
    for dk in $(cat ./NetgtkTheme|grep -se “gtk-2.0″|cut -d/ -f1-5); do
    theme=${dk##*/}
    if [[ -d “${dk}/gtk-2.0″ ]]; then
    [[ $themelist ]] && themelist=”$themelist!”
    [[ $theme == $GTKTHEME ]] && theme=”^$theme”
    themelist+=”$theme”
    fi
    done

    theme3list=
    for dgk in $(cat ./NetgtkTheme|grep -se “gtk-3.0″|cut -d/ -f1-5); do
    theme=${dgk##*/}
    if [[ -d “${dgk}/gtk-3.0″ ]]; then
    [[ $theme3list ]] && theme3list=”$theme3list!”
    [[ $theme == $GTK3THEME ]] && theme=”^$theme”
    theme3list+=”$theme”
    fi
    done

    WhemeBorders=
    for dbk in $(cat ./GeneralTheme|grep -se “${THEMEXM}”|cut -d/ -f1-${NUMET}); do
    theme=${dbk##*/}
    if [[ -d “${dbk}/${THEMEXM}” ]]; then
    [[ $WhemeBorders ]] && WhemeBorders=”$WhemeBorders!”
    [[ $theme == $BTHEMEXME ]] && theme=”^$theme”
    WhemeBorders+=”$theme”
    fi
    done

    set_gtktri_t(){
    GTK3THEME=$1
    [[ -z $GTK3THEME ]] && GTK3THEME=$(xfconf-query -c xsettings -p /Net/ThemeName -v)
    GTK3DIR=$(LANG=C; find /usr/share/themes/${GTK3THEME}/ ~/.themes/${GTK3THEME}/ ~/.local/share/themes/${GTK3THEME}/ -type d -name ‘gtk-3.0’ 2>&1 | grep -v ‘No such file or directory’ | head -n 1)

    if ! [[ -d ${GTK3DIR} ]]; then
    echo “No such file or directory themes gtk-3.0 :EXIT”
    rm -R ~/.config/gtk-3.0
    exit 1
    else
    mkdir –parents ~/.themes/Default/gtk-3.0
    rm -R ~/.themes/Default/gtk-3.0
    cp -R “$GTK3DIR” ~/.themes/Default/gtk-3.0
    rm -R ~/.config/gtk-3.0
    ln -s “$GTK3DIR” ~/.config/gtk-3.0
    echo “$GTK3THEME” > /tmp/Setting-t-ini.txt
    echo “$GTK3THEME” > ~/.Setting-t-ini.txt
    fi
    }

    # Узнать свойство панели.
    Panel_opacity=$(set_panel_p /panels/”${Panel_num}”/leave-opacity -v)
    Panel_alpha=$(set_panel_p /panels/”${Panel_num}”/background-alpha -v)
    Panel_style=$(set_panel_p /panels/”${Panel_num}”/background-style -v)
    PanelTheme=$(set_panel_p /panels/”${Panel_num}”/background-image -v)
    PanelSize=$(set_panel_p /panels/${Panel_num}/size -v)
    PanelPosition=$(set_panel_p /panels/”${Panel_num}”/position -v)
    workspace_count=$(xfconf-query -c xfwm4 -p /general/workspace_count -v)
    IconTheme=”$(xfconf-query -c xsettings -p /Net/IconThemeName -v)”
    CursorTheme=”$(xfconf-query -c xsettings -p /Gtk/CursorThemeName -v)”

    TitleFont=”$(xfconf-query -c xfwm4 -p /general/title_font -v)”

    Title_A=”$(xfconf-query -c xfwm4 -p /general/title_alignment -v)”
    Title_alignment=’Left!^Centr!Right’
    [[ ${Title_A} == left ]] && Title_alignment=’^Left!Centr!Right’
    [[ ${Title_A} == right ]] && Title_alignment=’Left!Centr!^Right’

    BUTONLT=”$(xfconf-query -c xsettings -p /Gtk/DecorationLayout | awk -F ‘,’ ‘{print $1}’)”
    if [[ ${BUTONLT} == close ]]; then
    B_LAYOUT=’OSX_Layout!Normal_Layout’
    else
    B_LAYOUT=’Normal_Layout!OSX_Layout’
    fi

    STYLE=”0 \(use system style\)!1 Solid color!^2 Bacground Image”
    POZITION=”Верх: p=6;x=960;y=16!Низ: p=8;x=960;y=1063!Лев: p=6;x=14;y=540!Прав: p=2;x=1906;y=540″
    COMPOZITING=$(xfconf-query -c xfwm4 -p /general/use_compositing -v)
    MINIATYRE_VIEW=”FALSE”

    ### 01Transparency /general/title_alignment Position
    yad –plug=”$llkey” –tabnum=1 –borders=20 –image-on-top –no-click –image=”./Data-icons/scalable/stork-logo.png” –inc-buttons –vertical –align=left \
    –form –field=”Desktop_Settings!./Data-icons/16/wm-xubynu.png! Диспетчер настроек: Приложения для настройки рабочего стола:BTN” ‘xfce4-settings-manager &’ \
    –form –field=”Themes_Gtk2::”CBE “${themelist}” \
    –form –field=”Themes_Gtk3::”CBE “${theme3list}” \
    –form –field=”$WMANAGER::”CBE “${WhemeBorders}” \
    –form –field=”Use_Compositing::”CHK “${COMPOZITING}” \
    –form –field=”Button_Layout::”CB “${B_LAYOUT}” \
    –form –field=”Title_alignment::”CB “${Title_alignment}” \
    –form –field=”Panel_opacity::”SCL “${Panel_opacity}!10..100!1!0” \
    –form –field=”Panel_Size::”NUM “${PanelSize}!24..72!1!0” \
    –form –field=”Workspace_count::”NUM “${workspace_count}!1..8!1!0” \
    –form –field=”Panel_style::”CB “${STYLE}” \
    –form –field=”Panel_Position::”CB “${POZITION}” \
    –form –field=”Panel_Miniature_view::”CHK “${MINIATYRE_VIEW}” \
    –form –field=”Title_Font::FN” “${TitleFont}” \
    \
    “” “” “” “” “” “” “” “” “” “” “” “” “” “” | while read line; do
    DATANAME1=` echo $line | awk -F’|’ ‘{print $1}’`
    xfconf-query -s `echo $line | awk -F’|’ ‘{print $2}’` -c xsettings -p /Net/ThemeName
    DATANAME3=` echo $line | awk -F’|’ ‘{print $3}’` && set_gtktri_t “${DATANAME3}”
    [[ “$WMANAGER” == ‘Themes_Xfwm4′ ]] && xfconf-query -s `echo $line | awk -F’|’ ‘{print $4}’` -c xfwm4 -p /general/theme
    [[ “$THEMEXM” == ‘metacity-1′ ]] && gsettings set org.gnome.metacity.theme name `echo $line | awk -F’|’ ‘{print $4}’`
    if [[ “$WMANAGER” == “Emerald” ]]; then
    find “${HOME}/.emerald/theme/” -delete
    cp -a “${HOME}/.emerald/themes/$(echo $line | awk -F’|’ ‘{print $4}’)/”. “${HOME}/.emerald/theme” || cp -a “/usr/share/emerald/themes/$(echo $line | awk -F’|’ ‘{print $4}’)/”. “${HOME}/.emerald/theme”
    emerald –replace &
    fi
    DATANAME5=` echo $line | awk -F’|’ ‘{print $5}’` && xfconf-query -c xfwm4 -p /general/use_compositing -s $(echo “${DATANAME5,,}” | tr _ -)
    DATANAME6=` echo $line | awk -F’|’ ‘{print $6}’`
    [[ $DATANAME6 == Normal_Layout ]] && xfconf-query -c xfwm4 -p /general/button_layout -s “OS|HMC” || xfconf-query -c xfwm4 -p /general/button_layout -s “CHM|SO”
    DATANAME7=` echo $line | awk -F’|’ ‘{print $7}’` && xfconf-query -c xfwm4 -p /general/title_alignment -s $(echo “${DATANAME7,,}” | tr _ -)
    xfconf-query -c xfce4-panel -p /panels/${Panel_num}/leave-opacity -s ` echo $line | awk -F’|’ ‘{print $8}’`
    xfconf-query -c xfce4-panel -p /panels/${Panel_num}/size -s ` echo $line | awk -F’|’ ‘{print $9}’`
    DATANAME10=`echo $line | awk -F’|’ ‘{print $10}’` && xfconf-query -c xfwm4 -p /general/workspace_count -s “${DATANAME10}”
    xfconf-query -c xfce4-panel -p /panels/${Panel_num}/background-style -s `echo $line | awk -F’|’ ‘{print $11}’ | awk -F’ ‘ ‘{print $1}’`
    xfconf-query -c xfce4-panel -p /panels/${Panel_num}/position -s `echo $line | awk -F’|’ ‘{print $12}’ | awk -F’: ‘ ‘{print $2}’`
    DATANAME13=`echo $line | awk -F’|’ ‘{print $13}’`
    xfconf-query -c xfwm4 -p /general/title_font -s “$(echo $line | awk -F’|’ ‘{print $14}’)”

    echo “$DATANAME1, $DATANAME2, $DATANAME3, $DATANAME4, $DATANAME5, $DATANAME6, $DATANAME7, $DATANAME8, $DATANAME9, $DATANAME10, $DATANAME11, $DATANAME12, $DATANAME13, $DATANAME14, ” > ./777a777
    done \
    &
    ###

    ### 02
    yad –icons –plug=”${llkey}” –tabnum=”2″ –item-width=”128″ \
    –text=” Select the icon. Click the mouse.” –tooltip –monitor –output-by-row \
    –read-dir=”$HOME/.storkdata/Aplication/” –single-click &

    ### 03
    yad –center –window-icon=”./Data-icons/scalable/stork.png” –borders=10 –paned –orient=”horizontal” –width=”1200″ –height=”640″ –key=”$llkey” \
    –title=”Setting_Styles” –sticky –auto-kill –text-align=”left” –focus-field=”2″ \
    –no-escape –response=0 –buttons-layout=edge \
    –button=”gtk-apply!view-refresh! Применить настройки?”:”bash -c sayonara” –geometry “$(cat /tmp/stork_geometry 2>/dev/null)” \
    –button=”gtk-refresh!view-refresh! Обновить рабочий стол?”:’./Setting-style/setting-theme/revise-gtk_avto &’ \
    –button=”W-manager!view-refresh! Заменить Менеджер Окон… “:’./Setting-style/setting-compositting/wm-manager &’ \
    –button=”gtk-about!gtk-about! О программе, Stork?”:”bash -c help_stork” \
    –button=”gtk-quit!gtk-quit! Выйти из программы?”:1

    ret=$?
    [[ $ret == 1 ]] || [[ $ret == 252 ]] && exit
    echo $ret

    [[ $ret == 0 ]] && sleep 1 && ./SettingStyles.sh &

    exit

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *