Not talking about your terminal, set this in your i3 config. There is a difference between i3 syntax and bash (or zsh or whatever shell you have) syntax.
You need to have:
set $brillo pkexec /usr/bin/brillo -equ 1500
bindsym XF86MonBrightnessUp exec true $($brillo -A 5)
bindsym XF86MonBrightnessDown exec true $($brillo -U 5)
Or just try bindsym XF86MonBrightnessUp exec true $(pkexec /usr/bin/brillo -equ 1500 -U 5)
In the description of the function, few lines above the linked code
Also I thought PID 1 adopted any parentless processes automatically
Yes, a single fork is not a parentless process: i3 would still be the parent but would never "reap" the process. With a double fork, i3 opens a process that forks and immediately exits. The new child doesn't have a parent in this case and PID1 adopts it.
We use double fork
to avoid zombie processes. As the started application’s parent exits (immediately),
the application is reparented to init (process-id 1), which correctly handles
childs, so we don’t have to do it :-).
You can also try: bindsym XF86MonBrightnessUp exec sh -c "pkexec ..."
This still fails for me. i3 already runs exec lines through sh -c. What I think is happening here is that sh -c will exec the commands, meaning that sh is not the parent but sh's parent is the parent (exec "replaces the current process image with a new process image").
To configure i3 or Sway to use brillo, add the following to your config:
set $brillo exec pkexec /usr/bin/brillo -equ 1500
bindsym XF86MonBrightnessDown exec $brillo -U 5
bindsym XF86MonBrightnessUp exec $brillo -A 5
Don't know if sway does things differently but pkexec refuses to execute like this under i3 with an error: "Refusing to render service to dead parents."
A workaround is to use set $brillo pkexec /usr/bin/brillo -equ 1500, bindsym XF86MonBrightnessUp exec true $($brillo -U 5)
Did you mark everything as executable (chmod +x)? Do the scripts work outside of chromium? Running ~/bin/thunar-chromium/xdg-mime should output
nautilus.desktop, running ~/bin/thunar-chromium/nautilus /path/to/some/file should open thunar and select the file. same thing with ~/bin/thunar-open-file.py /path/to/some/file.
You can organize it however you want, here's the concept:
Create a folder, ~/bin/thunar-chromium/ for me.
Put these 2 files in it: nautilus, xdg-mime. Filenames matter here.
Put thunar-open-file.py in ~/bin (or wherever you like, just make sure to change ~/bin/thunar-chromium/nautilus accordingly.
Prepend $HOME/bin/thunar-chromium: to your path before calling chromium. Multiple ways to do this. I personally added a file called chromium in a folder I keep some executables and made sure that it's called instead of /usr/bin/chromium. Eg:
Thunar can't actually select a file by default (if you pass the full path it tries to open it and there isn't a --select argument) but can probably be done with this.
The relevant bug pages seems to be this. and this. Chromium uses xdg-open and doesn't pass the filename, only the directory. There might be a workaround, mentioned in this comment.
If you manage to make it work please reply here since I am interested too. Otherwise I might take a look at it tomorrow (12+ hours, I have to watch GoT first :D).
Suggestion: install an application launcher like rofi
Not talking about your terminal, set this in your i3 config. There is a difference between i3 syntax and bash (or zsh or whatever shell you have) syntax.
You need to have:
Or just try
bindsym XF86MonBrightnessUp exec true $(pkexec /usr/bin/brillo -equ 1500 -U 5)Try
set $brillo pkexec /usr/bin/brillo -equ 1500Does it work from the command line?
In the description of the function, few lines above the linked code
Yes, a single fork is not a parentless process: i3 would still be the parent but would never "reap" the process. With a double fork, i3 opens a process that forks and immediately exits. The new child doesn't have a parent in this case and PID1 adopts it.
Yes, i3 double forks: https://github.com/i3/i3/blob/dfe89cc4f1706a6fae0ae3816787d0fb22dadd7d/src/startup.c#L175-L199
This still fails for me. i3 already runs exec lines through
sh -c. What I think is happening here is thatsh -cwillexecthe commands, meaning that sh is not the parent but sh's parent is the parent (exec "replaces the current process image with a new process image").If the parent is /sbin/init system then pkexec refuses to run: https://github.com/wingo/polkit/blob/4c9a813f3fc1ada4fcce508d286e95f965a3002a/src/programs/pkexec.c#L725-L732. But this is exactly what i3 achieves by double forking.
Don't know if sway does things differently but pkexec refuses to execute like this under i3 with an error: "Refusing to render service to dead parents."
A workaround is to use
set $brillo pkexec /usr/bin/brillo -equ 1500,bindsym XF86MonBrightnessUp exec true $($brillo -U 5)i3 reads
Xft.dpifrom xresources. Font scalability relies on pango (see the default config). From there, applications deal with dpi by themselves, see https://wiki.archlinux.org/index.php/HiDPI/u/bag123boy
You could disable focus_follows_mouse but this will apply for all containers.
What scriptability are you missing with i3? There is an IPC interface.
i3 does crash, just not that often and not when you aren't doing anything exotic
Yes. Try starting chromium with
--password-store=gnomeNope, just got used to it
If vim is your
$EDITORyou can quit with:cqinstead of:q.You could have a script that runs whenever you are logged in tty1 and restarts startx whenever it exits.
I know this sounds obvious but did you reload your i3 config (default is bound to $mod+Shift+c)?
If yes, can you assign something else to one of the buttons (eg thunar, firefox), reload and see if it works?
Did you mark everything as executable (
chmod +x)? Do the scripts work outside of chromium? Running~/bin/thunar-chromium/xdg-mimeshould outputnautilus.desktop, running~/bin/thunar-chromium/nautilus /path/to/some/fileshould open thunar and select the file. same thing with~/bin/thunar-open-file.py /path/to/some/file.After this or because of unrelated issues?
I got it work actually: https://github.com/orestisf1993/dotfiles/commit/a655877cb4eeb4ce06f8bec282c192bffe3e6f51
You can organize it however you want, here's the concept:
Create a folder,
~/bin/thunar-chromium/for me.Put these 2 files in it: nautilus, xdg-mime. Filenames matter here.
Put thunar-open-file.py in ~/bin (or wherever you like, just make sure to change
~/bin/thunar-chromium/nautilusaccordingly.Prepend
$HOME/bin/thunar-chromium:to your path before calling chromium. Multiple ways to do this. I personally added a file called chromium in a folder I keep some executables and made sure that it's called instead of/usr/bin/chromium. Eg:Thunar can't actually select a file by default (if you pass the full path it tries to open it and there isn't a
--selectargument) but can probably be done with this.The relevant bug pages seems to be this. and this. Chromium uses xdg-open and doesn't pass the filename, only the directory. There might be a workaround, mentioned in this comment.
If you manage to make it work please reply here since I am interested too. Otherwise I might take a look at it tomorrow (12+ hours, I have to watch GoT first :D).
That's why you don't copy stuff from the internet.
Thanks ;)
I wrote this service:
if anyone wants to use it. Don't know if there is a way to not run neofetch with superuser rights though.
EDIT:
ExecStart=/bin/bash -c 'sudo -u nobody neofetch | tee /etc/issue'could avoid root neofetch.Before. Everything after
exec i3is not reached afaik.I do this in my
~/.xinitrc: