Page 1 sur 1

[Plasma 5] Comment ajouter des applications au démarrage ?

Publié : sam. 27 déc. 2014, 18:55
par Maximilien LIX
Hello world !
Sachez qu'avant d'écrire ces quelques mots, j'ai absolument TOUT essayé pour mettre des applications au démarrage de l'environnement Plasma 5. En fait ce problème, je l'avais aussi sur KDE4...

Bon, dans les grandes lignes, je souhaite exécuter un script .sh qui se chargera d'éxécuter plusieurs thèmes conky. Jusque là tout va bien, j'ai bien pris le soins au préalable, de rendre mon script exécutable avec un petit chmod. Mais voila impossible d'indiquer à Plasma 5 d'exécuter mon script au démarrage....

Grosso modo ça donne ça :

Image

Puis lorsque je quitte et que j'y reviens après...

Image

Bon sinon j'ai aussi créé un lien symbolique dans Konsole, en suivant les instructions du wiki ici mais ça revient à péter dans un violon :)

Avez-vous déjà eu ce bug ? Si oui, comment le contourner ? Merci bien :)

Re: [Plasma 5] Comment ajouter des applications au démarrage ?

Publié : sam. 27 déc. 2014, 19:20
par benjarobin
Il suffit de créer un fichier .desktop ici : ~/.config/autostart/
Par exemple :

Code : Tout sélectionner

[Desktop Entry]
Exec=gnubiff --systemtray -n
Icon=system-run
Name=
StartupNotify=false
Terminal=false
Type=Application

Re: [Plasma 5] Comment ajouter des applications au démarrage ?

Publié : sam. 27 déc. 2014, 19:29
par Maximilien LIX
Dac merci je vais tester ça de suite :)

Re: [Plasma 5] Comment ajouter des applications au démarrage ?

Publié : sam. 27 déc. 2014, 22:57
par Maximilien LIX
Merci bien ça fonctionne ! :D

Par contre, lorsque je clique sur le bureau les conky disparaissent O_o'

Voici mon conky principal

Code : Tout sélectionner

# -- Conky settings -- #
background no
update_interval 1

cpu_avg_samples 2
net_avg_samples 2

override_utf8_locale yes

double_buffer yes
use_xft yes
no_buffers yes

text_buffer_size 2048
imlib_cache_size 0

# -- Window specifications -- #

own_window yes
own_window_type normal
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window_argb_visual yes
own_window_argb_value 255

border_inner_margin 0
border_outer_margin 0

minimum_size 1366 748

# -- Graphics settings -- #
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no

# -- Text settings -- #
xftfont Santana:size=8
xftalpha 0.8


uppercase no

default_color FFFFFF

# -- Lua load -- #
lua_load ~/.conky/main.lua
lua_draw_hook_pre main
lua_startup_hook setup

TEXT
Et voici le lua

Code : Tout sélectionner

require "cairo" -- cairo graphic library

-- the funtion which paints the image in circle
function draw_image (ir,xc, yc, radius, path)
  local w, h;

  cairo_arc (ir, xc, yc, radius, 0, 2*math.pi);
  cairo_clip (ir);
  cairo_new_path (ir);


  local image = cairo_image_surface_create_from_png (path);
  w = cairo_image_surface_get_width (image);
  h = cairo_image_surface_get_height (image);


  cairo_scale (ir, 2*radius/w, 2*radius/h);
  w = cairo_image_surface_get_width (image);
  h = cairo_image_surface_get_height (image);

  cairo_set_source_surface (ir, image, xc*(1/(2*radius/w)) - w/2, yc*(1/(2*radius/h)) - h/2);
  cairo_paint (ir);

  cairo_surface_destroy (image);
  cairo_destroy(ir);
end


--  the funtion which will be called at the beginning of the run, used to setup a few global values
function conky_setup(  )
  noquote = 1;
  quote = "";
  author = "";
  checkquote = 0;

  start = 1;

  changeweather = 0;
  condition = "";
  noweather = 1;
  city = "";
  region = "";
  country = "";
  code = "";
  temp = "";

end

function conky_main(  )

  -- if no conky window then exit
  if conky_window == nil then return end

  -- the number of update
  local updates = tonumber(conky_parse("${updates}"));
  -- if not third update exit
  if updates < 3 then return end

  -- prepare cairo drawing surface
  local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height);
  cr = cairo_create(cs);

  -- for text extents
  local extents = cairo_text_extents_t:create();
  local text = "";

  -- globals
  local width = 1366;
  local height = 748;

  -- the centered time and date
  -- varaibles
  local hour = conky_parse('${time %I}');
  local minute = conky_parse('${time %M}');
  local part = conky_parse('${time %p}');
  local day = conky_parse('${time %d}');
  local month = conky_parse('${time %B}');
  local year = conky_parse('${time %G}');
  -- time
  text = hour..":"..minute;
  cairo_set_source_rgba(cr, 1, 1, 1, 1);
  cairo_select_font_face(cr, "Radio Space", 0,0);
  cairo_set_font_size(cr,height/6);
  cairo_text_extents(cr,text,extents)
  cairo_move_to(cr, width/2 - extents.width/2,  height/2 - extents.height/4);
  local line = height/2 - extents.height/4;
  cairo_show_text(cr, text);
  -- date
  text = day.." "..month..", "..year;
  cairo_set_source_rgba(cr, 0.75, 0.75, 0.75, 1);
  cairo_set_font_size(cr,height/15);
  cairo_text_extents(cr,text,extents)
  cairo_move_to(cr, width/2 - extents.width/2,  line + extents.height*1.2);
  local line = height/2 - extents.height/4;
  cairo_show_text(cr, text);

  -- mail checker
  -- setup variables for web based content
  local min = tonumber(conky_parse('${time %M}'));
  local sec = tonumber(conky_parse('${time %S}'));
  local file = io.popen("/sbin/route -n | grep -c '^0\.0\.0\.0'");
  internet = tonumber(file:read("*a"));
  io.close(file);
  -- print(internet);

  -- font settings
  cairo_set_source_rgba(cr, 1, 1, 1, 1);
  cairo_select_font_face(cr, "Sans Serif", 0 , 0);
  cairo_set_font_size(cr, 15);



  -- weather
  local city_id = 612977;
  hour = tonumber(hour);
  if (hour*60 + min)%59 == 0 then
    changeweather = 1;
  end

  if ((hour*60 + min)%60 == 0 and changeweather == 1) or start == 1 or noweather == 1 then
    if internet == 1 then
      print ("checkweather");
      local file = io.popen("curl -m 120 'http://weather.yahooapis.com/forecastrss?w="..city_id.."&u=c'");
      weather = file:read("*a")
      io.close(file);
    end
    changeweather = 0;
    if (weather == "") then
      noweather = 1;
    else
      noweather = 0;
      city ="";
      region = "";
      country = "";
      condition = "";
      code = "";
      temp = "";

      _,_,city,region,country = string.find(weather,"yweather:location%s*city=[\"](.-)[\"]%s*region=[\"](.-)[\"]%s*country=[\"](.-)[\"]");
      _,_,condition,code,temp,_ = string.find(weather,"yweather:condition%s*text=[\"](.-)[\"]%s*code=[\"](.-)[\"]%s*temp=[\"](.-)[\"]%s*date=[\"](.-)[\"]");
    end
    -- start = 0;
  end

  if noweather == 1 then
    text = "Cannot fetch weather info";
    cairo_text_extents(cr, text, extents);
    cairo_move_to(cr, width - 30 - extents.width, 30);
    cairo_show_text(cr, text);
  else
    local ir = cairo_create(cs);
    draw_image(ir, width - 40, 30, 30, "w/"..code..".png");
    text = temp.."°C".." : "..condition;
    cairo_text_extents(cr, text, extents);
    cairo_move_to(cr, width - 80 - extents.width, 30);
    cairo_show_text(cr, text);
    text = city.." "..region..", "..country;
    cairo_set_font_size(cr, 12);
    cairo_set_source_rgba(cr, 0.75, 0.75, 0.75, 1);
    cairo_text_extents(cr, text, extents);
    cairo_move_to(cr, width - 80 - extents.width, 45);
    cairo_show_text(cr, text);
  end


  -- quotes
  if hour%11 == 0 then
    checkquote = 1;
  end

  if (hour%12 == 0 and checkquote == 1) or start == 1 or noquote == 1 then
    if internet == 1 then
      print ("checkquote");
      local file = io.popen("curl -m 100 'http://feeds.feedburner.com/brainyquote/QUOTEBR'");
      output = file:read("*a");
      io.close(file);
    end
    checkquote = 0;
    start = 0;

    if (output == "") then
      noquote = 1;
    else
      noquote = 0;
      quote = "";
      author = "";

      local nex = 0;
      local a = "";
      _,nex,a = string.find(output, "<item>%s*(.-)%s*</item>",nex);
      _,_,author = string.find(a, "<title>%s*(.-)%s*</title>");
      _,_,quote = string.find(a, "<description>%s*(.-)%s*</description>");
    end
  end

  if(noquote == 0) then
    text = author;
    cairo_set_font_size(cr, 16);
    cairo_set_source_rgba(cr, 1, 1, 1, 1);
    cairo_text_extents(cr, text, extents);
    cairo_move_to(cr, width/2 - extents.width/2, height - 30);
    cairo_show_text(cr, text);
    text = quote;
    cairo_select_font_face(cr, "Comic Sans MS", 0, 1);
    cairo_text_extents(cr,text,extents);
    cairo_move_to(cr, width/2 - extents.width/2, height - 50);
    cairo_show_text(cr, text);
  else
    print("Trouble fetching quote")
  end

  -- destroying the cairo surface
  cairo_destroy(cr);
  cairo_surface_destroy(cs);
  cr=nil;
end