Skip to content

Instantly share code, notes, and snippets.

View mlongval's full-sized avatar

Michael Longval mlongval

  • Université de Sherbrooke
  • Sherbrooke, Quebec, CANADA
  • 17:00 (UTC -04:00)
View GitHub Profile
@mlongval
mlongval / gdm-external-display.md
Created March 9, 2026 19:38
GDM greeter on external display — mutter 49+ correct monitors.xml path (seat0/config)

GDM Greeter on External Display (mutter 49+ / GNOME 47+)

The Problem

On modern GNOME systems (mutter 49+), the GDM login greeter ignores external displays and always appears on the internal laptop panel, even when an external monitor is connected and configured correctly in the user session.

Why the Common Fix Doesn't Work

@mlongval
mlongval / dls_full.md
Created August 5, 2025 22:58
Clean lsd -l output with Icons but without Symlink Targets

Clean lsd -l Output with Icons But Without Symlink Targets

A robust one-liner and shell function to use lsd (LSDeluxe) with all its NerdFont-powered visual glory — while hiding symlink targets (⇒ path).

It preserves icons, formatting, and works beautifully in scripts and aliases.

Perfect for minimalist terminal users who love beauty without unnecessary clutter.


@mlongval
mlongval / gist:c5bba043980b377f2dfcaf6e4958633d
Last active July 10, 2024 04:04
Make Zsh never go below the last 3 lines on screen. Useful if KDE Panel covers bottom of terminal when working.
# Little function to prevent Zsh from going below the bottom 3rd line of your terminal.
# Michael Longval
# mlongval <at> gmail.com
# Tags: KDE Konsole Zsh z-shell
# I was having trouble with KDE Panels covering my Konsole sometimes
# (would have to stop typing and click the panel to make it automatically disappear.)
# It works by printing 2 new-line characters and then going 2 lines back up
@mlongval
mlongval / gist:b86774fd12f5812a0b7e6f1cf14c43f9
Last active June 28, 2024 01:10
Fix Thunderbird Gmail login error (Thunderbird version 115.12.2 (64-bit))
@mlongval
mlongval / bs_to_exit.vim
Last active December 25, 2025 23:58
Map Backspace to Exit VIM if on top left corner (beginning of buffer)
" Exit Vim if Backspace key at beginning of unmodified buffer (top left)
" Very usefull if you use a terminal file explorer like Ranger
" https://github.com/ranger/ranger
" you can just got into and out of files with Enter and Backspace keys.
" Obviously will notify if buffer is modified and unsaved.
@mlongval
mlongval / Fix_BBCBasic_OwletEditor.txt
Created April 29, 2023 18:00
Fix compile problems for BBC Basic Owlet Editor
29.04.2023 13h25
I wanted to try and install mattgodbolt's cool BBC Basic
Owlet Editor on my system.
[https://github.com/mattgodbolt/owlet-editor]
Here is the blurb from the repository describing it:
Owlet Editor
@mlongval
mlongval / menu1.py
Last active August 27, 2020 17:28
Simple Menu system for CLI written in Python
#!/usr/bin/env python3
# vim: filetype=python
# Simple #!/usr/bin/env python3
# vim: filetype=python
# Michael Longval
# mlongval@gmail.com
# Simple menuing system to execute scripts in $HOME/bin/menu1_items
@mlongval
mlongval / gist:78206e9c48c2eb123e1af09e807c3ac1
Created February 26, 2019 21:21
Ultisnips (Vim) snippet to set a vim modeline and set buffer language
# set the document modeline and spelling to english
snippet setenglish "" b
# vim: spell spelllang=en
`!p vim.command("set spelllang=en")`
endsnippet
# set the document modeline and spelling to french
snippet setfrench "" b
# vim: spell spelllang=fr
`!p vim.command("set spelllang=fr")`
@mlongval
mlongval / gist:9fbe1e16b97be6e16ce0675b7291da94
Created January 8, 2017 06:01
Practice Python 05 march 2014
def overlap():
import random
listA = random.sample(range(100), k=10)
listB = random.sample(range(100), k=12)
listC = list(set([x for x in listA if x in listB]))
listC.sort()
return listC
@mlongval
mlongval / ToggleGrayScaleMode
Last active February 3, 2016 14:46
MacOSX Grayscale Mode Toggle Applescript
(*
ToggleGrayScaleMode for MacOSX 10.9 Mavericks
works as of 15 april 2014
This is an AppleScript UI script to toggle GrayScaleMode in System Preferences.
I am red-green colorblind and grayscale helps a lot...
Works for me. Hope it can be usefull for you.
Mike