From 489aeecfdd9d8938669e25961f43df287c4e9bcd Mon Sep 17 00:00:00 2001 From: julian T Date: Sat, 2 Feb 2019 17:23:53 +0100 Subject: Moved to stow --- dwm/.Xmodmap | 5 ++++ dwm/.dwmSession.sh | 20 ++++++++++++++ dwm/.xinitrc | 31 +++++++++++++++++++++ dwm/.zprofile | 3 ++ dwm/lc | 81 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 140 insertions(+) create mode 100644 dwm/.Xmodmap create mode 100755 dwm/.dwmSession.sh create mode 100644 dwm/.xinitrc create mode 100644 dwm/.zprofile create mode 100755 dwm/lc (limited to 'dwm') diff --git a/dwm/.Xmodmap b/dwm/.Xmodmap new file mode 100644 index 0000000..08cf429 --- /dev/null +++ b/dwm/.Xmodmap @@ -0,0 +1,5 @@ +clear lock +clear control +keycode 66 = Control_R +add control = Control_R Control_L + diff --git a/dwm/.dwmSession.sh b/dwm/.dwmSession.sh new file mode 100755 index 0000000..2c427b8 --- /dev/null +++ b/dwm/.dwmSession.sh @@ -0,0 +1,20 @@ +#!/bin/bash +PIDFILE=/home/julian/.dwmSession.pid + +kill `cat $PIDFILE` + +if [ "$1" = "-e" ]; then + exit +fi + +echo $$ > $PIDFILE + +while true; do + + BATT=$( acpi -b | sed 's/.*[charging|unknown], \([0-9]*\)%.*/\1/gi' ) + TIME=$(/bin/date +"%H:%M") + IP=$(hostname -i) + + xsetroot -name "$IP $TIME $BATT%" + sleep 10 +done diff --git a/dwm/.xinitrc b/dwm/.xinitrc new file mode 100644 index 0000000..711303f --- /dev/null +++ b/dwm/.xinitrc @@ -0,0 +1,31 @@ +setxkbmap -layout us -variant altgr-intl +feh --bg-fill /home/julian/Pictures/up1.* +export _JAVA_AWT_WM_NONREPARENTING=1 +export TERM=st + +dbus-update-activation-environment --systemd DISPLAY + +eval $(/usr/bin/gnome-keyring-daemon --start --components=pkcs11,secrets) +export SSH_AUTH_SOCK + +xmodmap .Xmodmap +xcape -e "Control_R=Escape" + +nm-applet & +xscreensaver & +xss-lock -- xscreensaver-command --lock & +dunst & + +if ! pgrep -u "$USER" ssh-agent > /dev/null; then + ssh-agent > ~/.ssh-agent-thing +fi +if [[ "$SSH_AGENT_PID" == "" ]]; then + eval "$(<~/.ssh-agent-thing)" +fi + +while true; do + dwm +done & + + +exec sh /home/julian/.dwmSession.sh diff --git a/dwm/.zprofile b/dwm/.zprofile new file mode 100644 index 0000000..b78f84a --- /dev/null +++ b/dwm/.zprofile @@ -0,0 +1,3 @@ +if [[ ! $DISPLAY && $XDG_VTNR -eq 1 ]]; then + exec startx +fi diff --git a/dwm/lc b/dwm/lc new file mode 100755 index 0000000..9691d45 --- /dev/null +++ b/dwm/lc @@ -0,0 +1,81 @@ +#!/bin/bash + +Menu="Program Info System File" +System="update poweroff syspend set-keyboard" +Info="battery" +Program="cups-website vim emacs htop" +Commonfiles=".vimrc .zshrc" +All="$System $Info $Program" + +handle_stuff() { + +# Dmemu listing + if [ "$1" = "--list" ]; then + printf "Program\nInfo\nSystem" + fi + if [ "$1" = "--dmenu" ]; then + ./lc $(echo $Menu $All | tr " " "\n" | dmenu -i -p Launch) + fi + if [ "$1" = "System" ]; then + ./lc $(echo $System | tr " " "\n" | dmenu -i -p Launch) + fi + if [ "$1" = "Info" ]; then + ./lc $(echo $Info | tr " " "\n" | dmenu -i -p Launch) + fi + if [ "$1" = "Program" ]; then + ./lc $(echo $Program | tr " " "\n" | dmenu -i -p Launch) + fi + if [ "$1" = "File" ]; then + st -e nvim $(echo $Commonfiles | tr " " "\n" | dmenu -i -p Launch) + fi + +# System info + if [ "$1" = "-b" ] || [ "$1" = "battery" ]; then + notify-send "Battery information" "$(acpi | grep 1:)" + fi + +# System maintenance + if [ "$1" = "-u" ] || [ "$1" = "update" ]; then + st -e sudo pacman -Syu + fi + if [ "$1" = "--xk" ] || [ "$1" = "set-keyboard" ]; then + setxkbmap -layout us -variant altgr-intl + xmodmap .Xmodmap + fi + +# POWER COMMANDS + if [ "$1" = "-s" ] || [ "$1" = "suspend" ]; then + systemctl suspend + fi + if [ "$1" = "-p" ] || [ "$1" = "poweroff" ]; then + poweroff + fi + +# Mics + +# Launch + if [ "$1" = "-v" ] || [ "$1" = "vim" ]; then + st -e nvim + fi + if [ "$1" = "--emacs" ] || [ "$1" = "emacs" ]; then + st -e emacs + fi + if [ "$1" = "--ht" ] || [ "$1" = "htop" ]; then + st -e htop + fi + if [ "$1" = "--cups" ] || [ "$1" = "cups-website" ]; then + firefox "http://localhost:631/" + fi + +# Calc + if [ "$(echo $1 | head -c 1)" = "=" ]; then + calc="$(echo $1 | cut -c 2-)" + notify-send "Result" "$calc = $(echo $calc | bc)" + fi +} + + +for var in "$@" +do + handle_stuff "$var" & +done -- cgit v1.2.3