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
# Config | |
config menuBarIconHidden true | |
# Prefix keys | |
alias POS shift;alt # Prefix for positions | |
alias MOV ctrl;alt # Prefix for movement | |
alias FOC ctrl;cmd # Prefix for Focus window | |
alias MIS ctrl;alt;cmd # Prefix for miscs | |
bind esc:${MIS} relaunch |
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 | |
# Check network | |
[ -f /tmp/old_wan_ip ] || touch /tmp/old_wan_ip | |
timeout 10 ping -c 3 baidu.com > /dev/null 2>&1 | |
if [[ $? != 0 ]]; then | |
echo "Network error" | |
# echo "network error" > /tmp/old_wan_ip | |
exit 0 | |
fi |
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 | |
ARGUMENTS=() | |
function parse() { | |
while [[ $# -gt 0 ]]; do | |
key="$1" | |
case $key in | |
# Parse -a or --argument [value] | |
-a | --argument) | |
shift |
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 | |
LOG_FILE='' | |
RED='\033[0;31m' | |
GREEN='\033[0;32m' | |
YELLOW='\033[0;33m' | |
NORMAL='\033[0m' | |
function logger() { |
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 | |
DOC=""" | |
DESCRIPTION | |
Function for answering yes or no. | |
AEGUMENTS | |
-m, --message {string} message for display | |
-r, --retry {int}(3) times for retry | |
-d, --default {string}<y|n>() default option |
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 | |
# -*- coding: utf-8 -*- | |
# @Date : 20180209 | |
# @Author : xinhangliu <xhliume@gmail.com> | |
# @Version : 1.0.0 | |
def pagination(total, current, lspace, rspace, spacer='...'): | |
res = [] | |
res.append(1) # Append page 1 | |
start = current - lspace |