yabar icon indicating copy to clipboard operation
yabar copied to clipboard

i3 startup issues

Open cstich opened this issue 7 years ago • 8 comments

If I use i3 to automatically start yabar with exec --no-startup-id yabar then something goes wrong. I can't really describe it so I attached a screenshot of it. If I start yabar from the console it works just fine. In this setup I am drawing yabar on an external monitor. yabar

cstich avatar Mar 24 '17 15:03 cstich

From this picture I assume the issue is that "Using monitor HDMI-1" is being displayed in some blocks, is this correct?

And also a segfault? What's the difference between this and #143?

NBonaparte avatar Mar 24 '17 19:03 NBonaparte

Hahaha, that is actually kind of amazing.

I have a vague suspicion where this is coming from.

ya_setup_bar writes "Using monitor xyz" to STDOUT with printf("Using monitor") - which is actually nothing else than file descriptor number 1 (STDIN is 0, STDOUT is 1 and STDERR is 2). But how does this get displayed in the blocks?

Yabar internally uses a pipes mechanism to stream data between the different threads. I'm guessing i3 did not allocate STDIN, STDOUT and/or STDERR for yabar, and therefore file descriptor 1 gets used for a pipe, which is then used for the blocks instead of console output.

jacksgt avatar Mar 24 '17 22:03 jacksgt

@NBonaparte Yes, I have set HDMI-1 as the monitor for Yabar to display. The segfault is not related to this issue. Just happened to be in the screenshot (confusingly).

cstich avatar Mar 24 '17 22:03 cstich

If you change printf("Using monitor %s\n", m); on line 251 of src/ya_parse.c to fprintf(stderr, "Using monitor %s\n", m); does this fix it?

NBonaparte avatar Mar 24 '17 23:03 NBonaparte

That fixes it somewhat. Now it looks like this yabar_2

I haven't set any option for it to be transparent anywhere.

cstich avatar Mar 24 '17 23:03 cstich

Could you post your config file?

NBonaparte avatar Mar 24 '17 23:03 NBonaparte

Sure. It is probably not an example of beauty either.

#Hi!, this config is not intended to become an example of beauty in yabar.
#
#It is just intended to show an example (specifically an example config that uses internal blocks) of what you can do using yabar.
#You are more than welcomed to send me (using a pull request maybe) your better colors and I will merge it.
bar-list = ["bar1"]

bar1:{
	font: "Droid Sans, FontAwesome Bold 10";
	block-list: ["ya_date", "ya_title", "ya_wtts2", "ya_brightness",  "ya_volume", "ya_music_backward","ya_music_toggle", "ya_music_forward",  "ya_music_like", "ya_cpu", "ya_mem", "ya_wifi", "ya_battery", "ya_dropbox", "ya_power"];
	position: "top";
	height: 28; 			#height;
	background-color-rgb:0x0;
	monitor: "HDMI-1 eDP-1";
	underline-size: 2;
	overline-size: 2;
	slack-size: 3;

    ya_title: {
        exec: "YABAR_TITLE";
        fixed-size: 300;
        align: "left";
        background-color-rgb:0x0;
        # overline-color-rgb:0x2679DB
	}

    ya_dropbox: {
        exec: "bash ~/.scripts/dropbox.sh"
        fixed-size: 50;
        align: "right"
        type: "periodic"
        underline-color-rgb: 0xD95B43;
        background-color-rgb:0x0;
        interval: 5;
    }

    ya_date:{
		exec: "YABAR_DATE";
		align: "middle";
		fixed-size: 160;
		interval: 1;
		#background-color-rgb:0x279DBD;
		underline-color-rgb:0xF92672;
		internal-prefix: " ";
		internal-option1: "%a %d %b, %I:%M";
        background-color-rgb:0x0;
		#variable-size: true;
	}
    ya_ws: {
		exec: "YABAR_WORKSPACE";
		align: "left";
		fixed-size: 30;
        type: "periodic";
        interval: 0.2;
		internal-option1: "       5 6 7 8 9";
        #background-color-rgb:0xAF89D9;
		underline-color-rgb:0x2679DB;
        background-color-rgb:0x0;
		# command-button1: "sh ~/scripts/i3_workspaces.sh";
	}

	ya_wifi: {
        exec: "bash /home/christoph/.scripts/wifi.sh";
        # exec: "YABAR_WIFI";
        # internal-option: "wlp3s0";
        align: "right";
        # fixed-size: 180;
        fixed-size: 150;
        interval: 1;
        type:"periodic"
        command-button1: "nm-applet"
        background-color-rgb:0x0;
        # background-color-rgb: 0x343D46;
        underline-color-rgb: 0xAD508A;
	}
   
	ya_ws2: {
		exec: "python3 /home/christoph/.scripts/i3ws.py";
		align: "left";
		fixed-size: 130;
        type: "periodic";
        interval: 1;
        variable-size: true;
		#internal-option1: "          VI VII VIII IX";
        #background-color-rgb:0xAF89D9;
		underline-color-rgb:0x2679DB;
		#exec: "~/test.sh";
		#pango-markup: true;
		#command-button1: "sh ~/scripts/workspace.sh";
	}
        
           
    ya_volume:{
        exec:"sh /home/christoph/.scripts/volume.sh";
        align: "right";
        fixed-size: 60;
        type: "periodic"
        interval: 1;
        # background-color-rgb: 0x343D46;
        underline-color-rgb:0x66D9EF;
        background-color-rgb:0x0;
        command-button1: "amixer -D pulse sset Master toggle"
        command-button4: "amixer -D pulse sset Master 5%+";
        command-button5: "amixer -D pulse sset Master 5%-";
    }

    ya_music_forward:{
        exec:"sh /home/christoph/.scripts/forward.sh";
        align: "left";
        type: "periodic";
        fixed-size: 30;
        interval: 1;
        # background-color-rgb: 0x343D46;
        underline-color-rgb:0x66D9EF;
        background-color-rgb:0x0;
        command-button1: "nuvolaplayer3ctl action next-song"
    }

    ya_music_like:{
        exec:"sh /home/christoph/.scripts/heart.sh";
        align: "left";
        type: "periodic";
        fixed-size: 30;
        interval: 1;
        # background-color-rgb: 0x343D46;
        underline-color-rgb:0x66D9EF;
        background-color-rgb:0x0;
        command-button1: "nuvolaplayer3ctl action thumbs-up"
    }


    ya_music_backward:{
        exec:"sh /home/christoph/.scripts/backward.sh";
        align: "left";
        type: "periodic";
        fixed-size: 30;
        interval: 1;
        # background-color-rgb: 0x343D46;
        underline-color-rgb:0x66D9EF;
        background-color-rgb:0x0;
        command-button1: "nuvolaplayer3ctl action prev-song"
    }
	
    ya_music_toggle:{
        exec:"bash /home/christoph/.scripts/toggle.sh";
        align: "left";
        type: "periodic";
        fixed-size: 30;
        interval: 1;
        # background-color-rgb: 0x343D46;
        underline-color-rgb:0x66D9EF;
        background-color-rgb:0x0;
        command-button1: "nuvolaplayer3ctl action toggle-play"
    }


    ya_brightness: {
        exec:"sh /home/christoph/.scripts/brightness.sh";
        align: "right";
        fixed-size: 60;
        type: "periodic"
        interval: 1;
        # background-color-rgb: 0x343D46;
        underline-color-rgb:0x66D9EF;
        background-color-rgb:0x0;
        command-button4: "xbacklight -inc 10";
        command-button5: "xbacklight -dec 10";
   }

	ya_uptime:{
		exec: "YABAR_UPTIME";
		align: "right";
		fixed-size: 70;
		interval: 1;
		#background-color-rgb:0x96B49C;
        background-color-rgb:0x0;
		underline-color-rgb:0xF8CA00;
		internal-prefix: " ";
		#internal-spacing: true;
	}
	ya_mem:{
		exec: "YABAR_MEMORY";
		align: "right";
		fixed-size: 70;
		interval: 1;
		#background-color-rgb:0x45ADA8;
        background-color-rgb:0x0;
		underline-color-rgb:0xFA6900;
		internal-prefix: " ";
		#internal-spacing: true;
	}
	ya_cpu: {
		exec: "YABAR_CPU";
		align: "right";
		fixed-size: 75;
		interval: 1;
		internal-prefix: " ";
		internal-suffix: "%";
        background-color-rgb:0x0;
		#background-color-rgb:0x98D9B6;
		underline-color-rgb:0xE97F02;
		#internal-spacing: true;
	}
	ya_disk: {
		exec: "YABAR_DISKIO";
		align: "right";
		fixed-size: 110;
		interval: 1;
		internal-prefix: " ";
		internal-option1: "sda"; #Get NAME from /sys/class/block/NAME/stat
		internal-option2: " "; #Use characters(usually utf characters as shown) to be placed before down/up data, separated by a space
        background-color-rgb:0x0;
		#background-color-rgb:0x49708A;
		underline-color-rgb:0xECD078;
		#internal-spacing: true;
	}

    ya_mpd: {
    		 exec: "mpc";
    		 type: "periodic";
    		 interval: 1;
    		 align: "left";
    		 underline-color-rgb: 0xAD508A;
    		 fixed-size: 100;
    		 variable-size: true;
    }

    ya_battery: {
            exec: "sh ~/.scripts/battery_indicator.sh";
            align: "right";
            type: "periodic";
            underline-color-rgb: 0xAD508A;
            background-color-rgb:0x0;
    }

   	ya_power: {
	            exec: "echo ";
	            fixed-size: 15;
	            type: "periodic";
	            interval: 1;
	            align: "right";
	            underline-color-rgb: 0xAD508A;
	            command-button1: "sh ~/.scripts/shutdown_wrapper.sh";
                background-color-rgb:0x0;
	}
	ya_gap1: {
                exec: "echo";
                fixed-size: 12;
                type: "periodic";
	            interval: 1;
                align: "left";
                background-color-argb:0x0;
    }
    ya_gap2: {
                exec: "echo";
                fixed-size: 12;
                type: "periodic";
	            interval: 1;
                align: "right";
                background-color-argb:0x0;
    }
}

cstich avatar Mar 25 '17 09:03 cstich

Are you running compton? I was able to reproduce this when I executed compton after yabar in the config. Try running yabar after starting compton if it isn't in this order already.

NBonaparte avatar Mar 26 '17 20:03 NBonaparte