Quick Quality-of-Life Improvements

Freeing up disk space in dom0

sudo journalctl --vacuum-time=1d

It will delete all the archived sysjournals, they can take up a surprising amount of disk space.

7 Likes

@renehoj Added both–they’re currently the top two shortest entries. I can’t really imagine a shorter entry than the journalctl one.

If there was a leaderboard for this thread, you’d be at the top.

2 Likes

Automatically log in to dom0/XFCE on boot

Edit /etc/lightdm/lightdm.conf and uncomment and set autologin-user=dom0-username

Logout, lock screen, and suspend works as normal where you need to use your password, but booting the system will skip the lightdm login prompt and boot you into the desktop without you having to enter your dom0 user password.

Your LUKS password is still be needed to boot the system.

7 Likes

Added; thanks

1 Like

What I stumbled upon when reading the i3 User’s Guide is binding_modes

So when I’ve booted my machine, there are a bunch of AppVMs I want to start or not. Stuff like the split-ssh-vault get started automatically, but sometimes I’m interested in quickly launching a few AppVMs.

What I ended up with was this:

where $mod is the i3 modifier key. This is depending on your configuration either Alt (aka Meta) or Super (aka Windows-Key). It gets configured very early at the top of ~/.config/i3/config and is then refered to as $mod throughout the configuration.

set $mode_launcher Launch: [e]macs [m]ail [t]elegram [s]ignal e[l]ement [d]iscord [k]iwix [z]eal
bindsym $mod+o mode "$mode_launcher"

# My own little menu launcher to access single-purpose app qubes faster =)
mode "$mode_launcher" {
    # EDITOR
    bindsym e exec qvm-run dev "emacsclient -c -a 'emacs'"

    # CHAT
    bindsym s exec qvm-run signal signal-desktop
    bindsym t exec qvm-run telegram telegram-desktop
    bindsym d exec qvm-run discord discord
    bindsym l exec qvm-run element element-desktop
    #bindsym e exec qvm-run element element-desktop # FIXME: clashes with emacs
    bindsym m exec qvm-run mail thunderbird

    # DOC
    bindsym k exec qvm-run kiwix kiwix-desktop
    bindsym z exec qvm-run zeal zeal

    bindsym Escape mode "default"
    bindsym Return mode "default"
}

This works very similar to the resize-binding mode.

This allows me to do
$mod+o + e + ESC to spawn an editor

the neat thing with this mode really is that I can launch everything I want with a single keystroke before leaving with ESC

so $mod+o + stdlm + ESC will launch every chat-app.
This was 5 $mod+d or $mod+shift+Enter invocations + finding the right AppVM before!

or $mod+o + eee + ESC will launch 3 editor instances.

the top level line set $mode_launcher... is really just a visual help inside i3bar… I tend to forget stuff.

This really shines with @fiftyfourthparallel’s halt-vm-by-window script, which I personally bound to this:

bindsym $mod+Shift+p exec --no-startup-id halt-vm-by-window

“need to look up some docs” … $mod+o + z + ESC
"oh, I dont need this anymore … $mod+Shift+p

saved me lots of qvm-run and the latter qvm-shutdown invocations per day/hour.

At this point: thx @fiftyfourthparallel!

1 Like

where do i create this script?

Very cool and useful. Allow me to point others who, like you and me, also have a startup script (I’m gonna have to change mine a bit now that I’ve seen yours!) or may be interested in hotkeys in the dom0 terminal:

Where you want. I use $HOME/.local/bin as it is part of my $PATH so I can use the name of the file as a command in the terminal or create a keyboard shortcut. But you can choose whatever place instead.

That’s a neat solution too.

I have to wrap my head around it a bit more, but as I understand this goes plain-BASH and is DE/WM-agnostic?

Currently I have a few machines not capable of running QubesOS so I keep i3 and i3.qubes next to each other in my dotfiles that only differ in whether the command is invoked with qvm-run <VM_NAME> or without.

I thought about solving this unsexiness by conditionally loading a qubes.conf into my regular ~/.config/i3/config but your approach might do even better.
When I have spare time I’ll fiddle with it and let you know what I got afterwards! =)

1 Like

I really like what you’ve made and I’ll probably integrate it into my own workflow once I find time.

halt-vm-by-window is not my creation–that honor belongs to @Tasket. I’m just its chief evangelizer (and if things go well, I’ll be preaching about your shortcuts too).

@q4u Can you improve this draft? Are there any prerequisites people should know about? For example, what’s $mod?

Someone who’s generally incompetent at Linux (i.e. me) should be able to follow the instructions and end up with a working solution.

 


  • Quickly launch multiple apps across VMs - [dom0] Create /bin/quick-launcher (expandable) and use shortcuts @q4u

    quick-launcher
    # Replace example appVM and names/commands with your own
    
    set $mode_launcher Launch: [e]macs [m]ail [s]ignal
    bindsym $mod+o mode "$mode_launcher"
    
    mode "$mode_launcher" {
      bindsym e exec qvm-run app-dev "emacsclient -c -a 'emacs'"
      bindsym s exec qvm-run app-signal signal-desktop
      bindsym m exec qvm-run app-mail thunderbird
    
      bindsym Escape mode "default"
      bindsym Return mode "default"
    }
    

edited. better?

I see. Thanks for pointing that out.

Edit: I see I fucked up by editing the original post of mine.

No no. This is not supposed to be an additional shell script, it’s part of your ~/.config/i3/config configuration file.

$mod is i3’s modifier key, e.g. the key that it starts doing stuff with. This can be either Alt (aka Meta) or Super (aka Windows-key).
It gets defined very early in the head of ~/.config/i3/config and is then referred to as $mod so the config stays consistent regardless whether somebody chose Alt or Super for his personal config.
I would go as far as to say that this is sth every i3 user is aware of, because if you’re starting without a config it will ask you to which key to set this to.

I hope this helps.

Also regarding requisites there are none, this is plain builtin i3 functionality. Except of having i3 installed, duh.

Thank you @Tasket for halt-vm-by-window awesomeness!

1 Like

It’s the content that matters most, and your content is great.

Can you adapt this for non-i3 users? I don’t think i3 is common among Qubes users so this wouldn’t help as many users as I’d hoped.

1 Like

thx.

Unfortunately no, this very piece of snippet is i3 builtin stuff.

This would loosely translate to setting custom keybindings/shortcuts in XFCE/KDE/AwesomeWM. Although I don’t think they have this specific functionality of a “mode” → that you enter it with some key-combination ($mod+o, keys have special meaning and act accordingly (m), you leave it with a key (ESC).

More likely you’ll need to bind them to Super+Shift+m, but this gets tricky real quick, because all DEs/WMs tend to have there own keybindings already configured that do stuff differently.
A one-fits-all solution does seem unlikely to me for that reason.

This might be what you’re looking for, which is as far as I understand a script-based approach that can be used in any DE/WM.

1 Like

Understood. I don’t know enough about i3 to write the entry myself. There’s one i3 entry by @ruza which was mostly written by him and contains most of what’s needed. Can you write the entry using that as reference?

  • Open selected window’s VM’s terminal - i3 only - [dom0] open ~/.config/i3/config, then add bindsym $mod+Return exec qubes-i3-sensible-terminal. To open as root, replace qubes-i3-sensible-terminal with qubes-i3-sensible-terminal.root. Alter shortcut as needed. @ruza

I’ll try of course.

I’m just having trouble what you mean by “entry”?
I think that this is somehow different from the thread?

How and where do I edit that?

I rather recently started posting on discourse and before that it was just reading.

I’ll look into the docs, just trying to do this right and not pollute some chats or doing it wrong.

@fiftyfourthparallel Heeelp!
I fucked up even more and created a thread instead of PMing you

By “entry” I mean the individual tips that make up the top post.

In your case I suggest you write a draft and post it as a reply here instead of editing the wiki directly.

Don’t worry about making mistakes–I’m not looking for perfection; I just need you to write a post that’s has the technical details necessary so it’ll be useful to other users. Just try your best to copy the style of the entries and I’ll take care of the rest.

Thx, I think I get it now.

I’d say this goes in etc somewhere near the other i3-only entry.

BEGIN ENTRY

config.append
# Replace example appVM and names/commands with your own

set $mode_launcher Launch: [e]macs [m]ail [s]ignal
bindsym $mod+o mode "$mode_launcher"

mode "$mode_launcher" {
  bindsym e exec qvm-run app-dev "emacsclient -c -a 'emacs'"
  bindsym s exec qvm-run app-signal signal-desktop
  bindsym m exec qvm-run app-mail thunderbird

  bindsym Escape mode "default"
  bindsym Return mode "default"
}

END ENTRY

1 Like

Fantastic!

Thank you for being so cooperative. Your entry has been added.

A non-i3 version of this would help a lot of users so if someone out there can make it happen please let me know

2 Likes