Skip to content

Instantly share code, notes, and snippets.

@lbonn
lbonn / gist:b7f9b7f19796f121e03b0ec3606e15a6
Created October 24, 2016 12:40
ubuntu git+virtualenv prompt
GIT_PROMPT_SH="/usr/lib/git-core/git-sh-prompt"
if [ -f ${GIT_PROMPT_SH} ] && [ "$color_prompt" = yes ]; then
GIT_PS1_SHOWCOLORHINTS=1
GIT_PS1_SHOWDIRTYSTATE=1
GIT_PS1_SHOWUPSTREAM=auto
. ${GIT_PROMPT_SH}
PROMPT_COMMAND='__git_ps1 "${debian_chroot:+($debian_chroot)}${VIRTUAL_ENV:+($(basename $VIRTUAL_ENV))}\[\033[01;32m\]\u\[\033[00m\]@\[\033[01;35m\\]\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]" "\\\$ "'
1489195192.832722 server started (644): version master, socket /tmp/tmux-1000/test, protocol 8
1489195192.832761 on Linux vvvv-yyyy #1 SMP Wed Dec 7 03:22:24 CET 2016; libevent 2.0.22-stable (poll)
1489195192.835005 add peer 0x22c10d0: 8 (0x22c08e0)
1489195192.835036 new client 0x22c08e0
1489195192.835066 loading /etc/tmux.conf
1489195192.835086 loading /dev/null
1489195192.835180 server loop enter
1489195192.835257 peer 0x22c10d0 message 100
1489195192.835278 client 0x22c08e0 IDENTIFY_FLAGS 0x10000
1489195192.835289 peer 0x22c10d0 message 101
#!/usr/bin/env bash
# custom version: can match user
shopt -s nullglob globstar
if [[ $1 == "--user" ]]; then
grepstr='(?<=user: ).*$'
shift
fi
@lbonn
lbonn / gist:441e8868fbd8176350296457b80eb634
Created October 10, 2017 20:55
sway crash: resize inside scratchpad
10/10/17 22:48:26 - [ipc-server.c:174] Event on IPC listening socket
10/10/17 22:48:26 - [ipc-server.c:221] New client: fd 30, pid 18575
10/10/17 22:48:26 - [ipc-server.c:245] Client 30 readable
10/10/17 22:48:26 - [criteria.c:104] Parsing criteria: 'title="test"'
10/10/17 22:48:26 - [criteria.c:256] title -> /test/
10/10/17 22:48:26 - [commands.c:425] Handling command 'floating enable'
10/10/17 22:48:26 - [commands.c:344] find_handler(floating) 0
10/10/17 22:48:26 - [commands.c:469] Running on container 'test'
10/10/17 22:48:26 - [layout.c:140] Adding 0x5585afe568c0 (4, 956.000000x1010.000000) to 0x5585af4c2530 (2, 956.000000x1010.000000)
10/10/17 22:48:26 - [ipc-server.c:1076] Sending window::floating event
@lbonn
lbonn / outlook-sane.md
Last active March 23, 2020 14:28
Make outlook.com look sane

Quick guide for saner Outlook webmail

Inbox setting

A lot of the annoying Outlook aspects can actually be controlled from the Inbox settings. The general approach is to disable all the "smart" feature they tried to add.

First click on the settings icon (top-right-corner) then "View all Outlook settings".

@lbonn
lbonn / sway-window-menu
Created April 22, 2020 10:55
Window switcher for sway ('rofi -show window' clone)
#!/usr/bin/env bash
set -euo pipefail
tree=$(swaymsg -t get_tree)
readarray -t win_ids <<< "$(jq -r '.. | objects | select(has("app_id")) | .id' <<< "$tree")"
readarray -t win_names <<< "$(jq -r '.. | objects | select(has("app_id")) | .name' <<< "$tree")"
readarray -t win_types <<< "$(jq -r '.. | objects | select(has("app_id")) | .app_id // .window_properties.class' <<< "$tree")"
switch () {
$ WAYLAND_DEBUG=1 ./target/debug/examples/clipboard
[3040459.534] -> [email protected]_registry(new id wl_registry@2)
[3040459.576] -> [email protected](new id wl_callback@3)
[3040461.858] [email protected]_id(3)
[3040461.872] [email protected](1, "wl_shm", 1)
[3040461.981] [email protected](2, "wl_drm", 2)
[3040462.003] [email protected](3, "zwp_linux_dmabuf_v1", 4)
[3040462.022] [email protected](4, "wl_compositor", 5)
[3040462.029] [email protected](5, "wl_subcompositor", 1)
[3040462.037] [email protected](6, "wl_data_device_manager", 3)
@lbonn
lbonn / crash2.log
Created January 8, 2024 14:50
smithay crash 2
$ WAYLAND_DEBUG=1 ./target/debug/examples/clipboard
[1341450.596] -> [email protected]_registry(new id wl_registry@2)
[1341450.642] -> [email protected](new id wl_callback@3)
[1341452.613] [email protected]_id(3)
[1341452.642] [email protected](1, "wl_shm", 1)
[1341452.756] [email protected](2, "wl_drm", 2)
[1341452.767] [email protected](3, "zwp_linux_dmabuf_v1", 4)
[1341452.773] [email protected](4, "wl_compositor", 5)
[1341452.795] [email protected](5, "wl_subcompositor", 1)
[1341452.804] [email protected](6, "wl_data_device_manager", 3)