Skip to content

Instantly share code, notes, and snippets.

@DanielVoogsgerd
Created June 3, 2014 10:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DanielVoogsgerd/5b03dea7ebb6d8ff77ab to your computer and use it in GitHub Desktop.
Save DanielVoogsgerd/5b03dea7ebb6d8ff77ab to your computer and use it in GitHub Desktop.
diff --git a/bin/search b/bin/search
index 3cdcb7f..f0fa5d9 100755
--- a/bin/search
+++ b/bin/search
@@ -3,6 +3,7 @@
HISTFILE=/tmp/.gshist
COMPLETION=false
+DMENU='rofi -dmenu -p Google -i'
if [ -f $HOME/.dmenurc ]; then
. $HOME/.dmenurc
else
diff --git a/bin/wireless b/bin/wireless
index 00cb84c..4902dac 100755
--- a/bin/wireless
+++ b/bin/wireless
@@ -1,30 +1,101 @@
#!/bin/bash
-interface=`netstat -i | awk 'NR>2{print $1}' | grep ^wl`
+error="FF0000"
+function getInterface {
+ case "$1" in
+ wireless)
+ netstat -i | awk 'NR>2{print $1}' | grep ^wl
+ ;;
+ ethernet)
+ netstat -i | awk 'NR>2{print $1}' | grep ^en
+ ;;
+ *) echo "Interface not recognized"; exit 1
+ esac
+}
-case "$1" in
+function getIP {
+ local ip=`ip -f inet addr show $interface | grep inet | awk '{print $2}' | awk -F'/' '{ print $1 }' | sed ':a;N;$!ba;s/\n/ /g'`
+
+ echo -n "$ip"
+}
+
+function getQuality {
+ local q=`iwconfig "$interface" | grep Quality | awk '{print $2}' | awk -F"=" '{ print $2 }'`
+ local quality_now=${q%%/*}
+ local quality_max=${q##*/}
+ local quality=`bc <<< "$quality_now*100/$quality_max"`
+
+ echo -n "$quality"
+}
+
+function getSSID {
+ local SSID=`iwgetid -r`
+ # local SSID=iwconfig | grep "$interface" | awk -F'"' ' { print $2 }'
+ echo -n $SSID
+}
+
+function Output {
+ local ip=$(getIP)
+
+ if [ -z "$ip" ]; then
+ echo "Down"
+ echo "Down"
+ echo "$error"
+ exit
+ fi
+
+ case "$1" in
+ wireless)
+ echo "$ip (quality: $(getQuality) of $(getSSID))"
+ ;;
+ ethernet)
+ echo "$ip"
+ ;;
+ esac
+}
+
+interface=`getInterface $1`
+
+
+if [ -z "$interface" ]; then
+ echo "Down"
+ echo "Down"
+ echo "$error"
+ exit
+fi
+
+if [[ "$1" != "ethernet" ]] && [[ "$1" != "wireless" ]]; then
+ echo "Unsupported network device"
+ exit 1
+fi
+
+
+case "$2" in
ip)
# Get ip address
- ip=`ip -f inet addr show $interface | grep inet | awk '{print $2}' | awk -F'/' '{ print $1 }' | sed ':a;N;$!ba;s/\n/ /g'`
- echo $ip
+ getIP $interface
;;
quality)
# Get connection quality
- q=`iwconfig "$interface" | grep Quality | awk '{print $2}' | awk -F"=" '{ print $2 }'`
- quality_now=${q%%/*}
- quality_max=${q##*/}
- q_percent=`bc <<< "$quality_now*100/$quality_max"`
- echo $q_percent%
+ case "$1" in
+ wireless)
+ getQuality $interface
+ ;;
+ ethernet)
+ echo "Operation not supported on a ethernet device"
+ ;;
+ esac
;;
- all)
- echo "Wireless: `wireless ip` (quality: `wireless quality`)"
+ SSID)
+ case "$1" in
+ wireless)
+ getSSID $interface
+ ;;
+ ethernet)
+ echo "Operation not supported on a ethernet device"
+ ;;
+ esac
;;
*)
- echo "Command does not exist. Try:"
- echo "wireless [information]"
- echo " ip Get the wireless IPs"
- echo " quality Get the wireless signal quality"
- ;;
+ Output $1
+ ;;
esac
-
-
-
diff --git a/i3/config b/i3/config
index 7d53e2e..bde746b 100644
--- a/i3/config
+++ b/i3/config
@@ -39,6 +39,7 @@ bindsym $mod+g exec search
bindsym $mod+b exec bookmark
bindsym $mod+shift+d exec export | xmessage -file -
bindsym $mod+shift+p exec drandr
+bindsym $mod+i exec dacaur
# There also is the (new) i3-dmenu-desktop which only displays applications
# shipping a .desktop file. It is a wrapper around dmenu, so you need that
@@ -141,8 +142,8 @@ for_window [class="Xfce4-notifyd"] floating enable; border none; focus mode_togg
for_window [class="Pavucontrol"] floating enable
for_window [class="Google-chrome*" title="Select Image - *"] floating enable
for_window [class="Qt4-ssh-askpass"] floating enable
-
-
+for_window [class="Gpick"] floating enable; focus mode_toggle
+for_window [instance="soffice"] floating enable
# reload the configuration file
bindsym $mod+Shift+c reload
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
@@ -181,18 +182,18 @@ bindsym $mod+r mode "resize"
# Start i3bar to display a workspace bar (plus the system information pii3status
# finds out, if available)
bar {
- # status_command i3status --config ~/.i3/status.conf
+ # status_command i3status --config ~/.i3/status.conf
status_command i3blocks -c ~/.i3/i3blocks.conf
- font pango:Meslo LG S 9
- colors {
- separator #666666
- background #222222
- statusline #0088CC
- focused_workspace #0088CC #0088CC #ffffff
- active_workspace #333333 #333333 #ffffff
- inactive_workspace #333333 #333333 #888888
- urgent_workspace #2f343a #900000 #ffffff
- }
+ font pango: Meslo LG S Bold 8
+ colors {
+ separator #444444
+ background #222222
+ statusline #0088CC
+ focused_workspace #0088CC #0088CC #FFFFFF
+ active_workspace #333333 #333333 #FFFFFF
+ inactive_workspace #222222 #222222 #FFFFFF
+ urgent_workspace #cc1800 #cc1800 #FFFFFF
+ }
}
exec nm-applet
@@ -200,7 +201,7 @@ exec nm-applet
# Custom additional configuration
# dynamic tagging feature
#bindsym $mod+t exec ~/.i3/get_workspace_options.py | dmenu -b | ~/.i3/go_to_workspace.py
-bindsym $mod+Shift+t exec ~/.i3/get_workspace_options.py | dmenu -b -i | ~/.i3/move_to_workspace.py
+bindsym $mod+Shift+t exec ~/.i3/get_workspace_options.py | rofi -dmenu -p "Switch workspace" -b -i | ~/.i3/move_to_workspace.py
bindsym $mod+n exec dmenu -b -i | ~/.i3/rename_workspace.py
@@ -211,6 +212,6 @@ bindsym Print exec teiler
hide_edge_borders both
client.focused #0088CC #0088CC #ffffff #dddddd
-client.focused_inactive #333333 #333333 #888888 #292d2e
-client.unfocused #333333 #333333 #888888 #292d2e
-client.urgent #2f343a #900000 #ffffff #900000
\ No newline at end of file
+client.focused_inactive #333333 #333333 #ffffff #292d2e
+client.unfocused #333333 #333333 #FFFFFF #292d2e
+client.urgent #2f343a #900000 #ffffff #900000
diff --git a/i3/i3blocks.conf b/i3/i3blocks.conf
index 32982bf..71dc932 100644
--- a/i3/i3blocks.conf
+++ b/i3/i3blocks.conf
@@ -1,14 +1,22 @@
[volume]
-command=echo -n 'Volume: '; amixer get Master | grep -E -o '[0-9][0-9]?%'
+command=echo -n 'Volume: '; amixer get Master | grep -E -o '[0-9]+?%'
interval=1
# use 'killall -USR1 i3blocks' after changing the volume
+[weather]
+command=echo -n 'Weather: '; weather
+interval=60
+
+[ping]
+command=echo -n 'Ping: '; ping 8.8.8.8 -i 0.2 -c 3 | grep rtt | awk -F"/" '{ print $5}'
+interval=10
+
[wireless]
-command=wireless all
+command=echo -n 'Wireless: '; wireless wireless print
interval=10
[ethernet]
-command=/usr/libexec/i3blocks/network ens5 E
+command=echo -n 'Ethernet: '; wireless ethernet print
interval=10
[time]
diff --git a/i3/wallpaper.jpg b/i3/wallpaper.jpg
deleted file mode 100644
index 0b3199b..0000000
Binary files a/i3/wallpaper.jpg and /dev/null differ
diff --git a/vim/vimrc b/vim/vimrc
index 8d79daf..2633957 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -47,7 +47,7 @@ set dir=/tmp
" Remaps
nnoremap ; :
-noremap jj <Esc>:w<CR>
+inoremap jj <Esc>
inoremap ;; <End>;<Esc>:w<CR>
" I'm switching to PSR, so I'm switching for tab's to 4 spaces.
diff --git a/x/xprofile b/x/xprofile
index 340d38e..0c2cee8 100644
--- a/x/xprofile
+++ b/x/xprofile
@@ -11,7 +11,7 @@ if [ -f ${XDG_CONFIG_HOME:-~/.config}/user-dirs.dirs ]; then
export XDG_DESKTOP_DIR XDG_DOWNLOAD_DIR XDG_TEMPLATES_DIR XDG_PUBLICSHARE_DIR XDG_DOCUMENTS_DIR XDG_MUSIC_DIR XDG_PICTURES_DIR XDG_VIDEOS_DIR
fi
-feh --bg-scale ~/.i3/wallpaper.jpg
+feh --bg-scale ~/Environment/wallpapers/ghost.jpg
[[ -f ~/.Xresources ]] && xrdb -merge "${HOME}/.Xresources"
diff --git a/zsh/vcs b/zsh/vcs
--- a/zsh/vcs
+++ b/zsh/vcs
@@ -1 +1 @@
-Subproject commit 83a1357516149a2d4972b35c2cae5ad50160e4d7
+Subproject commit 83a1357516149a2d4972b35c2cae5ad50160e4d7-dirty
diff --git a/zsh/zshrc b/zsh/zshrc
index 62a30e6..a7c7b60 100644
--- a/zsh/zshrc
+++ b/zsh/zshrc
@@ -49,4 +49,9 @@ fi
[ -f $cdir ] && echo "cdir found (`cat $cdir`)" && cd "`cat $cdir`" && rm "$cdir"
clear
-screenfetch
+
+if hash archey 2>/dev/null; then
+ archey
+elif hash screenfetch 2>/dev/null; then
+ screenfetch
+fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment