Skip to content

Instantly share code, notes, and snippets.

View thamudi's full-sized avatar
🐳
Diving into pods

Tamim Hamoudi thamudi

🐳
Diving into pods
View GitHub Profile
@thamudi
thamudi / Restore the GRUB Bootloader.md
Created November 30, 2022 14:00 — forked from dianjuar/Restore the GRUB Bootloader.md
Restore the GRUB Bootloader on Manjaro Linux. Usefull when your fresh windows install eats your grub and can not boot into your linux installation, or for some how your grub is missing

Restore the GRUB Bootloader on Manjaro

  1. Chroot into your linux instalation
    1. The easiest way is with mhwd-chroot
      1. Install it yaourt -S mhwd-chroot
      2. Run it sudo mhwd-chroot
      3. DONE, you have chrooted into your linux installation (open a root console of your installed linux OS, is like just open a console with root access)
  2. Restore your GRUB
    1. Install a new GRUB bootloader with grub-install /dev/sda
  3. Recheck to ensure the that installation has completed without any errors grub-install --recheck /dev/sda
@thamudi
thamudi / config.yml
Created September 19, 2022 12:39
Fusuma config file
# to run this:
# fusuma -d --config=.config/fusuma/config.yml
swipe:
4:
right:
command: 'xdotool key alt+Right' # History forward
left:
command: 'xdotool key alt+Left' # History back
up:
command: 'xdotool key ctrl+t' # Open new tab
@thamudi
thamudi / switcher.sh
Created September 19, 2022 12:33
Audio Devices switcher, switches by available audio sinks
#!/bin/bash
# This script switches between multiple Pulseaudio output devices/sinks
# Created by Jan Keith Darunday jkcdarunday@gmail.com as the original script didn't work with pipewire
# This uses pactl instead of pacmd since pacmd is not available in pipewire
SINKS=$(pactl list short sinks)
SINK_COUNT=$(echo "$SINKS" | wc -l)
DEFAULT_SINK=$(pactl info | sed -En 's/Default Sink: (.*)/\1/p')
if [ "$DEFAULT_SINK" = "tunnel.serv.local.alsa_output.pci-0000_00_1b.0.analog-stereo" ]; then DEFAULT_SINK_INDEX=$(echo "$SINKS" | grep -n "$DEFAULT_SINK" | grep "tunnel" | egrep -o '^[0-9]+')
else DEFAULT_SINK_INDEX=$(echo "$SINKS" | grep -n "$DEFAULT_SINK" | grep -v "tunnel" | egrep -o '^[0-9]+')fiNEW_SINK_INDEX=$((DEFAULT_SINK_INDEX % $SINK_COUNT + 1))NEW_SINK=$(echo "$SINKS" | sed "${NEW_SINK_INDEX}q;d" | awk '{ print $2 }')
@thamudi
thamudi / iwconfig_power_management.sh
Last active September 19, 2022 12:41
Power management scripts
#!/bin/bash
# Author: thamudi
# profile: https://github.com/thamudi
## You will need iwconfig to run the script
## Keep in mind that wlp4s0 is my wifi interface and you will need to change it with yours accordingly
## You can find out which one is yours by simply running iwconfig
## Use the below script to toggle power saving on