You are not logged in.

#51 2021-09-16 12:48:27

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

Re: Tabby: a tabbed-tiling wayland compositor

Did it resume after that one, or did it crash completely - the log suggests the latter.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#52 2021-09-16 13:23:05

Docbroke
Member
From: India
Registered: 2015-06-13
Posts: 1,438

Re: Tabby: a tabbed-tiling wayland compositor

actually I did exit tabby, using shortcut (alt-esc).

Offline

#53 2021-09-16 15:37:43

Docbroke
Member
From: India
Registered: 2015-06-13
Posts: 1,438

Re: Tabby: a tabbed-tiling wayland compositor

When I click on right side of tabbybar, it opens terminal (terminator). nice surprice.

Offline

#54 2021-09-16 16:48:23

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

Re: Tabby: a tabbed-tiling wayland compositor

And if you click on the left status the tiling mode will change: these are just the button binds in the default config.  You can customize it to have other actions - eventually even detecting *where* in your status bar you clicked so - in your case - you could run different commands based on whether you clicked in your battery display, or the brigthness, etc.  You can have different actions for different buttons (and soon modifiers) to: so theoretically you'd be able to left click on the brightness element of your status to increase brightness and right click on it to decrease.

The location-based clicks aren't quite yet implemented, and it won't be *quite* as magical as it sounds once it is as you will not really be told which element was clicked, but a x-coordinate of the click withing the status element can be passed to a script.  So if you know your status script generates a string in which the left half is the battery and the right half is the time, and your click-bound script gets an argument of 0.2, you'd know (or infer) that the battery area was clicked.

Again, the mechanism for this is pretty much done, just not yet active in the published code.

I've been focused recently on moving most of the config code out of tabby into a separate tool "tabby-config".  Tabby will run a "tabby-config" process at startup, so from the user's perspective your config file will be read just as it always ways, but you'll also be able to do live reconfigures by running tabby-config manually after tabby has already started.  This will also allow for partial reconfigurations: you can pass  single commands to tabby-config to override or change individual settings.

One silly but illustrative use would be to have multiple color theme files that you could switch between while Tabby was running with `tabby-config < /path/to/colors1` and `tabby-config < path/to/colors2'.

There are still a few quirks to work out before I push this code, but it should be ready soon.

This was also a bit of a learning process as instead of implementing my own socket IPC system, I just wrote a wayland protocol for tabby-config - so all the communication between tabby and tabby-config goes over the existing wayland socket.  This same mechanism will be used in another utility `tabby-menu` and `tabby-msg`.  The former will be a silo/demnu/rofi like prompt in the tabby's bar, the latter will have a similar mechanism, but will display messages in the bar and can be hooked up to one of the text-based notification dameons linked to earlier in the discussion.


EDIT: I just pushed these changes which are now available with a rebuild of the AUR package.  There's one minor change to the config file which will need to be merged into your own configs: the format of the "border" colors changed, now instead of two r-g-b-a quads, you just give two indices of your defined colors to use for border colors.

Last edited by Trilby (2021-09-17 01:09:29)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#55 2021-09-17 06:46:14

Docbroke
Member
From: India
Registered: 2015-06-13
Posts: 1,438

Re: Tabby: a tabbed-tiling wayland compositor

Here is my script for tabby-bar on left side, where normally  it displays, "Tabby on Arch", but if any process is consuming >20% of cpu or >20% RAM, it will display unicode symbol for cpu/ram, %cpu/ram and process name. It requires nerd font.

#!/bin/sh

while :; do
	# memory="$(free | grep Mem | awk '{printf "%.f", $3/$2 * 100.0}')"
	memory="$(ps -eco %mem --sort=-%mem | head -n2 | tail -n 1)"
	# cpu="$(top -b -n1 | grep "Cpu(s)" | awk '{print $2 + $4}')"
	cpu="$(ps -eco %cpu --sort=-%cpu | head -n2 | tail -n 1)"
	if (( $(echo "$cpu > 20" |bc -l) )) ; then
		# out="{bg=0}{fg=9} :{fg=7}$cpu% $(top -b -n1 | head -n 8 | tail -n 1 | awk '{print $12}')"
		out="{bg=0}{fg=9} :{fg=7}$(ps -eco %cpu,cmd --sort=-%cpu | head -n 2 | tail -n 1)"
	elif (( $( echo "$memory > 20" |bc -l) )); then
		# out="{bg=0}{fg=9} 閭:{fg=7}$memory% $(top -b -n1 | head -n 8 | tail -n 1 | awk '{print $12}')"
		out="{bg=0}{fg=9} 閭:{fg=7}$(ps -eco %mem,cmd --sort=-%mem | head -n 2 | tail -n 1)"
	else
		out=" Tabby on Arch "
	fi

	echo "{bg=7}{fg=8} {mode} {bg=4}$out"

	sleep 5
done

With hope it may be useful as example script for tabby.

Last edited by Docbroke (2021-09-17 06:46:59)

Offline

#56 2021-09-17 12:41:21

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

Re: Tabby: a tabbed-tiling wayland compositor

Nice.  I'd like to suggest a couple revisions.  As a first pass, I think this acheives the same results:

#!/bin/sh

while :; do
	mem="$(/bin/ps -echo %mem --sort=-%mem | sed 's/\..*//;1q')"
	cpu="$(/bin/ps -echo %cpu --sort=-%cpu | sed 's/\..*//;1q')"
	if [ "$cpu" -gt 20 ]; then
		echo "{bg=0}{fg=9} :{fg=7}$(ps -echo %cpu,cmd --sort=-%cpu | sed 1q)"
	elif [ "$mem" -gt 20 ]; then
		echo "{bg=0}{fg=9} 閭:{fg=7}$(ps -echo %mem,cmd --sort=-%mem | sed 1q)"
	else
		echo " Tabby on Arch "
	fi
	sleep 5
done

I'd love to see it run ps just once as all the necessary information can be gathered from that.

EDIT: I think this should do it (though copy-pasting between terminal and forum might have butchered the nerdfont symbols.  I don't have that font installed to test that part - but if needed just adjust the format strings:

#!/bin/sh

while :; do
	/bin/ps -echo %cpu,%mem,cmd | awk '
		BEGIN { cpu_max = 20; mem_max = 20; }
		$1 > cpu_max { cpu_cmd = $3; cpu_max = $1; }
		$2 > mem_max { mem_cmd = $3; mem_max = $2; }
		END {
			if (cpu_cmd) printf "{bg=0}{fg=9} :{fg=7}%s %s\n", cpu_cmd, cpu_max;
			else if (mem_cmd) printf "{bg=0}{fg=9} 閭:{fg=7}%s %s\n", mem_cmd, mem_max;
			else print " Tabby On Arch ";
		}
	'
	sleep 5
done

I'll add a collection of these scripts the the tabby source repo soon.

Last edited by Trilby (2021-09-17 12:57:39)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#57 2021-09-17 13:23:43

Docbroke
Member
From: India
Registered: 2015-06-13
Posts: 1,438

Re: Tabby: a tabbed-tiling wayland compositor

Thanks for reviewing the script. Running ps only once is good.
Nerd font symbols are still fine, only thing butchered from output is {mode} (on second thought it may be added in tabby config directly). Awk is aw'k'some.

Offline

#58 2021-09-17 14:06:47

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

Re: Tabby: a tabbed-tiling wayland compositor

Mode can be included in the script.  To include a mode indicator, the script should just output a litteral "{mode}".  This will be update in the display whenever the mode changes whether or not the script has generated a new line of input (in other words, if the script loops every 5 seconds, the display of "{mode}" can still be update far more often than every 5 seconds - this is the case for all dynamic format elements like {title} and {index}).

Oh .. I see - I just forgot to include it - I missed it in your script when I was editing.  It can be added back to the format strings in awk as desired.

Here's a slightly more customizable version with mode included:

#!/bin/sh

prefix='{bg=7}{fg=8} {mode} {bg=4}'
fmt='{bg=0}{fg=9} %s:{fg=7} %s %s\n'
cpu_sym=''
mem_sym='閭'

while :; do
	/bin/ps -echo %cpu,%mem,cmd \
	| awk -v prefix="$prefix" -v fmt="$fmt" -v cpu_sym="$cpu_sym" -v mem_sym="$mem_sym" '
		BEGIN { cpu_max = 20; mem_max = 20; }
		$1 > cpu_max { cpu_cmd = $3; cpu_max = $1; }
		$2 > mem_max { mem_cmd = $3; mem_max = $2; }
		END {
			if (cpu_cmd) printf prefix fmt, cpu_sym, cpu_cmd, cpu_max;
			else if (mem_cmd) printf prefix fmt, mem_sym, mem_cmd, mem_max;
			else print prefix " Tabby v1.2 ";
		}
	'
	sleep 5
done

Last edited by Trilby (2021-09-17 16:13:15)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#59 2021-09-18 03:06:51

Docbroke
Member
From: India
Registered: 2015-06-13
Posts: 1,438

Re: Tabby: a tabbed-tiling wayland compositor

What does {index} do ? If I use in left_bar it displays 25, I don't know what it means.

An idea about root window, can it display console output from tabby as an option instead of usual wallpaper? So for example if I run "rem -cu" for tabby shortcut, calendar gets displayed on root window. That brings me to another question, currently root window gets visible when no other window is open, which makes wallpaper almost useless. Can we have a shortcut to see root window, e.g., "mod+0" to see root window, while "mod+1/2/3/etc" displayes windows in that number position.

btw. what is new with tabby 1.3?

Last edited by Docbroke (2021-09-18 03:07:32)

Offline

#60 2021-09-18 12:48:56

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

Re: Tabby: a tabbed-tiling wayland compositor

Index is useless in the left and right status areas.  It's odd that you get 25 - it should always just be -1 in the statuses.  It's mean to be (optionally) used to titles where it is the top-level index surface.  For example the title of the window that gets focused when you press mod+1 has index 1.

As for the root window questions, there's no such thing.  Currently there is just a fill color drawn before any surfaces are rendered - so if there are no surfaces (other than the bar) to render, that's all you see.  Being able to draw an image as a background image is coming in the near future.  Rendering multiline and scrolling text there would take a good chunk of code for something very few people would want.  It also could actually be tabby's stdout as there's no way to capture this from within tabby.  If there was, you'd also probably be uninterested in the verbose wlroots output that gets sent (which would swamp out your calendar output quickly).  Theoretically the stdout of every spawned process (key bindings) could be captured and drawn ...  but then it would require setting up a pipe for each launched process, multiplexing the output of all launched processes, and then formatting and rendering the scrolling multiline text.  So ... no.

But why do you think wallpaper would be useless?  It's no more or less so than in any other tiling compositor or any tiling X11 WM.  If you have (semi-)transparent windows, you'll see the "wallpaper" through them.

A lot has changed between 1.2 and 1.3 - but as you've been regularly rebuilding the development code, nothing much changed between your previous build at the checking tagged as 1.3.  You can see all the checkins between 1.2 and 1.3 on the timeline - or for a pretty disorganized and information summary of what I was working on between 1.2 and 1.3 you can look at the various versions of the Roadmap file - this file is pretty much just note-to-self brainstorming, but I've put it in the repo for transparency so users can see what's on my (tentative and always changing) plan for tabby.  But 1.2 was the first public release of the wayland version ... so all changes from when you first started using tabby to now are what changed between 1.2 and 1.3.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#61 2021-09-18 14:22:39

Docbroke
Member
From: India
Registered: 2015-06-13
Posts: 1,438

Re: Tabby: a tabbed-tiling wayland compositor

Yes, indeed, having root window displaying wabby outputs is not very good idea. But I think ability to see the root window using a shortcut, which would be similar to minimizing all other windows, or like moving to workspace with no windows is useful, for example when you don't want to keep staring at telegram which is the only open window or you want to hide current window when someone is looking over your screen.

EDIT: you may want to make index=index+1, currently first window has index 0. Index may actually be useful and look good, when displayed properly.

format normal   {bg=8}{fg=3} {index} {bg=0}{fg=7}{title}
format focused  {bg=7}{fg=8} {index} {bg=0}{fg=6}{title}

Last edited by Docbroke (2021-09-18 14:36:51)

Offline

#62 2021-09-18 15:27:23

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

Re: Tabby: a tabbed-tiling wayland compositor

Thanks - I haven't had indices displayed in a while and two different off-by-one errors snuck into the code.  I just pushed a fixe to have the indices be one-based again as well as fixing the odd "25" if used in statuses.  It still doesn't make much sense to put "{index}" in status, but the 25 struck me as quite odd ... but it was due to changing a type from an int to a unt8_t in the function, so when -1 was passed that's the same as 255 in uint8_t, and then only two digits were printed resulting in "25".


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#63 2021-09-19 10:53:09

Docbroke
Member
From: India
Registered: 2015-06-13
Posts: 1,438

Re: Tabby: a tabbed-tiling wayland compositor

Here is script for tabbybar on right-side. It updates clock every second but other parameters, wifi_ssid, brightness, volume & battery_status are updated every 5 second. It uses nerd font symbols.

#!/bin/sh

#              﨟 ﯚﯦ ﯧ ﯚ                          喇 黎 舘 侀              
#        
#        閭 婢 睊 ﮣ ﮤ ﯦ ﱫ               

x=0
interval=5
base=/sys/class/backlight/intel_backlight
max=$(<$base/max_brightness)

while :; do
	[ $x -gt $interval ] && x=0

	if [ $x = $interval ]; then
		battery_capacity="$(< /sys/class/power_supply/BAT0/capacity)"
		online_status="$(< /sys/class/power_supply/AC0/online)"
		if [[ $online_status = 1 ]]; then
			battery="{fg=2}{bg=0}ﮣ:{fg=7}$battery_capacity%"
		elif [[ $battery_capacity -lt 10 ]]; then
			battery="{fg=9}{bg=0}:{bg=9}{fg=0}$battery_capacity%"
		elif [[ $battery_capacity -lt 30 ]]; then
			battery="{fg=9}{bg=0}:{fg=9}$battery_capacity%"
		elif [[ $battery_capacity -lt 60 ]]; then
			battery="{fg=1}{bg=0}:{fg=1}$battery_capacity%"
		elif [[ $battery_capacity -lt 90 ]]; then
			battery="{fg=1}{bg=0}:{fg=7}$battery_capacity%"
		else
			battery="{fg=2}{bg=0}:{fg=7}$battery_capacity%"
		fi

		if [[ $(pamixer --get-mute) = true ]]; then
			volume="{fg=9}{bg=0}婢:{fg=7}$(pamixer --get-volume)%"
		else
			volume="{fg=2}{bg=0}:{fg=7}$(pamixer --get-volume)%"
		fi

		ssid="$(iwgetid -r)"
		if [ -n "$ssid" ]; then 
			net="{fg=2}{bg=0}:{fg=7}$(echo "$ssid" | tr -d " ")"
		else
			net="{bg=0}{fg=9}睊"
		fi

		cur=$(<$base/brightness)
		per=$(( $cur*100/$max ))
		backlight="{fg=2}{bg=0}ﯦ:{fg=7}$per%"
	fi

	let x++
	date "+$net $backlight $volume $battery {fg=2}{bg=0}﨟:{fg=3}%a {fg=7}%b %d {fg=3}%I:%M {fg=3}%S{fg=7} %p "
	sleep 1

 done

Offline

#64 2021-09-19 22:00:27

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

Re: Tabby: a tabbed-tiling wayland compositor

I just pushed an update with a couple new utilities: tabby-msg and tabby-menu.

tabby-msg should be able to be used with the above-mentioned notification daemons to show messages in the title / tab area of the bar.  The first parameter is a string with format specifiers as used in titles / status bars.  An optional second parameter sets the duration of the message display in seconds (default 5.0).  For example:

tabby-msg "{bg=0} {fg=1}Hello {fg=15}From {fg=4}Tabby" 2.5

tabby-menu is a launcher menu a bit like dmenu but also inspired by the goals behind silo.  It can take up to three optional parameters for a promt string, a completion source, and an output / runner.  In the absence of all three of these the behavior is very much like dmenu with an "empty" prompt (really a single space as the aesthetics are much better than an empty string), a completer that reads from the stdin, and an output / runner that just echos the selected item to the stdout.

Prompt should be self explanatory, and outuput / runners are pretty simple: it's just a command that has the user-entered text appended to it, or - if the specified command includes a '%s' the entered text replaces it.  Completers are a little more interesting.  This second command line parameter can be a filename (or '-' for stdin) to read completion options from; or it can be a command / script in which case the user-entered text is piped through it for results.  Examples of the file completers include my current bindings for opening web pages:

bind mod4       o       exec tabby-menu " > " ~/.config/tabby/urls "weaver '%s'"
bind mod4       n       exec tabby-menu " + " ~/.config/tabby/urls "weaver //target/0 '%s'"

The 'urls' file is just a list of my commonly used urls (i.e., 'quickmarks').

Examples of pipe-through completers can be seen with the following:

# Quick calculator (requires 'bc')
tabby-menu ' = ' bc
# Stuck on a word, get a quick spell check (requires 'aspell')
tabby-menu ' % ' 'aspell -a | sed -n "/^*/p;/^&/{s/^&[^:]*: //;s/, /\n/g;p}"'

The menu works hopefully how one would expect it: any "regular" or printbale key sequences generate their respective text.  Tab/Down or BackTab/Up cycle forwards and backwards through potential completition options.  Return selects the currently active completion suggestion, Shift+Return selects just the user-entered text regardless of any completion suggestion, Esc exits without activating the 'runner'.  Other editting / cursor-movement keys should act as expected - but no fancy emacs or vi-mode editing is currently implemented.  Pasting from the clipboard / primary selection into the menu is coming but not yet implemented.

Customization of the colors for the prompt, input, and completion options is also on the horizon.

---

@Docbroke, I also just pushed a change to get some more debugging information from any of the hangs you had mentioned.  If / when you see them again after your next update of tabby, please post the new logs.

Last edited by Trilby (2021-09-19 22:07:01)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#65 2021-09-20 03:14:47

Docbroke
Member
From: India
Registered: 2015-06-13
Posts: 1,438

Re: Tabby: a tabbed-tiling wayland compositor

This is cool update. I am going to use both of those commands extensively.

Today after updating tabby, I started tabby on tty1, which was running fine, then I started hikari on tty2, after I moved back to tty1, tabby froze after 2 seconds. Here is log
http://sprunge.us/jtxmNC
Note: this one is huge, termbin wasn't happy with it so I have to find other pastebin client.

Last edited by Docbroke (2021-09-20 03:19:07)

Offline

#66 2021-09-20 11:57:49

Docbroke
Member
From: India
Registered: 2015-06-13
Posts: 1,438

Re: Tabby: a tabbed-tiling wayland compositor

I converted some of my dmenu/rofi scripts to use tabby-menu. For example, this one is like dmenu_run but allows to add custom scripts/commands (from .config/shortcuts_tabby), so that commands needing terminal can also be run.

[ins]└───▶ cat bin/run_tabby
#!/bin/bash

## make temporary file and copy all commands to it
f=$(mktemp /tmp/"${0##*/}".XXXXX)
cat $HOME/.config/shortcuts_tabby <(IFS=:; find $PATH -executable -printf "%f\n" | sort -ur ) > "$f"

tabby-menu " : " $f "exec $command" 
rm "$f"

I am facing some difficulties in piping input or lists to tabby-menu, for e.g., below codes doesn't work. Afaik, only acceptable input is from a text file.

 echo -e "abc\nwxy\nsomething" | tabby " list " - | read option 

or

 ops=("1" "2" "3")
tabby-menu " choose " "${x[@]}" "echo %s"

EDIT: one more suggestion is to consider first option to the tabby-menu as default. For example if choices are weaver, firefox, chromium and user just enters, tabby-menu shall select weaver as it is first option, so there shall be no need to type w. Similarly when user has not input anything, output of tabby-menu is blank, here output may be the first option from the list.

Last edited by Docbroke (2021-09-20 12:10:01)

Offline

#67 2021-09-20 12:32:14

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

Re: Tabby: a tabbed-tiling wayland compositor

For the run-tabby script there should be no need for the temp file, just pipe the results into tabby-menu.  I'm also not sure what "exec $command" means - but as written that will certainly not do anything useful.  There is no need for an "exec" in the third parameter as it is already being run in it's own shell.  And $command is never defined - but the double quotes mean it get's expanded before ever being passed to tabby so it just disappears anyways.  So whatever that script does or fails to do should not change even if you leave off the third parameter.

In the second case, I'm not sure if that was a copy-paste error putting it on the forum, but you need to pipe to tabby-menu not tabby in which case it works fine.  The third has several issues - first I assume 'x' was meant to be 'ops' - but that aside, that is expanded by your shell (assuming it's bash) before it is passed to tabby-menu.  Your shell then feeds tabby the following:

argv[0] = tabby-menu
argv[1] =  choose 
argv[2] = 1 2 3
argv[3] = echo %s

Tabby-menu first checks whether argv[2] is an accessible file, which it isn't.  As it's not, tabby-menu treats argv[2] as a shell command / script to pipe through.  So any input is put through the equivalent of the following:

echo $user-input | sh -c "1 2 3"

Obviously that will not run: the subprocess errors out and no completion option is generated.

If you want to use shell-assembled lists of completion options they need to be fed to tabby-menu's stdin and separated by newlines (or in a temp file, but there's no need for that).  This will work (assuming your shell is bash ... or at least has arrays):

ops=(1 2 3)
printf '%s\n' ${ops[@]} | tabby-menu " choose " - "echo %s"

But note that single character options are effectively meaningless as they can't actually offer any completion options.  If an input matches any part of them, it matches the whole thing ... so there's nothing to add with the completion.

The above relates to the last point - right now, there is a 1-character minimum match - this might become customizable to allow for a null input to match everything soon, but for now some entry needs to be made.

---

Thanks for the log.  Unfortunately it confirms that this error should not happen.  The error message suggests that the output device (monitor) was not ready for a rendering commit - but every rendering commit follows a frame event which is what the output uses to tell the compositor it is ready.  Do you ever see this issue when you aren't running another compositor on another tty?  Or if you are running another compositor but not hikiri (e.g., sway) on the other tty?  Effectively what's happening is the monitor says it's ready for a frame, but when it's given a frame is complains 'Hey! I wasn't ready!'.  The only way this should happen is if some other process is attempting to render to the ouput without getting the frame event from the monitor (essentially 'stealing' tabby's invitation to render).

EDIT: I just reviewed hikiri's rendering code, and it appears to only render it's own frame events, so it shouldn't be 'stealing invitations' - but I'd still be curious about whether this issue crops up only when other, or certain other compositors are running in other ttys.

As for the log size, that was due to the debugging output added for this issue which I just removed again.

Last edited by Trilby (2021-09-20 13:04:53)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#68 2021-09-20 13:40:28

Docbroke
Member
From: India
Registered: 2015-06-13
Posts: 1,438

Re: Tabby: a tabbed-tiling wayland compositor

First script actually works, I put that just as an working example. I actually modified my script, where output of rofi was piped to "read command" and was followed by "exec $command" which actually should have been "exec %s" with tabby-menu (my mistake), however "exec $command" also works, so it appears that %s is appended to "exec $command" and as $command is null, %s is executed. So that script is now actually one-liner, which was not possible earlier with rofi or fzf versions.

cat $HOME/.config/shortcuts_tabby <(IFS=:; find $PATH -executable -printf "%f\n" | sort -ur ) | tabby-menu " : " - "exec %s"

Second was having typo as you pointed out, sorry for that. Actually I considered it as not working, and that led me to trying other options like 3rd script. I used single character option just for example of code, I don't actually use them in scripts.

EDIT: When I tried to run your piped script examples, of calculator and spell checker they didn't so it confused me some more.
Another point of confusion was "prompt", which seems like mandatory, otherwise code fails. Also initially I was confused about role of different prompts ( %, = etc.), before realizing that it is just cosmetic.

EDIT: regarding log, when hikari starts, it also loads some other programs from it's startup file, including ibus/telegram/weaversesrver etc. I think some of them may be causing this tabby freeze, same thing may be happening when I restart tabby, leading to another instance of same program. I will try to avoid these possibilities to see him freeze occurs again.

Last edited by Docbroke (2021-09-20 13:53:10)

Offline

#69 2021-09-20 14:23:47

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

Re: Tabby: a tabbed-tiling wayland compositor

The prompt can be empty, but interpretation of command line arguments is based on position.  So if you are to include a completion source as a second argument, you must include a first argument (but it can be an empty string).  If you are to include a third argument, you must include the first two.  So for no prompt with the calculator example you could use the following:

tabby-menu "" bc

However, you'll likely find that at least having a single space as the prompt will make it look much better:

tabby-menu " " bc

Note the following should also be equivalent to your first script:

cat $HOME/.config/shortcuts_tabby <(IFS=:; find $PATH -executable -printf "%f\n" | sort -ur ) | tabby-menu " : " - "%s"

As is this which is more efficient (completely trivially so though):

(cat $HOME/.config/shortcuts_tabby; IFS=:; find $PATH -executable -printf "%f\n" | sort -ur ) | tabby-menu " : " "%s"

Out of curiosity, why the reverse sort?

Note that most of the time the exec in your 'exec %s' is useless but harmless, in some cases though it might cause commands to fail.  The exec just adds an additional process for no purpose whatsoever.

EDIT: hmm, perhaps not useless - if it's a long running process, it will replace the 'sh' instance.  If that's the intended goal then nevermind the last point above.

Last edited by Trilby (2021-09-20 14:28:12)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#70 2021-09-20 14:45:28

Docbroke
Member
From: India
Registered: 2015-06-13
Posts: 1,438

Re: Tabby: a tabbed-tiling wayland compositor

I don't know what is wrong, but all 4 scripts you posted don't work. The one with bc just gives same output as input. So if I input 3+4 it outputs 3+4 not 7. Last two scripts without exec %s, just outputs commands doesn't run it. Similarly your spell check scripts doesn't work with me.

Main purpose of sort was to remove duplicates. I don't remember why I added reverse sort, probably some commonly  used commands easier to find that way.

EDIT: exec was indeed to allow freeing the shell. This script was made to run from terminal (with fzf inplace of tabby-menu), as well as from wm-shortcuts (using rofi), therefore I had to add exec, to free the terminal when it is run from there.

Last edited by Docbroke (2021-09-20 15:00:34)

Offline

#71 2021-09-20 15:02:28

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

Re: Tabby: a tabbed-tiling wayland compositor

Docbroke wrote:

I don't know what is wrong, but all 4 scripts you posted don't work. The one with bc just gives same output as input. So if I input 3+4 it outputs 3+4 not 7.

Do you have a bc implementation installed?  And aspell (with appropriate dictionaries)?  Niether the calculator or spell check was really meant to send anything useful to the stdout (though I suppose the answer or selected correction or an asterisk will come out) but the completion option is updated on the fly providing the answer or spelling options in the bar as you type.

Last edited by Trilby (2021-09-20 15:03:13)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#72 2021-09-20 15:11:11

Docbroke
Member
From: India
Registered: 2015-06-13
Posts: 1,438

Re: Tabby: a tabbed-tiling wayland compositor

Yes bc is there. However aspell was not installed so I did that, and it actually works (sorry for that).
Ok got it, my bc is different from your bc. If I run

 tabby-menu "=" "busybox bc"

it works.

btw.: have you tried kisslinux. It may be minimal enough for your likings.

Last edited by Docbroke (2021-09-20 15:19:26)

Offline

#73 2021-09-20 16:17:00

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

Re: Tabby: a tabbed-tiling wayland compositor

Which bc do you use?  This works fine with gnu bc from the repos.  What symptoms do you see?

And RE KISS.  I like a lot of his goals, but it's just not a very well done project.  Alpine however is great - they just don't have as active of a community to be involved with.

Last edited by Trilby (2021-09-20 17:18:05)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#74 2021-09-20 18:05:40

Docbroke
Member
From: India
Registered: 2015-06-13
Posts: 1,438

Re: Tabby: a tabbed-tiling wayland compositor

gnu bc

with gnu bc, I see only input in tabby-bar, no results. If run from terminal, after pressing enter, output=input.

Have you created APKBUILD for your packages ? I have alpine on one partition, only thing I don't like there is dependance of scripts for installation/configuration and lack of simple guides for manually doing things.

Last edited by Docbroke (2021-09-20 18:06:24)

Offline

#75 2021-09-20 19:35:29

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

Re: Tabby: a tabbed-tiling wayland compositor

I'm not currently running an alpine system.  When I last set up an install, alpine documentation for (u)efi was horrendous and didn't seem practical.  That's completely changed now ... so my next install will be alpine.  But I'm not sure when that might be.

As for the bc issue  (edit: trimmed nonsense) ...

Found it: gnu's bc will not read from a pipe unless input is newline terminated.  I've added a newline to what is sent over the pipe as it is best to have it - but gnu's bc is the only program I've found that reads from stdin but will fail to do so without the newline:

printf '1+1' | cat
1+1

printf '1+1' | grep 1
1+1

printf '1+1' | bc      # busybox's bc on my system
2

printf '1+1' | /bin/bc
(standard_in) 1: syntax error

Last edited by Trilby (2021-09-20 21:29:38)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

Board footer

Powered by FluxBB