Skip to content

Instantly share code, notes, and snippets.

@lidgnulinux
lidgnulinux / wayland_list_window_s.sh
Created May 20, 2024 02:46
Show list of window(s) for wayland compositor. The compositor may need to implement foreign-toplevel protocol.
#!/usr/bin/bash
window_list=$(wlrctl toplevel list | awk '{ print substr($0, index($0,$2)) }')
selected=$(echo "$window_list" | wofi -d)
wlrctl toplevel focus title:"$selected"
# Note :
# We need to use "title" rather than "app_id" to avoid window with same app_id.
@lidgnulinux
lidgnulinux / gist_awk_print_2nd_to_last.md
Created May 20, 2024 02:09
Print second column to last column using awk.

Using awk to print second column to last column.

$ echo "first second third N69 NeNN" | awk '{ print substr($0, index($0,$2)) }'

The output will be :

second third N69 NeNN
@lidgnulinux
lidgnulinux / flip_vertical.effect
Created May 18, 2024 05:35
Flip vertical effect for upside-down webcam.
[Effect]
Name[en_GB]=Flip_Vertical
Name=Flip_Vertical
Comment[en_GB]=Flip the image vertically (Silly fix for upside down webcam)
Comment=Flip the image vertically (Silly fix for upside down webcam)
Category=Geometry;
PipelineDescription=videoflip video-direction=vert
@lidgnulinux
lidgnulinux / gvim_trick_1.md
Created May 12, 2024 01:41
GVIM simple trick (Copy and paste on terminal).

Using GVIM as alternative terminal. (Part I).

Copy and paste on terminal.

Copy.

  • To copy, press and hold the shift button and start to select our desired texts !

Paste

Using dracut as default on archlinux instead of mkinitcpio ? Here a simple guide.

PS : you can check it on archwiki actually.

Installation.

Assumming you still don't have dracut and mkinitcpio, you can install dracut using pacman.

@lidgnulinux
lidgnulinux / Launch_ubuntu_gnome_wayland_without_display_manager.md
Created May 3, 2024 01:54
Alternative way to launch Ubuntu GNOME without display manager.

How to Launch Ubuntu GNOME (Wayland) without Display Manager.

I'm not a fans of display manager (GDM, Lightdm, SDDM, etc), though for some people they could be usefull. When I'm using debian, slackware, alpine, I can launch GNOME desktop without display manager (I use tbsm / terminal based session manager). Strangely when I move to Ubuntu, I'm kind of forced to use display manager (GDM, in this case). So I tried several commands to launch ubuntu GNOME directly from tty and gladly I found it. I just need to use this command :

network:
wifis:
YOUR_WIRELESS_INTERFACE:
dhcp4: yes
dhcp6: yes
access-points:
"YOUR_SSID":
password: "YOUR_PASSWORD"
version: 2
renderer: networkd

Installing Ubuntu Via Minimal Archive

This is a simple guide for installing Ubuntu using minimal archive. I knew it some days ago, Ubuntu provides a minimal archive / rootfs which we can use to have a minimal Ubuntu system. We will use it to get a minimal and quite usable Ubuntu distro.

Requirements.

We will need some requirements, like :

7427: find library=libgstgl-1.0.so.0 [0]; searching
7427: search path=/usr/lib/x86_64-linux-gnu/glibc-hwcaps/x86-64-v2:/usr/lib/x86_64-linux-gnu (system search path)
7427: trying file=/usr/lib/x86_64-linux-gnu/glibc-hwcaps/x86-64-v2/libgstgl-1.0.so.0
7427: trying file=/usr/lib/x86_64-linux-gnu/libgstgl-1.0.so.0
7427:
7427: find library=libgstvideo-1.0.so.0 [0]; searching
7427: search path=/usr/lib/x86_64-linux-gnu (system search path)
7427: trying file=/usr/lib/x86_64-linux-gnu/libgstvideo-1.0.so.0
7427:
7427: find library=libgstreamer-1.0.so.0 [0]; searching
1669: find library=libgstgl-1.0.so.0 [0]; searching
1669: search path=/usr/lib/x86_64-linux-gnu/glibc-hwcaps/x86-64-v2:/usr/lib/x86_64-linux-gnu (system search path)
1669: trying file=/usr/lib/x86_64-linux-gnu/glibc-hwcaps/x86-64-v2/libgstgl-1.0.so.0
1669: trying file=/usr/lib/x86_64-linux-gnu/libgstgl-1.0.so.0
1669:
1669: find library=libgstvideo-1.0.so.0 [0]; searching
1669: search path=/usr/lib/x86_64-linux-gnu (system search path)
1669: trying file=/usr/lib/x86_64-linux-gnu/libgstvideo-1.0.so.0
1669:
1669: find library=libgstreamer-1.0.so.0 [0]; searching