Rename scripts

Signed-off-by: Severin Kaderli <severin.kaderli@gmail.com>
This commit is contained in:
Severin Kaderli 2019-03-06 16:53:16 +01:00
parent df6b44e541
commit 410d0b33c6
Signed by: severinkaderli
GPG key ID: F419F8835B72F0C4
46 changed files with 566 additions and 249 deletions

View file

@ -22,4 +22,6 @@ rofi.seperator-style: solid
rofi.opacity: 100
rofi.location: 2
rofi.yoffset: 35
rofi.fixed-num-lines: false
rofi.fixed-num-lines: false
Sxiv.background: #000000

View file

@ -31,4 +31,4 @@ xrdb -merge "${XDG_CONFIG_HOME}/X11/xresources"
# Start ibus
#ibus-daemon -drx
. "${XDG_BIN_HOME}/resolution.sh"
. "${XDG_BIN_HOME}/resolution"

View file

@ -12,10 +12,10 @@
"interfaceType": "XRecord",
"undoUsingBackspace": true,
"windowDefaultSize": [
924,
469
1872,
962
],
"hPanePosition": 232,
"hPanePosition": 472,
"columnWidths": [
150,
50,

View file

@ -13,9 +13,9 @@
"undoUsingBackspace": true,
"windowDefaultSize": [
1872,
301
962
],
"hPanePosition": 470,
"hPanePosition": 472,
"columnWidths": [
150,
50,

View file

@ -15,7 +15,7 @@
],
"backspace": true,
"ignoreCase": false,
"immediate": true,
"immediate": false,
"triggerInside": false,
"wordChars": "[\\w]"
},

View file

@ -5,7 +5,7 @@
"modes": [
1
],
"usageCount": 12,
"usageCount": 19,
"prompt": false,
"omitTrigger": false,
"showInTrayMenu": false,
@ -15,7 +15,7 @@
],
"backspace": true,
"ignoreCase": false,
"immediate": true,
"immediate": false,
"triggerInside": false,
"wordChars": "[\\w]"
},

1
system/.config/cmus/rc Normal file
View file

@ -0,0 +1 @@
set display_artist_sort_name=/home/severin/.local/bin/cmus-cover

View file

@ -15,7 +15,7 @@ opacity-rule = [
"85:class_g = 'Nemo'"
];
inactive-dim = 0.25;
#inactive-dim = 0.25;
# Performance improvements
unredir-if-possible = true;

View file

@ -11,5 +11,10 @@
# This file is loaded on boot by crontab.
# Synchronize Google Drive every 30 minutes
*/30 * * * * grive -d -p /home/severin/GoogleDrive/ >> /home/severin/.local/log/cron.log 2>&1
*/5 * * * * /home/severin/.local/bin/sync_notes.sh >> /home/severin/.local/log/notes.log 2>&1
*/30 * * * * grive -d -p $HOME/Documents/ >> $HOME/.local/log/cron.log
# Sync pacman databases every 30 minutes
*/30 * * * * sudo $HOME/.local/bin/sync_package_databases >> $HOME/.local/log/cron.log
# Synchronize notes every 5 minutes
*/5 * * * * $HOME/.local/bin/sync_notes >> $HOME/.local/log/cron.log

View file

@ -32,6 +32,9 @@ alias pj="cd ~/Projects"
# Alias to get to my Downloads folder
alias dl="cd ~/Downloads"
# Alias to get to my Documents folder
alias doc="cd ~/Documents"
# Alias for opening my code editor
alias e="code"

View file

@ -11,7 +11,7 @@
#
# USAGE:
# This script is sourced by .bashrc
. "${XDG_BIN_HOME}/utils.sh"
. "${XDG_BIN_HOME}/utils"
# XDG Overrides for unsupported programs
export HTTPIE_CONFIG_DIR="${XDG_CONFIG_HOME}/httpie"

View file

@ -1,5 +1,5 @@
file:///home/severin/Downloads Downloads
file:///home/severin/GoogleDrive GoogleDrive
file:///home/severin/Documents Documents
file:///home/severin/Projects Projects
file:///home/severin/dotfiles dotfiles
file:///home/severin/Notes Notes

View file

@ -10,18 +10,36 @@
# USAGE:
# This file is automatically used by i3.
# Disable window titlebars and borders
for_window [class="^.*"] border pixel 0
# Gaps
gaps inner 25
#gaps outer -10
new_window none
# Font for window titles. Will also be used by the bar unless a different font
# is used in the bar {} block below.
font pango:Noto Sans, Font Awesome 5 Free 15px
# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod
###############################################################################
# Modifiers #
###############################################################################
set $mod Mod4
set $alt Mod1
###############################################################################
# Outputs #
###############################################################################
set $output1 HDMI-1
set $output2 eDP-1
###############################################################################
# Workspaces #
###############################################################################
@ -49,29 +67,36 @@ workspace $workspace8 output $output1
workspace $workspace9 output $output2
workspace $workspace10 output $output2
new_window none
# Assign applications to workspaces
assign [class="Google-chrome-beta"] $workspace1
assign [instance="cmus"] $workspace10
assign [class="Code"] $workspace3
assign [class="Nemo"] $workspace4
assign [class="discord"] $workspace5
assign [class="Steam"] $workspace6
assign [class="keepassxc"] $workspace8
assign [class="vlc"] $workspace9
assign [class="mpv"] $workspace9
assign [class="Notable"] $workspace7
# Font for window titles. Will also be used by the bar unless a different font
# is used in the bar {} block below.
font pango:Noto Sans, Font Awesome 5 Free 15px
###############################################################################
# Keybindings #
###############################################################################
# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod
# Start a terminal
bindsym $mod+Return exec termite -c ~/.config/termite/config
# Kill focused window
bindsym $mod+Shift+q kill
# Rofi menus
# Open run menu
bindsym $mod+R exec rofi -show run -lines 5
bindsym $mod+G exec games.sh
bindsym $mod+F4 exec power.sh
# Open game menu
bindsym $mod+G exec games
# Open power menu
bindsym $mod+F4 exec power
# Change focus
bindsym $mod+Left focus left
@ -99,67 +124,57 @@ bindsym $mod+$alt+H move workspace to output left
bindsym $mod+$alt+Right move workspace to output right
bindsym $mod+$alt+L move workspace to output right
# split in horizontal orientation
#bindsym $mod+h split h
# split in vertical orientation
bindsym $mod+v split v
# Toggle split orientation
bindsym $mod+T split toggle
# Fullscreen toggle
bindsym $mod+F11 fullscreen toggle
# toggle tiling / floating
bindsym $mod+Shift+space floating toggle
# change focus between tiling / floating windows
bindsym $mod+space focus mode_toggle
bindsym $mod+Shift+Space floating toggle
# Workspace switching
bindsym $mod+1 workspace $workspace1
bindsym $mod+2 workspace $workspace2
bindsym $mod+3 workspace $workspace3
bindsym $mod+4 workspace $workspace4
bindsym $mod+5 workspace $workspace5
bindsym $mod+6 workspace $workspace6
bindsym $mod+7 workspace $workspace7
bindsym $mod+8 workspace $workspace8
bindsym $mod+9 workspace $workspace9
bindsym $mod+0 workspace $workspace10
bindsym $mod+KP_1 workspace $workspace1
bindsym $mod+2 workspace $workspace2
bindsym $mod+KP_2 workspace $workspace2
bindsym $mod+3 workspace $workspace3
bindsym $mod+KP_3 workspace $workspace3
bindsym $mod+4 workspace $workspace4
bindsym $mod+KP_4 workspace $workspace4
bindsym $mod+5 workspace $workspace5
bindsym $mod+KP_5 workspace $workspace5
bindsym $mod+6 workspace $workspace6
bindsym $mod+KP_6 workspace $workspace6
bindsym $mod+7 workspace $workspace7
bindsym $mod+KP_7 workspace $workspace7
bindsym $mod+8 workspace $workspace8
bindsym $mod+KP_8 workspace $workspace8
bindsym $mod+9 workspace $workspace9
bindsym $mod+KP_9 workspace $workspace9
bindsym $mod+0 workspace $workspace10
bindsym $mod+KP_0 workspace $workspace10
# Moving container to workspace
bindsym $mod+Shift+1 move container to workspace $workspace1
bindsym $mod+Shift+2 move container to workspace $workspace2
bindsym $mod+Shift+3 move container to workspace $workspace3
bindsym $mod+Shift+4 move container to workspace $workspace4
bindsym $mod+Shift+5 move container to workspace $workspace5
bindsym $mod+Shift+6 move container to workspace $workspace6
bindsym $mod+Shift+7 move container to workspace $workspace7
bindsym $mod+Shift+8 move container to workspace $workspace8
bindsym $mod+Shift+9 move container to workspace $workspace9
bindsym $mod+Shift+0 move container to workspace $workspace10
bindsym $mod+Shift+KP_1 move container to workspace $workspace1
bindsym $mod+Shift+2 move container to workspace $workspace2
bindsym $mod+Shift+KP_2 move container to workspace $workspace2
bindsym $mod+Shift+3 move container to workspace $workspace3
bindsym $mod+Shift+KP_3 move container to workspace $workspace3
bindsym $mod+Shift+4 move container to workspace $workspace4
bindsym $mod+Shift+KP_4 move container to workspace $workspace4
bindsym $mod+Shift+5 move container to workspace $workspace5
bindsym $mod+Shift+KP_5 move container to workspace $workspace5
bindsym $mod+Shift+6 move container to workspace $workspace6
bindsym $mod+Shift+KP_6 move container to workspace $workspace6
bindsym $mod+Shift+7 move container to workspace $workspace7
bindsym $mod+Shift+KP_7 move container to workspace $workspace7
bindsym $mod+Shift+8 move container to workspace $workspace8
bindsym $mod+Shift+KP_8 move container to workspace $workspace8
bindsym $mod+Shift+9 move container to workspace $workspace9
bindsym $mod+Shift+KP_9 move container to workspace $workspace9
bindsym $mod+Shift+0 move container to workspace $workspace10
bindsym $mod+Shift+KP_0 move container to workspace $workspace10
# Restart i3
@ -181,20 +196,14 @@ bindsym Escape mode "default"
bindsym $mod+x mode "resize"
exec_always --no-startup-id $HOME/.config/polybar/launch.sh
#######################################
# Custom keybinding
#######################################
# Screen lock controls
#bindsym $mod+l exec --no-startup-id $XDG_BIN_HOME/screenlock.sh
bindsym XF86Sleep exec --no-startup-id $XDG_BIN_HOME/screenlock.sh
bindsym XF86Sleep exec --no-startup-id screenlock
# Volume controls
bindsym XF86AudioMute exec --no-startup-id pamixer -t
bindsym $mod+m exec --no-startup-id pamixer -t
bindsym XF86AudioRaiseVolume exec --no-startup-id $XDG_BIN_HOME/increase_volume.sh
bindsym $mod+KP_Add exec --no-startup-id $XDG_BIN_HOME/increase_volume.sh
bindsym XF86AudioRaiseVolume exec --no-startup-id increase_volume
bindsym $mod+KP_Add exec --no-startup-id increase_volume
bindsym XF86AudioLowerVolume exec --no-startup-id pamixer -d 5 --allow-boost
bindsym $mod+KP_Subtract exec --no-startup-id pamixer -d 5 --allow-boost
@ -212,21 +221,25 @@ bindsym XF86AudioPrev exec --no-startup-id cmus-remote -r
bindsym $mod+Control+Left exec --no-startup-id cmus-remote -r
exec --no-startup-id "i3-msg 'workspace 10: ; append_layout /home/severin/.config/i3/workspace-10.json'"
#######################################
# Startup applications
#######################################
# Dunst
exec --no-startup-id dunst
# Compton
###############################################################################
# Startup applications #
###############################################################################
# Start compton
exec --no-startup-id compton -b
# Background-Image
exec_always --no-startup-id feh --randomize --bg-fill $HOME/GoogleDrive/02_Media/Images/01_Wallpaper/Desktop/*
# Start polybar
exec_always --no-startup-id $XDG_CONFIG_HOME/polybar/launch
# Monitor settings
exec_always --no-startup-id $XDG_BIN_HOME/resolution.sh
# Start dunst
exec --no-startup-id dunst
# Set resolution
exec_always --no-startup-id resolution
# Set wallpaper
exec_always --no-startup-id wallpaper
# Other applications
exec autokey-gtk
@ -238,23 +251,5 @@ exec nemo
exec keepassxc
exec notable
exec termite -e cmus --name cmus
# Assign programs to specific workspaces
###
assign [class="Google-chrome-beta"] $workspace1
assign [instance="cmus"] $workspace10
assign [class="Code"] $workspace3
assign [class="Nemo"] $workspace4
assign [class="discord"] $workspace5
assign [class="Steam"] $workspace6
assign [class="keepassxc"] $workspace8
assign [class="vlc"] $workspace9
assign [class="mpv"] $workspace9
assign [class="Notable"] $workspace7
# Disable window titlebars and borders
for_window [class="^.*"] border pixel 0
# Gaps
gaps inner 25
#gaps outer -10
exec termite -e cava --name cava
exec sxiv -b -s f $HOME/.local/share/cmus/.cover

View file

@ -0,0 +1,96 @@
[
{
"border": "none",
"floating": "auto_off",
"fullscreen_mode": 0,
"layout": "splith",
"percent": 1,
"type": "con",
"nodes": [
{
"border": "none",
"floating": "auto_off",
"layout": "splith",
"percent": 1,
"type": "con",
"nodes": [
{
"border": "pixel",
"current_border_width": 0,
"floating": "auto_off",
"geometry": {
"height": 434,
"width": 736,
"x": 0,
"y": 0
},
"name": "cmus v2.7.1",
"percent": 0.7,
"swallows": [
{
"instance": "^cmus$"
}
],
"type": "con"
},
{
"border": "none",
"floating": "auto_off",
"layout": "splitv",
"percent": 0.3,
"type": "con",
"nodes": [
{
"border": "pixel",
"current_border_width": 0,
"floating": "auto_off",
"geometry": {
"height": 1080,
"width": 1920,
"x": 0,
"y": 0
},
"name": "sxiv",
"percent": 0.5,
"swallows": [
{
"instance": "^sxiv$"
}
],
"type": "con"
},
{
"border": "none",
"floating": "auto_off",
"layout": "splith",
"percent": 0.5,
"type": "con",
"nodes": [
{
"border": "pixel",
"current_border_width": 0,
"floating": "auto_off",
"geometry": {
"height": 434,
"width": 736,
"x": 0,
"y": 0
},
"name": "cava",
"percent": 1,
"swallows": [
{
"instance": "^cava$"
}
],
"type": "con"
}
]
}
]
}
]
}
]
}
]

View file

@ -28,7 +28,7 @@ monitor = HDMI-1
width = 100%
height = ${settings.bar-height}
offset-x = 0
offset-y = 0
offset-y = 0
font-0 = Noto Sans:pixelsize=12;3
font-1 = Noto Sans CJK JP:pixelsize=12;3
@ -42,8 +42,8 @@ padding-right = 2
module-margin = 2
modules-left = i3
modules-center = xwindow
modules-right = battery volume backlight wlan date power
modules-center =
modules-right = update gmail todo battery volume backlight wlan date power
tray-position = none
separator = |
@ -106,20 +106,53 @@ label-urgent-background = ${settings.background-color}
label-urgent-padding = ${settings.padding}
#######################################
# Active window title
#######################################
[module/xwindow]
type = internal/xwindow
###############################################################################
# Update count #
###############################################################################
[module/update]
type = custom/script
exec = ${XDG_CONFIG_HOME}/polybar/scripts/update-count
format = <label>
label = %title%
label-maxlen = 50
label =  %output%
interval = 60
click-left = xdg-open "https://www.archlinux.org/"
###############################################################################
# G-Mail #
###############################################################################
[module/gmail]
type = custom/script
exec = ${XDG_CONFIG_HOME}/polybar/scripts/gmail/count.py
format = <label>
label =  %output%
interval = 60
click-left = xdg-open https://mail.google.com
#######################################
# Battery indicator
#######################################
###############################################################################
# Todo #
###############################################################################
[module/todo]
type = custom/script
exec = echo "$(${XDG_BIN_HOME}/todo | wc -l) / 3" | bc
format = <label>
label =  %output%
interval = 60
click-left = xdg-open "https://todoist.com/"
###############################################################################
# Battery indicator #
###############################################################################
[module/battery]
type = internal/battery
full-at = 99
@ -153,9 +186,9 @@ interval = 5
poll-interval = 5
#######################################
# Volume indicator
#######################################
##############################################################################
# Volume indicator #
##############################################################################
[module/volume]
type = internal/pulseaudio
use-ui-max = true
@ -173,9 +206,9 @@ ramp-volume-2 = 
interval = 5
#######################################
# Brightness indicator
#######################################
##############################################################################
# Brightness indicator #
##############################################################################
[module/backlight]
type = custom/script
exec = light -G | cut -d. -f1
@ -189,9 +222,9 @@ scroll-up = light -A 5
scroll-down = light -U 5
#######################################
# WiFi indicator
#######################################
##############################################################################
# WiFi indicator #
##############################################################################
[module/wlan]
type = internal/network
interface = wlp3s0
@ -212,9 +245,9 @@ ramp-signal-foreground = ${settings.foreground-color}
interval = 1
#######################################
# Time and date
#######################################
##############################################################################
# Time and date #
##############################################################################
[module/date]
type = custom/script
exec = date +"%F %H:%M:%S"
@ -227,19 +260,14 @@ interval = 1
click-left = xdg-open "https://calendar.google.com"
#######################################
# Power menu
#######################################
##############################################################################
# Power menu #
##############################################################################
[module/power]
type = custom/script
exec = echo -e "\uf011"
type = custom/text
content = 
format = <label>
label = %output%
interval = 5
click-left = $XDG_BIN_HOME/power.sh
click-left = $XDG_BIN_HOME/power
#######################################
@ -247,7 +275,7 @@ click-left = $XDG_BIN_HOME/power.sh
#######################################
[module/music]
type = custom/script
exec = ${XDG_BIN_HOME}/music.sh
exec = ${XDG_BIN_HOME}/music
format = <label>
label = %output%

View file

@ -1,7 +1,7 @@
#!/bin/bash
#!/usr/bin/env bash
#
# SCRIPT NAME:
# .config/polybar/launch.sh
# .config/polybar/launch
#
# AUTHOR:
# Severin Kaderli <severin.kaderli@gmail.com>
@ -10,7 +10,7 @@
# This script kills existing polybar processes and then launches the bars.
#
# USAGE:
# ./launch.sh
# ./launch
# Terminate already running bar instances
killall -q polybar

View file

@ -0,0 +1,28 @@
#!/usr/bin/env python
import os
import pathlib
import httplib2
import webbrowser
from oauth2client import client, file
SCOPE = 'https://www.googleapis.com/auth/gmail.readonly'
REDIRECT_URI = 'urn:ietf:wg:oauth:2.0:oob'
DIR = os.path.dirname(os.path.realpath(__file__))
CLIENT_SECRETS_PATH = os.path.join(DIR, 'client_secrets.json')
CREDENTIALS_PATH = os.path.join(DIR, 'credentials.json')
storage = file.Storage(CREDENTIALS_PATH)
if pathlib.Path(CREDENTIALS_PATH).is_file():
credentials = storage.get()
credentials.refresh(httplib2.Http())
print('Credentials successfully refreshed')
else:
flow = client.flow_from_clientsecrets(CLIENT_SECRETS_PATH, scope=SCOPE,
redirect_uri=REDIRECT_URI)
auth_uri = flow.step1_get_authorize_url()
webbrowser.open(auth_uri)
auth_code = input('Enter the auth code: ')
credentials = flow.step2_exchange(auth_code)
storage.put(credentials)
print('Credentials successfully created')

View file

@ -0,0 +1,11 @@
{
"installed": {
"client_id": "1041679298587-8solnkr9tr8iktrut958if6tsgqt42m2.apps.googleusercontent.com",
"project_id": "polybar-gmail",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://accounts.google.com/o/oauth2/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_secret": "-aZZAslLp6ydldCAFvH9AEwi",
"redirect_uris": ["urn:ietf:wg:oauth:2.0:oob"]
}
}

View file

@ -0,0 +1,19 @@
#!/usr/bin/env python
import os
import pathlib
import subprocess
import time
import argparse
from apiclient import discovery, errors
from oauth2client import client, file
from httplib2 import ServerNotFoundError
DIR = os.path.dirname(os.path.realpath(__file__))
CREDENTIALS_PATH = os.path.join(DIR, 'credentials.json')
gmail = discovery.build(
'gmail', 'v1', credentials=file.Storage(CREDENTIALS_PATH).get())
labels = gmail.users().labels().get(userId='me', id='INBOX').execute()
print(labels['messagesUnread'])

View file

@ -0,0 +1,17 @@
#!/usr/bin/env bash
#
# SCRIPT NAME:
# update-count
#
# AUTHOR:
# Severin Kaderli <severin.kaderli@gmail.com>
#
# DESCRIPTION:
# Returns the outstanding system updates.
#
# USAGE:
# ./update-count
UPDATES=$(pacman -Qu | wc -l)
AUR_UPDATES=$(yay -Qua --devel | wc -l)
echo "${UPDATES} / ${AUR_UPDATES}"