Skip to content

Instantly share code, notes, and snippets.

@mekb-turtle
mekb-turtle / power
Last active September 8, 2023 02:45
rofi power menu script
#!/bin/bash
RES="$(rofi -dmenu -p "Power" <<< $'Shutdown\nRestart\nLog Out\nLock')"
if [[ "$RES" == "Shutdown" ]]; then /usr/local/sbin/do shutdown & disown; fi
if [[ "$RES" == "Restart" ]]; then /usr/local/sbin/do restart & disown; fi
if [[ "$RES" == "Log Out" ]]; then hyprctl dispatch exit; fi
if [[ "$RES" == "Lock" ]]; then swaylock; fi
#if [[ "$RES" == "Suspend" ]]; then swaylock & /usr/local/sbin/do suspend1 & disown; fi
@CIAvash
CIAvash / switch_sink.sh
Created June 11, 2021 12:17
Select/Switch Pulse/Pipewire audio sink/device/node with `rofi` and `pactl`
#!/usr/bin/env bash
all_sinks=$(pactl list short sinks | cut -f 2)
default_sink=$(pactl info | grep 'Default Sink' | cut -d : -f 2)
active_sink=$(echo "$all_sinks" | grep -n $default_sink | cut -d : -f 1)
selected_sink=$(echo "$all_sinks" | rofi -dmenu -i -a $(($active_sink - 1)) -p 'Select a device: ')
@bkaradzic
bkaradzic / orthodoxc++.md
Last active July 5, 2024 10:46
Orthodox C++

Orthodox C++

What is Orthodox C++?

Orthodox C++ (sometimes referred as C+) is minimal subset of C++ that improves C, but avoids all unnecessary things from so called Modern C++. It's exactly opposite of what Modern C++ suppose to be.

Why not Modern C++?

@makeittotop
makeittotop / htop.usage
Created May 6, 2015 12:44
htop explanation
System wide cpu usage:
The numbers on the top left from 1 to 8 represents the number of cpu's/cores in my system with the progress bar next to them representing the load of cpu/core. As you would have noticed the progress bars can be comprised of different colors. The following list will explain what each color means.
Blue: low priority processes (nice > 0)
Green: normal (user) processes
Red: kernel processes
Yellow: IRQ time
Magenta: Soft IRQ time
Grey: IO Wait time