Skip to content

Instantly share code, notes, and snippets.

View nwg-piotr's full-sized avatar
🏠
~/, sweet ~/

Piotr Miller nwg-piotr

🏠
~/, sweet ~/
View GitHub Profile
@nwg-piotr
nwg-piotr / nsort.py
Last active May 7, 2019 07:58
Python script to sorts the `names.txt` file containing lines like `Name Surname` alphabetically by Surname and write the result to the `names_sorted.txt` file.
#!/usr/bin/env python
# _*_ coding: utf-8 _*_
"""
This script sorts the `names.txt` file containing lines like `Name Surname` alphabetically by Surname
and writes result to the `names_sorted.txt` file.
"""
import sys
@nwg-piotr
nwg-piotr / obhud-keybindings-rc.xml
Last active June 11, 2018 22:32
Insert this xml into the <keyboard></keyboard> section of your rc.xml file.
<keybind key="XF86MonBrightnessDown">
<action name="Execute">
<command>obhud --brightness down</command>
</action>
</keybind>
<keybind key="XF86MonBrightnessUp">
<action name="Execute">
<command>obhud --brightness up</command>
</action>
</keybind>
@nwg-piotr
nwg-piotr / au.sh
Last active May 31, 2018 12:34
This is to add Arch Linux updates notification to your tint2 panel. Download the bash scipt and icon from https://drive.google.com/open?id=1aW7C23aUQSkcfP5RRh4hC5SEAlta26-T and unpack to your home folder. Finally add the tint2rc Executor to your ~/.config/tint2/tint2rc file. Replace `xfce4-terminal` with your favorite terminal name.
#!/bin/bash
# How to modify to use various AUR helpers:
# EITHER check regular repos, then AUR with trizen:
upd=$(/bin/sh -c "/usr/bin/checkupdates && /usr/bin/trizen -Qqu -a")
# or with yaourt:
#upd=$(/bin/sh -c "(/usr/bin/checkupdates; /usr/bin/yaourt -Qu -a | cut -c 5-) | sort -u -t' ' -k1,1")
# or pacaur:
#upd=$(/bin/sh -c "/usr/bin/checkupdates && /usr/bin/pacaur -Qqu -a")
# or aurman:
#upd=$(/bin/sh -c "/usr/bin/checkupdates && /usr/bin/aurman -Qqu")