From a74492efd1213ae36aef997c743501c40f261909 Mon Sep 17 00:00:00 2001 From: Akshay Date: Sun, 4 Oct 2020 14:41:25 +0530 Subject: add git aliases --- scripts/scripts/bar.sh | 75 ----------------------------------------- scripts/scripts/bluetooth.sh | 14 -------- scripts/scripts/blur.sh | 25 -------------- scripts/scripts/cmusnp.sh | 45 ------------------------- scripts/scripts/date.sh | 4 --- scripts/scripts/draw.sh | 11 ------ scripts/scripts/git-new-repo | 6 ++++ scripts/scripts/git-set-desc | 11 ++++++ scripts/scripts/hidebars.sh | 23 ------------- scripts/scripts/img.sh | 32 ------------------ scripts/scripts/netwrk.sh | 10 ------ scripts/scripts/playpause.sh | 17 ---------- scripts/scripts/popups/cover.sh | 14 -------- scripts/scripts/restartbars.sh | 6 ---- scripts/scripts/time.sh | 6 ---- scripts/scripts/url.sh | 4 --- scripts/scripts/wscycle.sh | 30 ----------------- tmux/.tmux.conf | 7 ++-- weechat/.weechat/weechat.conf | 38 +++++++++------------ 19 files changed, 36 insertions(+), 342 deletions(-) delete mode 100755 scripts/scripts/bar.sh delete mode 100755 scripts/scripts/bluetooth.sh delete mode 100755 scripts/scripts/blur.sh delete mode 100755 scripts/scripts/cmusnp.sh delete mode 100755 scripts/scripts/date.sh delete mode 100755 scripts/scripts/draw.sh create mode 100755 scripts/scripts/git-new-repo create mode 100755 scripts/scripts/git-set-desc delete mode 100755 scripts/scripts/hidebars.sh delete mode 100755 scripts/scripts/img.sh delete mode 100755 scripts/scripts/netwrk.sh delete mode 100755 scripts/scripts/playpause.sh delete mode 100755 scripts/scripts/popups/cover.sh delete mode 100755 scripts/scripts/restartbars.sh delete mode 100755 scripts/scripts/time.sh delete mode 100755 scripts/scripts/url.sh delete mode 100755 scripts/scripts/wscycle.sh diff --git a/scripts/scripts/bar.sh b/scripts/scripts/bar.sh deleted file mode 100755 index 1903462..0000000 --- a/scripts/scripts/bar.sh +++ /dev/null @@ -1,75 +0,0 @@ -#! /usr/bin/env bash - - -fg="$(get_xres color15)" -fg_light="$(get_xres color10)" -bg="$(get_xres color0)" -# %{F$fg} $(date +%d/%m) %{F$fg_light} $(date +%Y) - -(while true; do echo -e "\n$(date +%H)\n$(date +%M)\n"; sleep 10; done) | dzen2 \ - -e "onstart=uncollapse;" \ - -fg "$fg" \ - -bg "$fg_light" \ - -tw 0 \ - -l 3 \ - -x 20 \ - -y 600 \ - -w 70 \ - -h 30 \ - -sa c \ - -p & - -(echo -e "\n"; while true; do echo -e "$(bat -i)"; sleep 1; done )| dzen2 \ - -e "onstart=uncollapse;" \ - -fg "$fg" \ - -bg "$fg_light" \ - -tw 70 \ - -l 4 \ - -x 20 \ - -y 500 \ - -w 70 \ - -h 15 \ - -sa c \ - -p & - -ws=$( xprop -root _NET_CURRENT_DESKTOP | sed -e 's/_NET_CURRENT_DESKTOP(CARDINAL) = //' ) - -# colors -current="$( ~/scripts/get_xres color5 )" -occupied="$( ~/scripts/get_xres color8 )" -unoccupied="$( ~/scripts/get_xres color8 )" - -# print workspaces to stdout -draw() { - for i in {0..5}; do - # get the number of windows in each workspace - windows=$( wmctrl -l | cut -d ' ' -f3 | grep $i | wc -l ) - - - if [[ $i -eq $ws ]] - then - # current workspace - echo -ne "^($current)O" - else - if [[ $windows -eq 0 ]] - then - echo -ne "^($unoccupied)o" - else - echo -ne "^($occupied)x" - fi - fi - done -} - -# echo -e "\n\n$(draw)\n" | dzen2 \ -# -e "onstart=uncollapse;" \ -# -fg "$fg" \ -# -bg "$fg_light" \ -# -tw 70 \ -# -l 4 \ -# -x 20 \ -# -y 500 \ -# -w 70 \ -# -h 15 \ -# -sa c \ -# -p & diff --git a/scripts/scripts/bluetooth.sh b/scripts/scripts/bluetooth.sh deleted file mode 100755 index 85b7f08..0000000 --- a/scripts/scripts/bluetooth.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env bash - -connections=$( hcitool con ) -devices=$( hcitool dev | wc -l ) - -if [ $devices = 1 ] -then - echo -n "" -elif [[ $devices > 1 && $connections = "Connections:" ]] -then - echo -n "" -else - echo -n "" -fi diff --git a/scripts/scripts/blur.sh b/scripts/scripts/blur.sh deleted file mode 100755 index 9349b03..0000000 --- a/scripts/scripts/blur.sh +++ /dev/null @@ -1,25 +0,0 @@ -#! /usr/bin/env bash - -state="unblurred" -while :; do - current_workspace="$(xprop -root _NET_CURRENT_DESKTOP | awk '{print $3}')" - if [[ -n "$current_workspace" ]]; then - num_windows="$(echo "$(wmctrl -l)" | awk -F" " '{print $2}' | grep ^$current_workspace)" - if [ -n "$num_windows" ]; then - if [ "$state" != "blurred" ]; then - for i in {0..6}; do - feh --bg-fill ~/pics/blurs/busy"$i".jpg - done - fi - state="blurred" - else - if [ "$state" != "unblurred" ]; then - for i in $(seq 5 -1 0); do - feh --bg-fill ~/pics/blurs/busy"$i".jpg - done - feh --bg-fill ~/pics/blurs/busy.jpg - fi - state="unblurred" - fi - fi -done diff --git a/scripts/scripts/cmusnp.sh b/scripts/scripts/cmusnp.sh deleted file mode 100755 index b43c7e8..0000000 --- a/scripts/scripts/cmusnp.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env bash -# Display currently playing song from cmus -# Requires cmus - -# colors -active="$( ~/scripts/get_xres color7 )" -inactive="$( ~/scripts/get_xres color7 )" - -np_string="" - -trunc() { - max_length=$1 - text=$2 - length=${#text} - (( length > max_length )) && - text=${text::$(( max_length ))}... - echo "$text" -} - -if pgrep -x "cmus" > /dev/null -then - status=$( cmus-remote -Q | grep status\ | sed 's/status //' ) - artist=$( cmus-remote -Q | grep tag\ artist\ | sed 's/tag artist //' ) - title=$( cmus-remote -Q | grep tag\ title\ | sed 's/tag title //' ) - - np_string="$title - $artist" - np_string=$( trunc 35 "$np_string" ) - - spc=$(( $(( 32 - ${#np_string} ))/2 )) - spc="$( printf "%${spc}s" )" - - if [[ "$status" = *playing* ]] - then - echo -ne "%{F#FF0000}%{F#FFFFFF}PAUSE" - elif [[ "$status" = *paused* ]] - then - echo -ne "PLAY" - elif [[ "$status" = *stopped* ]] - then - echo -ne "START" - fi - -else - echo -fi diff --git a/scripts/scripts/date.sh b/scripts/scripts/date.sh deleted file mode 100755 index f97bdc9..0000000 --- a/scripts/scripts/date.sh +++ /dev/null @@ -1,4 +0,0 @@ -#! /usr/bin/env bash - -month="$(date +%B)" -printf "%s $(date +%e) $(date +%Y)" "${month^^}" diff --git a/scripts/scripts/draw.sh b/scripts/scripts/draw.sh deleted file mode 100755 index 8e34904..0000000 --- a/scripts/scripts/draw.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash -# Spawn terminals interactively -# Requires slop, urxvt - -read -r X Y W H < <(slop -f "%x %y %w %h" -b 4 -c 0.8,0.8,0.8,0.8 -t 0 ) -(( W /= 14 )) -(( H /= 25 )) - -g=${W}x${H}+${X}+${Y} - -urxvtc -geometry $g diff --git a/scripts/scripts/git-new-repo b/scripts/scripts/git-new-repo new file mode 100755 index 0000000..9d87310 --- /dev/null +++ b/scripts/scripts/git-new-repo @@ -0,0 +1,6 @@ +#! /usr/bin/env bash + +repo=${1:-$(basename $(pwd)).git}; +ssh git@ferrn git init --bare "$repo"; +git remote add origin git@ferrn:"$repo"; +git push -u origin HEAD; diff --git a/scripts/scripts/git-set-desc b/scripts/scripts/git-set-desc new file mode 100755 index 0000000..08568fe --- /dev/null +++ b/scripts/scripts/git-set-desc @@ -0,0 +1,11 @@ +#! /usr/bin/env bash + +set_desc() { + # $1 - desc + # $2 - repo name + [[ -d "$2" ]] && echo "$1" > "$2/description" || echo "$2: remote not found" +} + +repo=${1:-$(basename $(pwd))}; +desc=$(cat "./.git/description") +ssh git@ferrn "$(typeset -f set_desc); set_desc \"$desc\" \"$repo\"" diff --git a/scripts/scripts/hidebars.sh b/scripts/scripts/hidebars.sh deleted file mode 100755 index 6f449d6..0000000 --- a/scripts/scripts/hidebars.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env bash - -pkill n30f -while getopts hs options -do - case $options in - h) # hide - pkill -f polybar\ artist - pkill -f polybar\ track - pkill -f polybar\ album - ;; - s) # show - if pgrep -f polybar\ artist > /dev/null; then - ~/scripts/popups/cover.sh - else - polybar artist & - polybar track & - polybar album & - ~/scripts/popups/cover.sh - fi - ;; - esac -done diff --git a/scripts/scripts/img.sh b/scripts/scripts/img.sh deleted file mode 100755 index baea386..0000000 --- a/scripts/scripts/img.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash - -# z3bra -- 2014-01-21 -# http://blog.z3bra.org/2014/01/images-in-terminal.html - -test -z "$1" && exit - -W3MIMGDISPLAY="/usr/lib/w3m/w3mimgdisplay" -FILENAME=$1 -FONTH=14 # Size of one terminal row -FONTW=8 # Size of one terminal column -COLUMNS=`tput cols` -LINES=`tput lines` - -read width height <<< `echo -e "5;$FILENAME" | $W3MIMGDISPLAY` - -max_width=$(($FONTW * $COLUMNS)) -max_height=$(($FONTH * $(($LINES - 2)))) # substract one line for prompt - -if test $width -gt $max_width; then -height=$(($height * $max_width / $width)) -width=$max_width -fi -if test $height -gt $max_height; then -width=$(($width * $max_height / $height)) -height=$max_height -fi - -w3m_command="0;1;0;0;$width;$height;;;;;$FILENAME\n4;\n3;" - -tput cup $(($height/$FONTH)) 0 -echo -e $w3m_command|$W3MIMGDISPLAY diff --git a/scripts/scripts/netwrk.sh b/scripts/scripts/netwrk.sh deleted file mode 100755 index 4fec3a5..0000000 --- a/scripts/scripts/netwrk.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -status=$( nmcli | sed -n 1p | awk '{print $2}' ) - -if [ $status = "connected" ] -then - echo -n '' -else - echo -n '' -fi diff --git a/scripts/scripts/playpause.sh b/scripts/scripts/playpause.sh deleted file mode 100755 index 72ba0fb..0000000 --- a/scripts/scripts/playpause.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -# Interactive polybar icon for music controls -# Requires cmus - -if pgrep -x "cmus" > /dev/null -then - status=$( cmus-remote -Q | grep status\ | sed 's/status //' ) - if [[ "$status" == *playing* ]]; then - echo -ne " %{F$(get_xres color2)} " - elif [[ "$status" == *paused* ]]; then - echo -ne " %{F$(get_xres color2)} " - elif [[ "$status" == *stopped* ]]; then - echo -ne " %{F$(get_xres color2)} " - fi -else - echo -ne "  " -fi diff --git a/scripts/scripts/popups/cover.sh b/scripts/scripts/popups/cover.sh deleted file mode 100755 index 356e5ba..0000000 --- a/scripts/scripts/popups/cover.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env bash - -folder=$( cmus-remote -Q | grep -w file | sed 's/file //' ) -cover=${folder%/*}/cover.png - -convert "$cover" -resize 200x200 ~/tmp/cover.png - -if pgrep n30f > /dev/null -then - pkill n30f - n30f -x 20 -y 700 ~/tmp/cover.png -c "hidebars.sh -h" -d -else - n30f -x 20 -y 700 ~/tmp/cover.png -c "hidebars.sh -h" -d -fi diff --git a/scripts/scripts/restartbars.sh b/scripts/scripts/restartbars.sh deleted file mode 100755 index 44d339f..0000000 --- a/scripts/scripts/restartbars.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env bash - -pkill polybar -polybar time & -polybar date & -polybar music & diff --git a/scripts/scripts/time.sh b/scripts/scripts/time.sh deleted file mode 100755 index 66b0fbe..0000000 --- a/scripts/scripts/time.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env bash - -fg="$(get_xres color15)" -fg_light="$(get_xres color8)" -# %{F$fg} $(date +%d/%m) %{F$fg_light} $(date +%Y) -echo -ne "$(date +%p) $(date +%I:%M)" diff --git a/scripts/scripts/url.sh b/scripts/scripts/url.sh deleted file mode 100755 index 6b3264d..0000000 --- a/scripts/scripts/url.sh +++ /dev/null @@ -1,4 +0,0 @@ -#! /usr/bin/env bash - -echo "$1" | xclip -i -echo "$1" | xclip -sel c diff --git a/scripts/scripts/wscycle.sh b/scripts/scripts/wscycle.sh deleted file mode 100755 index 7ea608d..0000000 --- a/scripts/scripts/wscycle.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env bash -# cycle through workspaces - -# get the current ws -ws=$( xprop -root _NET_CURRENT_DESKTOP | sed -e 's/_NET_CURRENT_DESKTOP(CARDINAL) = //' ) -total=5 - -while getopts fr options -do - case $options in - f) - if [[ $ws -eq $total ]] - then - wmctrl -s 0 - else - ws=$(( $ws + 1 )) - wmctrl -s $ws - fi - ;; - r) - if [[ $ws -eq 0 ]] - then - wmctrl -s $total - else - ws=$(( $ws - 1 )) - wmctrl -s $ws - fi - ;; - esac -done diff --git a/tmux/.tmux.conf b/tmux/.tmux.conf index 81b7c91..d52c29d 100644 --- a/tmux/.tmux.conf +++ b/tmux/.tmux.conf @@ -28,8 +28,6 @@ bind-key ) swap-window -t +1 bind-key ( swap-window -t -1 bind-key [ copy-mode -bind-key u capture-pane \; save-buffer /tmp/tmux-buffer \; new-window -n "urlview" '$SHELL -c "urlview < /tmp/tmux-buffer"' - # statusline hide / unhide bind -n M-down set -q status off bind -n M-up set -q status on @@ -53,8 +51,9 @@ set -g status-right "" set -g status-style "bg=colour0" set -ag status-style "fg=colour7" -set -g window-status-current-format " #[fg=colour15]#W#{?window_zoomed_flag, #[fg=colour2]+,}" -set -g window-status-format " #[fg=colour8]#W#{?window_zoomed_flag, #[fg=colour2]+,}" +set -g window-status-current-format " #[fg=colour15]#W#{?window_zoomed_flag, #[fg=colour2]+,}#{?window_activity_flag, #[fg=colour3]!,}" +set -g window-status-format " #[fg=colour8]#W#{?window_zoomed_flag, #[fg=colour2]+,}" + set -g status-left-length 100 set -g status-left "#[fg=colour15]#(date +"%H%M") #[fg=colour8]hrs " diff --git a/weechat/.weechat/weechat.conf b/weechat/.weechat/weechat.conf index bfb13ad..b5445c3 100644 --- a/weechat/.weechat/weechat.conf +++ b/weechat/.weechat/weechat.conf @@ -381,28 +381,22 @@ title.type = window [layout] default.buffer = "core;weechat;1" -default.buffer = "fset;fset;2" -default.buffer = "perl;highmon;3" -default.buffer = "irc;server.freenode;4" -default.buffer = "irc;freenode.#cachix;5" -default.buffer = "irc;freenode.#git;6" -default.buffer = "irc;freenode.#guile;7" -default.buffer = "irc;freenode.#haskell;8" -default.buffer = "irc;freenode.#india;9" -default.buffer = "irc;freenode.#lobsters;10" -default.buffer = "irc;freenode.#neovim;11" -default.buffer = "irc;freenode.#nixers_net;12" -default.buffer = "irc;freenode.#nixos;13" -default.buffer = "irc;freenode.#nixos-nur;14" -default.buffer = "irc;freenode.##rust;15" -default.buffer = "irc;freenode.#scheme;16" -default.buffer = "irc;freenode.#vim;17" -default.buffer = "irc;server.rizon;18" -default.buffer = "irc;rizon.#code;19" -default.buffer = "irc;rizon.#crimson;20" -default.buffer = "irc;rizon.#rice;21" -default.buffer = "irc;rizon.#warez;22" -default.window = "1;0;0;0;fset;fset" +default.buffer = "perl;highmon;2" +default.buffer = "irc;server.freenode;3" +default.buffer = "irc;freenode.#git;4" +default.buffer = "irc;freenode.#guile;5" +default.buffer = "irc;freenode.#haskell;6" +default.buffer = "irc;freenode.#home-manager;7" +default.buffer = "irc;freenode.#nixers_net;8" +default.buffer = "irc;freenode.#nixos;9" +default.buffer = "irc;freenode.##rust;10" +default.buffer = "irc;freenode.#vim;11" +default.buffer = "irc;server.rizon;12" +default.buffer = "irc;rizon.#code;13" +default.buffer = "irc;rizon.#crimson;14" +default.buffer = "irc;rizon.#rice;15" +default.buffer = "irc;rizon.#warez;16" +default.window = "1;0;0;0;irc;rizon.#code" default.current = on _zoom.window = "1;0;0;0;fset;fset" -- cgit v1.2.3