This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import sys | |
import json | |
import subprocess | |
direction=bool(sys.argv[1] == 't' or sys.argv[1] == 'T') | |
swaymsg = subprocess.run(['swaymsg', '-t', 'get_tree'], stdout=subprocess.PIPE) | |
data = json.loads(swaymsg.stdout) | |
current = data["nodes"][1]["current_workspace"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#CODE | |
#Generate root password | |
import random, string | |
password = ''.join(random.choice(string.ascii_letters + string.digits) for i in range(20)) | |
#Download ngrok | |
! wget -q -c -nc https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip | |
! unzip -qq -n ngrok-stable-linux-amd64.zip | |
#Setup sshd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
all_args=("$@") | |
arg1=$1 | |
arg2=$2 | |
arg3="${all_args[@]:2}" | |
case $arg1 in | |
"title") | |
id=$(xdo id -n $arg2) | |
;; | |
"class") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
docker run \ | |
-ti \ | |
--privileged \ | |
--name steam \ | |
-e DISPLAY=$DISPLAY \ | |
-m 2G \ | |
--cpus=3 \ | |
-e PULSE_SERVER=unix:${XDG_RUNTIME_DIR}/pulse/native \ | |
-e STEAM_UID=$UID \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
MONITORS="$(bspc query -M --names)" | |
ARG1="$1" | |
FOCUSED_MONITOR="$(bspc query --names -M -m focused)" | |
for monitr in $MONITORS | |
do | |
FOCUSED="$(bspc query --names -D -d $monitr:focused)" | |
if [[ "$FOCUSED" == "$ARG1" ]]; |
Original post : https://unix.stackexchange.com/a/310699
nmcli con add type wifi ifname wlan0 con-name Hostspot autoconnect yes ssid Hostspot
nmcli con modify Hostspot 802-11-wireless.mode ap 802-11-wireless.band bg ipv4.method shared
nmcli con modify Hostspot wifi-sec.key-mgmt wpa-psk
nmcli con modify Hostspot wifi-sec.psk "veryveryhardpassword1234"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function parse_yaml { | |
local prefix=$2 | |
local s='[[:space:]]*' w='[a-zA-Z0-9_]*' fs=$(echo @|tr @ '\034') | |
sed -ne "s|^\($s\):|\1|" \ | |
-e "s|^\($s\)\($w\)$s:$s[\"']\(.*\)[\"']$s\$|\1$fs\2$fs\3|p" \ | |
-e "s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p" $1 | | |
awk -F$fs '{ | |
indent = length($1)/2; | |
vname[indent] = $2; | |
for (i in vname) {if (i > indent) {delete vname[i]}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bind-key s display-popup -E "bash tmux_fzf.sh" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#`:: ; Next Window | |
WinGetClass, CurrentActive, A | |
WinGet, ActiveProcess, ProcessName, A | |
WinGet, Instances, Count, ahk_exe %ActiveProcess% | |
; MsgBox, %ActiveProcess% %Instances% | |
If Instances > 1 | |
WinSet, Bottom,, A | |
WinActivate, ahk_exe %ActiveProcess% | |
return |
OlderNewer