Compare commits
2 commits
d33493e7ed
...
95dada6c38
Author | SHA1 | Date | |
---|---|---|---|
95dada6c38 | |||
9550260b13 |
12 changed files with 6 additions and 124 deletions
4
_bashrc
4
_bashrc
|
@ -24,6 +24,10 @@ mkcd() {
|
|||
cd "$1"
|
||||
}
|
||||
|
||||
if [ "$PREFERRED_SHELL" = zsh ] && command -v ls > /dev/null; then
|
||||
exec zsh
|
||||
fi
|
||||
|
||||
export PS1="
|
||||
$(tput bold)$(tput setaf 1)[$(tput setaf 3)\u$(tput setaf 2)@$(tput setaf 4)\H $(tput setaf 5)\w$(tput setaf 1)]$(tput setaf 7)
|
||||
$ $(tput sgr0)"
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
# select a command with dmenu_run but run it in the terminal emulator
|
||||
|
||||
command=$(dmenu_path | dmenu "$@")
|
||||
[[ $command != "" ]] && exec urxvt -e $command
|
|
@ -1,19 +0,0 @@
|
|||
#!/usr/bin/python
|
||||
|
||||
import sys
|
||||
import re
|
||||
import string
|
||||
|
||||
alphabet = "0" + string.ascii_lowercase
|
||||
goodRe = re.compile("^[0a-z]*$")
|
||||
|
||||
for s in [s.lower() for s in sys.argv[1:]]:
|
||||
if not goodRe.match(s):
|
||||
print(f"failed to decode {s}: wrong format", file=sys.stderr)
|
||||
continue
|
||||
result = 0
|
||||
for c in s:
|
||||
result *= 26
|
||||
result += alphabet.index(c)
|
||||
print(f"{s} = {result-1}")
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
python ~/Documents/fi_fos $@
|
|
@ -1,6 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
bg_file=/tmp/$(dd if=/dev/urandom bs=8 count=1 2> /dev/null | base32).png
|
||||
scrot $bg_file -q 30
|
||||
convert $bg_file -blur 8x8 $bg_file
|
||||
exec i3lock -i $bg_file
|
|
@ -1,22 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
case $1 in
|
||||
same)
|
||||
xrandr --output VGA-1 --same-as LVDS-1
|
||||
;;
|
||||
right)
|
||||
xrandr --output VGA-1 --right-of LVDS-1
|
||||
;;
|
||||
left)
|
||||
xrandr --output VGA-1 --left-of LVDS-1
|
||||
;;
|
||||
*)
|
||||
echo $0 "same|right|left"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
#!/usr/bin/python
|
||||
|
||||
# runs dmenu with the first value of $@ as promt, each even value of $@ as option and the following odd value as command for that option
|
||||
# for example $ ./multipromt "Power Button Pressed?" "Shutdown" "sudo shutdown now" "Reboot" "sudo reboot now" "Exit I3wm" "i3-msg exit"
|
||||
|
||||
import subprocess
|
||||
from sys import argv
|
||||
|
||||
def pairs(iterable):
|
||||
return zip(iterable[::2], iterable[1::2])
|
||||
|
||||
def demnu_select(options, promt=""):
|
||||
return subprocess.run(["dmenu", "-p", promt], stdout=subprocess.PIPE, input="\n".join(options).encode("UTF-8")).stdout.decode().strip()
|
||||
|
||||
def main():
|
||||
cmds = dict(pairs(["Abort", ""] + argv[2:]))
|
||||
selected = demnu_select(cmds, argv[1])
|
||||
cmd = cmds.get(selected, "").split()
|
||||
if len(cmd) > 0:
|
||||
subprocess.run(cmd)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
cd ~/.programs/processing
|
||||
|
||||
./processing
|
|
@ -1,11 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Use dmenu to promt no or yes with $1 as promt. If the use clickes yes run $2"
|
||||
# example: promt "Shutdown?" "sudo shutdown now"
|
||||
|
||||
posRep="Yes"
|
||||
negRep="No"
|
||||
choosen=$(echo -e "$negRep\n$posRep" | dmenu -p "$1")
|
||||
|
||||
[[ "$choosen" == "$posRep" ]] && $2
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
#!/bin/bash
|
||||
# i3 thread: https://faq.i3wm.org/question/150/how-to-launch-a-terminal-from-here/?answer=152#post-id-152
|
||||
|
||||
CMD=$TERMINAL
|
||||
CWD=''
|
||||
|
||||
# Get window ID
|
||||
ID=$(xdpyinfo | grep focus | cut -f4 -d " ")
|
||||
|
||||
# Get PID of process whose window this is
|
||||
PID=$(xprop -id $ID | grep -m 1 PID | cut -d " " -f 3)
|
||||
|
||||
# Get last child process (shell, vim, etc)
|
||||
if [ -n "$PID" ]; then
|
||||
TREE=$(pstree -lpA $PID | tail -n 1)
|
||||
PID=$(echo $TREE | awk -F'---' '{print $NF}' | sed -re 's/[^0-9]//g')
|
||||
|
||||
# If we find the working directory, run the command in that directory
|
||||
if [ -e "/proc/$PID/cwd" ]; then
|
||||
CWD=$(readlink /proc/$PID/cwd)
|
||||
fi
|
||||
fi
|
||||
if [ -n "$CWD" ]; then
|
||||
cd $CWD && $CMD
|
||||
else
|
||||
$CMD
|
||||
fi
|
||||
|
1
_zshrc
1
_zshrc
|
@ -30,6 +30,7 @@ function zle-keymap-select {
|
|||
}
|
||||
zle -N zle-keymap-select
|
||||
|
||||
unset PREFERRED_SHELL
|
||||
[ -f "$HOME/./config/bashrc" ] && emulate sh -c "source $HOME/./config/bashrc"
|
||||
[ -f "$HOME/.bashrc" ] && emulate sh -c "source $HOME/.bashrc"
|
||||
|
||||
|
|
|
@ -114,6 +114,7 @@
|
|||
# Environment variables only for this user/session
|
||||
home.sessionVariables = {
|
||||
EDITOR = "nvim";
|
||||
PREFERRED_SHELL = "zsh";
|
||||
};
|
||||
|
||||
# Good HM hygiene
|
||||
|
|
Loading…
Add table
Reference in a new issue