Skip to content

Commit

Permalink
misc
Browse files Browse the repository at this point in the history
  • Loading branch information
neeasade committed Jun 13, 2018
1 parent 7d4d10e commit a2470a0
Show file tree
Hide file tree
Showing 12 changed files with 65 additions and 38 deletions.
18 changes: 12 additions & 6 deletions bin/bin/music
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -99,15 +99,21 @@ playlist() {


info() { info() {
name="$(mpc -f '%title% - %artist%' | head -n 1)" name="$(mpc -f '%title% - %artist%' | head -n 1)"
[ "$name" = ' - ' ] && name="$(basename "$(mpc -f '%file%' | head -n 1)")" if [ "$name" = ' - ' ]; then
name="$(basename "$(mpc -f '%file%' | head -n 1)")"
name="${name%.*}"
fi
playlist_info="$(echo playlist: $(cat ~/Music/playlist/current)$(playlist_length))"


length="$(wc -c <<< "$name")" length="$(wc -L <<< "$name")"
percent="$(mpc | awk 'match($0,/([0-9]+)%/, groups) {print groups[1]}')" percent="$(mpc | awk 'match($0,/([0-9]+)%/, groups) {print groups[1]}')"
progress="$("$HOME/.wm/panel/tools/mkb" $percent $length ◼ ◻ ◼)"


echo "$name" cat<<EOF
"$HOME/.wm/panel/tools/mkb" $percent $length ◼ ◻ ◼ $name
echo playlist: $(cat ~/Music/playlist/current) $progress
echo playlist length: $(playlist_length) $playlist_info
EOF
} }


op=${1:-toggle} op=${1:-toggle}
Expand Down
30 changes: 17 additions & 13 deletions bin/bin/qb_command
Original file line number Original file line Diff line number Diff line change
@@ -1,13 +1,17 @@
#!/bin/sh #!/bin/sh
# ($_url is any command) # ($_url is any command)


_qb_version='1.0.4' _qb_version='1.0.4'
_proto_version=1 _proto_version=1
_ipc_socket="${XDG_RUNTIME_DIR}/qutebrowser/ipc-$(echo -n "$USER" | md5sum | cut -d' ' -f1)" _ipc_socket="${XDG_RUNTIME_DIR}/qutebrowser/ipc-$(echo -n "$USER" | md5sum | cut -d' ' -f1)"
_url="$@" _url="$@"


printf '{"args": ["%s"], "target_arg": null, "version": "%s", "protocol_version": %d, "cwd": "%s"}\n' \
"${_url}" \ bspc config ignore_ewmh_focus true
"${_qb_version}" \ printf '{"args": ["%s"], "target_arg": null, "version": "%s", "protocol_version": %d, "cwd": "%s"}\n' \
"${_proto_version}" \ "${_url}" \
"${PWD}" | socat - UNIX-CONNECT:"${_ipc_socket}" "${_qb_version}" \
"${_proto_version}" \
"${PWD}" | socat - UNIX-CONNECT:"${_ipc_socket}"

bspc config ignore_ewmh_focus false
16 changes: 14 additions & 2 deletions shell/.sh.d/functions
Original file line number Original file line Diff line number Diff line change
@@ -1,5 +1,13 @@
# -*- mode: sh -*- # -*- mode: sh -*-


sysinfo() {
clear
ufetch
music info
pcs() { for i in {0..7}; do echo -en "\e[${1}$((30+$i))m \u2588\u2588 \e[0m"; done; }
printf "\n%s\n%s\n\n" "$(pcs)" "$(pcs '1;')"
}

shot_location() { shot_location() {
mkdir -p $HOME/Screenshots mkdir -p $HOME/Screenshots
echo "$HOME/Screenshots/$(date +%y-%m-%d-%H:%M:%S).png" echo "$HOME/Screenshots/$(date +%y-%m-%d-%H:%M:%S).png"
Expand All @@ -15,8 +23,12 @@ fullshot() {
maim "$(shot_location)" maim "$(shot_location)"
} }


lastshot() {
echo "$HOME/Screenshots/$(ls $HOME/Screenshots | tail -n 1)"
}

upshot() { upshot() {
uguush -o 0x0 -u "$(echo $HOME/Screenshots/$(ls $HOME/Screenshots | tail -n 1))" uguush -o 0x0 -u "$(lastshot)"
} }


# current monitor only - bspwm specific # current monitor only - bspwm specific
Expand Down Expand Up @@ -168,5 +180,5 @@ dotadd() {
} }


book() { book() {
google-chrome-stable "$(cat ~/.book_url)" google-chrome-stable "$(cat ~/.book_url)" &
} }
2 changes: 2 additions & 0 deletions shell/.zshrc
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ done


# match escape to evil # match escape to evil
bindkey fd vi-cmd-mode bindkey fd vi-cmd-mode
bindkey -M visual fd vi-cmd-mode
bindkey -M viopp fd vi-cmd-mode


# match some standard readline binds in insert mode # match some standard readline binds in insert mode
bindkey '^P' up-history bindkey '^P' up-history
Expand Down
2 changes: 1 addition & 1 deletion templates/bspwm
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ bspc config focused_border_color "#{{b_focused_border_color}}"
bspc config presel_feedback_color "#{{b_presel_feedback_color}}" bspc config presel_feedback_color "#{{b_presel_feedback_color}}"


bspc config focus_follows_pointer true bspc config focus_follows_pointer true
bspc config ignore_ewmh_focus true bspc config ignore_ewmh_focus false
bspc config remove_unplugged_monitors true bspc config remove_unplugged_monitors true
bspc config remove_disabled_monitors true bspc config remove_disabled_monitors true


Expand Down
3 changes: 2 additions & 1 deletion templates/qutebrowser
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ if initial_start:
c.auto_save.session = True c.auto_save.session = True


# binds # binds
config.bind('<Shift-i>', 'config-source') # todo: make this insert mode + utf8 script
# config.bind('<Shift-I>', 'config-source')




# mustache templated from current theme # mustache templated from current theme
Expand Down
4 changes: 2 additions & 2 deletions wm/.wm/panel/lemons/dynamicmpd
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
# scrolling mpd text # scrolling mpd text
# limitation of this is it only works with monospace fonts. # limitation of this is it only works with monospace fonts.


max_length=20 max_length=30


title="$($HOME/.wm/panel/lemons/mpd)" title="$($HOME/.wm/panel/lemons/mpd)"
max_length=$(echo "$title" | cut -c 1-$max_length | wc -m) max_length=$(echo "$title" | cut -c 1-$max_length | wc -L)
if [ "$title" = "Stopped" ]; then if [ "$title" = "Stopped" ]; then
icon music icon music
echo Stopped echo Stopped
Expand Down
10 changes: 5 additions & 5 deletions wm/.wm/panel/lemons/memory
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# MIT Copyright (c) 2018 Luiz de Milon (kori) # MIT Copyright (c) 2018 Luiz de Milon (kori)
# get current memory usage # get current memory usage


t=$(grep MemTotal /proc/meminfo | awk '{print $2}') t=$(awk '/MemTotal/{print $2}' /proc/meminfo)
f=$(grep MemFree /proc/meminfo | awk '{print $2}') f=$(awk '/MemFree/{print $2}' /proc/meminfo)
b=$(grep ^Buffers /proc/meminfo | awk '{print $2}') b=$(awk '/^Buffers/{print $2}' /proc/meminfo)
c=$(grep ^Cached /proc/meminfo | awk '{print $2}') c=$(awk '/^Cached/{print $2}' /proc/meminfo)


echo -n $(echo "($t - $f - $c - $b) / 1000" | bc) echo $(echo "($t - $f - $c - $b) / 1000" | bc)
1 change: 0 additions & 1 deletion wm/.wm/panel/tools/dzen.sh
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ dzen_mpd() {
# Common folders and recent files, as well as some actions. # Common folders and recent files, as well as some actions.
dzen_menu() { dzen_menu() {
set +e set +e
notify-send asdf


align=l align=l
icon_dzen() { icon_dzen() {
Expand Down
4 changes: 3 additions & 1 deletion wm/.wm/scripts/theming/defaults
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ c_shadow_red="0.0"
c_shadow_blue="0.0" c_shadow_blue="0.0"
c_shadow_green="0.0" c_shadow_green="0.0"


c_fading="false"; c_fading="false"
c_fade_in_step="0.1" c_fade_in_step="0.1"
c_fade_out_step="0.1" c_fade_out_step="0.1"


Expand Down Expand Up @@ -161,6 +161,8 @@ done
# it is possible to specify different information per monitor with variable barInfo<mon #> --> "options" # it is possible to specify different information per monitor with variable barInfo<mon #> --> "options"
p_format="dropdown:desktop:github|title|mpd:volume:weather:clock" # Default options/items to include in info section of panel. p_format="dropdown:desktop:github|title|mpd:volume:weather:clock" # Default options/items to include in info section of panel.


p_format="dropdown:desktop:github:title|org_task|dynamicmpd:volume:weather:clock" # Default options/items to include in info section of panel.

# Customize options on different computers by hostname. # Customize options on different computers by hostname.
# for example, here littleapple is my desktop (3 monitors) and home2 is my netbook. # for example, here littleapple is my desktop (3 monitors) and home2 is my netbook.
if [ "$(hostname)" = "littleapple" ]; then if [ "$(hostname)" = "littleapple" ]; then
Expand Down
3 changes: 2 additions & 1 deletion wm/.wm/scripts/theming/ltheme
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ load_gtk() {


if ! margs gtkrc .gtkrc-2.0; then if ! margs gtkrc .gtkrc-2.0; then
target="$HOME/.themes/${THEME_NAME}_template" target="$HOME/.themes/${THEME_NAME}_template"
mustache < $HOME/.wm/templates/oomox > $target mustache < $HOME/.dotfiles/templates/oomox > $target


git_ensure oomox git_ensure oomox
cd "$gitdest" cd "$gitdest"
Expand Down Expand Up @@ -265,6 +265,7 @@ load_dunst() {
} }


load_mpd() { load_mpd() {
mkdir "$HOME/.config/mpd/playlists"
margs mpd .config/mpd/mpd.conf margs mpd .config/mpd/mpd.conf
margs mpdcron .config/mpd/mpdcron.conf margs mpdcron .config/mpd/mpdcron.conf
} }
Expand Down
10 changes: 5 additions & 5 deletions wm/.wm/themes/paper
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ p_bg_normal="#ffe3e3e3"
p_fg_active="#ff525252" p_fg_active="#ff525252"
p_bg_active="#ffb9b9b9" p_bg_active="#ffb9b9b9"


p_format_2="desktop:github:themeSwitch:title|org_task|dynamicmpd:volume:clock" # p_format_2="desktop:github:themeSwitch:title|org_task|dynamicmpd:volume:clock"
p_title_show_mode=active # used by title. p_title_show_mode=active # used by title.


p_height=25 p_height=25
Expand All @@ -37,8 +37,8 @@ p_window_class="noshadow"
p_line=2 p_line=2
p_padding=6 p_padding=6


p_font_main="Go Mono for Powerline-12:style=Bold" p_font_main="Go Mono for Powerline-10:style=Bold"
p_font_icon="FontAwesome-12" # Panel Icon font. p_font_icon="FontAwesome-10" # Panel Icon font.
p_icon_enable=false p_icon_enable=false
d_font="Go Mono for Powerline 10" d_font="Go Mono for Powerline 10"


Expand All @@ -48,9 +48,9 @@ p_desktop_empty_label="$(uchar f1db)"
p_desktop_tiling_label='' p_desktop_tiling_label=''
p_desktop_monocle_label="$(uchar f00b)" p_desktop_monocle_label="$(uchar f00b)"


st_font="Go Mono for Powerline-14:style=Regular" st_font="Go Mono for Powerline-12:style=Regular"
p_title_only_show_active=true p_title_only_show_active=true
maxWinNameLen=30 maxWinNameLen=40


p_title_theme="fg=\"#ff$(colort -t 30 525252)\"" p_title_theme="fg=\"#ff$(colort -t 30 525252)\""
p_desktop_theme="fg=\"#ff$(colort -t 30 525252)\"" p_desktop_theme="fg=\"#ff$(colort -t 30 525252)\""
Expand Down

0 comments on commit a2470a0

Please sign in to comment.