Added Datefunction in emacs, added vimconfig, using global molokai theme, switched to default vim

This commit is contained in:
Tuan-Dat Tran
2018-06-24 13:25:59 +02:00
parent 977c3a6266
commit b684590825
15 changed files with 1720 additions and 74 deletions

View File

@@ -1,36 +1,36 @@
! special
*.foreground: #eceff1
*.background: #263238
*.cursorColor: #eceff1
*.foreground: #f1ebeb
*.background: #272822
*.cursorColor: #f1ebeb
! black
*.color0: #263238
*.color8: #37474f
*.color0: #48483e
*.color8: #76715e
! red
*.color1: #ff9800
*.color9: #ffa74d
*.color1: #dc2566
*.color9: #fa2772
! green
*.color2: #8bc34a
*.color10: #9ccc65
*.color2: #8fc029
*.color10: #a7e22e
! yellow
*.color3: #ffc107
*.color11: #ffa000
*.color3: #d4c96e
*.color11: #e7db75
! blue
*.color4: #03a9f4
*.color12: #81d4fa
*.color4: #55bcce
*.color12: #66d9ee
! magenta
*.color5: #e91e63
*.color13: #ad1457
*.color5: #9358fe
*.color13: #ae82ff
! cyan
*.color6: #009688
*.color14: #26a69a
*.color6: #56b7a5
*.color14: #66efd5
! white
*.color7: #cfd8dc
*.color15: #eceff1
*.color7: #acada1
*.color15: #cfd0c2

View File

@@ -0,0 +1,23 @@
-- Theme generated by vim2theme
Description = "vim molokai"
Default = { Colour="#F8F8F2" }
Canvas = { Colour="#272822" }
Number = { Colour="#AE81FF" }
Escape = { Colour="#66D9EF" , Italic=true}
String = { Colour="#E6DB74" }
BlockComment = { Colour="#75715E" }
StringPreProc = String
LineComment = BlockComment
Operator = Default
LineNum = BlockComment
PreProcessor = { Colour="#defa25" }
Interpolation = Escape
Keywords = {
{ Colour="#F92672" , Bold=true},
{ Colour="#66D9EF" },
{ Colour="#95f067" },
{ Colour="#25faac" },
}

View File

@@ -91,8 +91,9 @@ for_window [class="Timeset-gui"] floating enable border normal
for_window [class="(?i)virtualbox"] floating enable border normal
for_window [title="KeePassX$"] floating enable border normal
for_window [title="Eddie - Settings"] floating enable border normal
for_window [class="^Thunderbird$" title="^.*Event:"] floating enable
for_window [title="(?i)termite"] border pixel 3
for_window [title="(?i)ranger"] border pixel 3
# switch to workspace with urgent window automatically
for_window [urgent=latest] focus
@@ -114,6 +115,7 @@ for_window [class="^com-intellij-updater-Runner$" title="^Update$"] floating ena
for_window [instance="^sun-awt-X11-XDialogPeer$" title="^Complete Installation$"] floating enable
###############################################################################
############################ Startup Applications #############################
###############################################################################
@@ -161,8 +163,8 @@ bindsym $mod+e exec source ~/.zshrc && termite -e 'ranger'
bindsym $mod+m exec thunderbird
bindsym Print exec --no-startup-id scrot
bindsym Shift+Print --release exec --no-startup-id scrot -f
bindsym control+Shift+Print --release exec --no-startup-id scrot -s
bindsym control+Shift+Print --release exec --no-startup-id scrot -f
bindsym Shift+Print --release exec --no-startup-id scrot -s
bindsym $mod+Ctrl+x --release exec --no-startup-id xkill
# change focus

View File

@@ -35,8 +35,8 @@ font-1 = unifont:fontformat=truetype:size=8:antialias=false;0
font-2 = siji:pixelsize=10;1
font-3 = FontAwesome:style=Regular:pixelsize=10
modules-left = spotify
modules-center = spotify-prev spotify-play spotify-stop spotify-next
modules-left = spotify
modules-center = spotify-prev spotify-play spotify-stop spotify-next
modules-right = xkeyboard volume xbacklight wlan eth battery1 date
cursor-click = pointer
@@ -70,7 +70,7 @@ font-1 = unifont:fontformat=truetype:size=8:antialias=false;0
font-2 = siji:pixelsize=10;1
font-3 = FontAwesome:style=Regular:pixelsize=10
modules-left =
modules-left = airvpn
modules-center = i3
modules-right = powermenu
@@ -124,6 +124,13 @@ exec = echo ""
tail = true
click-left = bash -c "playerctl stop && echo '0'>/home/$USER/.scripts/playstate"
[module/airvpn]
type = custom/script
exec-if =
exec = "if [[ $(ip addr | grep tun) ]]; then echo 'VPN: connected'; else echo 'VPN: disconnectd'; fi"
tail = true
[module/i3]
type = internal/i3
@@ -181,7 +188,7 @@ label-urgent-padding = 4
[module/xbacklight]
type = internal/xbacklight
format = <label>
format = <label>
label =  %percentage%%
label-underline = ${colors.yellow}
@@ -214,9 +221,9 @@ date =
date-alt = " %Y-%m-%d"
time = " %H:%M:%S"
time-alt =
time-alt =
format-prefix =
format-prefix =
format-prefix-foreground = ${colors.foreground-alt}
format-underline = ${colors.magenta}

View File

@@ -1,2 +1,6 @@
set preview_images true
set vcs_aware true
map f console scout -ftsea%space
map gg console mkdir%space
map np shell cp -r ~/Templates/LaTeX/Protokoll $(date +%g.%m.%%d)

View File

@@ -55,6 +55,7 @@
# install a rare browser, you probably use it. Firefox/konqueror/w3m on the
# other hand are often only installed as fallback browsers.
ext x?html?, has waterfox, X, flag f = waterfox -- "$@"
ext x?html?, has firefox, X, flag f = firefox -- "$@"
ext x?html?, has surf, X, flag f = surf -- file://"$1"
ext x?html?, has qutebrowser, X, flag f = qutebrowser -- "$@"
ext x?html?, has dwb, X, flag f = dwb -- "$@"
@@ -69,7 +70,6 @@ ext x?html?, has chromium-browser, X, flag f = chromium-browser -- "$@"
ext x?html?, has chromium, X, flag f = chromium -- "$@"
ext x?html?, has google-chrome, X, flag f = google-chrome -- "$@"
ext x?html?, has opera, X, flag f = opera -- "$@"
ext x?html?, has firefox, X, flag f = firefox -- "$@"
ext x?html?, has seamonkey, X, flag f = seamonkey -- "$@"
ext x?html?, has iceweasel, X, flag f = iceweasel -- "$@"
ext x?html?, has epiphany, X, flag f = epiphany -- "$@"

View File

@@ -42,52 +42,39 @@ scrollbar = off
[colors]
# special
foreground = #eceff1
foreground_bold = #eceff1
cursor = #eceff1
background = rgba(38, 50, 56, 1.0)
foreground = #f1ebeb
foreground_bold = #f1ebeb
cursor = #f1ebeb
background = #272822
# black
color0 = #263238
color8 = #37474f
color0 = #48483e
color8 = #76715e
# red
color1 = #ff9800
color9 = #ffa74d
color1 = #dc2566
color9 = #fa2772
# green
color2 = #8bc34a
color10 = #9ccc65
color2 = #8fc029
color10 = #a7e22e
# yellow
color3 = #ffc107
color11 = #ffa000
color3 = #d4c96e
color11 = #e7db75
# blue
color4 = #03a9f4
color12 = #81d4fa
color4 = #55bcce
color12 = #66d9ee
# magenta
color5 = #e91e63
color13 = #ad1457
color5 = #9358fe
color13 = #ae82ff
# cyan
color6 = #009688
color14 = #26a69a
color6 = #56b7a5
color14 = #66efd5
# white
color7 = #cfd8dc
color15 = #eceff1
[hints]
#font = Monospace 12
#foreground = #dcdccc
#background = #3f3f3f
#active_foreground = #e68080
#active_background = #3f3f3f
#padding = 2
#border = #3f3f3f
#border_width = 0.5
#roundness = 2.0
# vim: ft=dosini cms=#%s
color7 = #acada1
color15 = #cfd0c2

View File

@@ -0,0 +1,93 @@
[options]
allow_bold = true
audible_bell = false
clickable_url = true
#dynamic_title = false
font = Droid Sans Mono for Powerline
#fullscreen = true
#geometry = 640x480
#icon_name = terminal
mouse_autohide = true
#scroll_on_output = false
#scroll_on_keystroke = true
# Length of the scrollback buffer, 0 disabled the scrollback buffer
# and setting it to a negative value means "infinite scrollback"
scrollback_lines = -1
search_wrap = true
#urgent_on_bell = true
hyperlinks = true
# $BROWSER is used by default if set, with xdg-open as a fallback
#browser = xdg-open
# "system", "on" or "off"
cursor_blink = system
# "block", "underline" or "ibeam"
cursor_shape = ibeam
# Hide links that are no longer valid in url select overlay mode
#filter_unmatched_urls = true
# Emit escape sequences for extra modified keys
#modify_other_keys = false
# set size hints for the window
#size_hints = false
# "off", "left" or "right"
scrollbar = off
[colors]
# special
foreground = #eceff1
foreground_bold = #eceff1
cursor = #eceff1
background = rgba(38, 50, 56, 1.0)
# black
color0 = #263238
color8 = #37474f
# red
color1 = #ff9800
color9 = #ffa74d
# green
color2 = #8bc34a
color10 = #9ccc65
# yellow
color3 = #ffc107
color11 = #ffa000
# blue
color4 = #03a9f4
color12 = #81d4fa
# magenta
color5 = #e91e63
color13 = #ad1457
# cyan
color6 = #009688
color14 = #26a69a
# white
color7 = #cfd8dc
color15 = #eceff1
[hints]
#font = Monospace 12
#foreground = #dcdccc
#background = #3f3f3f
#active_foreground = #e68080
#active_background = #3f3f3f
#padding = 2
#border = #3f3f3f
#border_width = 0.5
#roundness = 2.0
# vim: ft=dosini cms=#%s

2
config/.scripts/API Normal file
View File

@@ -0,0 +1,2 @@
2928810
2d21e104b96f47db7733be5c94828ad0

1363
config/.scripts/a.json Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,68 @@
import sys
from os import stat
import time
from datetime import datetime
import requests
import json
def get_info():
'Gather the City ID and API Key'
# First line of the API file in the same directory as this file is the city ID
# Second line of the API file in the same directory as this file is the openweathermap-API key
try:
with open('API', 'r') as f:
city_id = f.readline().strip('\n')
api_key = f.readline().strip('\n')
if city_id == '' or api_key == '':
raise FileNotFoundError
return [city_id, api_key]
except FileNotFoundError:
print("Create a file called 'API' and put your city id in the 1st and API-key in the 2nd line.")
def cache_weather():
'Cache the weatherinformation as json'
city_id, api_key = get_info()
url = 'http://api.openweathermap.org/data/2.5/forecast?id={}&APPID={}&units=metric'.format(city_id, api_key)
ob_weather = requests.get(url).text
with open('weather_cache.json','w') as f:
json.dump(ob_weather, f)
# Isn't needed at the moment, might change later
def conv_to_epoch(iso_time):
'Converts the dt_txt to epoch time(Or any ISO formatted timestamp)'
dt_obj = datetime.strptime(iso_time, "%Y-%m-%d %H:%M:%S")
return int(dt_obj.strftime("%s"))
def main():
# Only request new data, when data is older than 12h
# if (os.path.isfile('weather_chache.json')):
# if (time.time()-1800000>os.stat('weather_cache.json').st_mtime):
# cache_weather()
# else:
# cache_weather()
# Load cached file as dictionary
weather = json.loads(json.load(open('weather_cache.json')))
if(weather['cod']=='200'):
lowest_temp = sys.maxsize
lowest_time = ''
# Only check the next 24h
for i in weather['list']:
print(i['dt_txt'])
print(i['main']['temp'])
print(i['weather']['main'])
print(i['dt_txt'])
print('Time: {} \nTemp: {}'.format(i['dt_txt'], i['main']['temp']))
print('Time: {} \nDescription: {}'.format('\t', i['weather']['main']))
else:
print("Error.\nDo you have a working internet connection?\nIs your API Key correct?\nIs your city ID correct?")
if __name__ == '__main__':
print(main())

File diff suppressed because one or more lines are too long