Initial commit of dotfiles

This commit is contained in:
Sanchayan Maity 2016-03-07 22:01:28 +05:30
commit 58c70237e9
25 changed files with 1354 additions and 0 deletions

106
Xresources Normal file
View File

@ -0,0 +1,106 @@
! urxvt
URxvt.perl-ext-common: default,clipboard,url-select,keyboard-select
URxvt.url-select.launcher: chromium
URxvt.url-select.underline: true
URxvt.keysym.M-u: perl:url-select:select_next
URxvt.keysym.M-Escape: perl:keyboard-select:activate
URxvt.keysym.M-s: perl:keyboard-select:search
URxvt.iso14755: False
URxvt.keysym.Shift-Control-C: perl:clipboard:copy
URxvt.keysym.Shift-Control-V: perl:clipboard:paste
URxvt*selectToClipboard: true
urxvt*transparent: true
urxvt*shading: 15
URxvt*buffered: true
URxvt*cursorBlink: true
URxvt*underlineColor: yellow
URxvt*font: xft:Ubuntu Mono:size=14:antialias=true
URxvt*depth: 32
URxvt*borderless: 1
URxvt*scrollBar: false
URxvt*loginShell: true
Urxvt*secondaryScroll: true # Enable Shift-PageUp/Down in screen
URxvt*saveLines: 500
URxvt*termName: rxvt-unicode
URxvt.keysym.Home: \033[1~
URxvt.keysym.End: \033[4~
URxvt.keysym.KP_Home: \033[1~
URxvt.keysym.KP_End: \033[4~
!! drop in Solarized colorscheme for Xresources/Xdefaults
!!SOLARIZED HEX 16/8 TERMCOL XTERM/HEX L*A*B RGB HSB
!!--------- ------- ---- ------- ----------- ---------- ----------- -----------
!!base03 #002b36 8/4 brblack 234 #1c1c1c 15 -12 -12 0 43 54 193 100 21
!!base02 #073642 0/4 black 235 #262626 20 -12 -12 7 54 66 192 90 26
!!base01 #586e75 10/7 brgreen 240 #585858 45 -07 -07 88 110 117 194 25 46
!!base00 #657b83 11/7 bryellow 241 #626262 50 -07 -07 101 123 131 195 23 51
!!base0 #839496 12/6 brblue 244 #808080 60 -06 -03 131 148 150 186 13 59
!!base1 #93a1a1 14/4 brcyan 245 #8a8a8a 65 -05 -02 147 161 161 180 9 63
!!base2 #eee8d5 7/7 white 254 #e4e4e4 92 -00 10 238 232 213 44 11 93
!!base3 #fdf6e3 15/7 brwhite 230 #ffffd7 97 00 10 253 246 227 44 10 99
!!yellow #b58900 3/3 yellow 136 #af8700 60 10 65 181 137 0 45 100 71
!!orange #cb4b16 9/3 brred 166 #d75f00 50 50 55 203 75 22 18 89 80
!!red #dc322f 1/1 red 160 #d70000 50 65 45 220 50 47 1 79 86
!!magenta #d33682 5/5 magenta 125 #af005f 50 65 -05 211 54 130 331 74 83
!!violet #6c71c4 13/5 brmagenta 61 #5f5faf 50 15 -45 108 113 196 237 45 77
!!blue #268bd2 4/4 blue 33 #0087ff 55 -10 -45 38 139 210 205 82 82
!!cyan #2aa198 6/6 cyan 37 #00afaf 60 -35 -05 42 161 152 175 74 63
!!green #859900 2/2 green 64 #5f8700 60 -20 65 133 153 0 68 100 60
#define S_base03 #002b36
#define S_base02 #073642
#define S_base01 #586e75
#define S_base00 #657b83
#define S_base0 #839496
#define S_base1 #93a1a1
#define S_base2 #eee8d5
#define S_base3 #fdf6e3
#define S_yellow #b58900
#define S_orange #cb4b16
#define S_red #dc322f
#define S_magenta #d33682
#define S_violet #6c71c4
#define S_blue #268bd2
#define S_cyan #2aa198
#define S_green #859900
URxvt*background: S_base03
URxvt*foreground: S_base00
URxvt*cursorColor: S_base1
URxvt*pointerColorBackground:S_base01
URxvt*pointerColorForeground:S_base1
!! black dark/light
URxvt*color0: S_base02
URxvt*color8: S_base03
!! red dark/light
URxvt*color1: S_red
URxvt*color9: S_orange
!! green dark/light
URxvt*color2: S_green
URxvt*color10: S_base01
!! yellow dark/light
URxvt*color3: S_yellow
URxvt*color11: S_base00
!! blue dark/light
URxvt*color4: S_blue
URxvt*color12: S_base0
!! magenta dark/light
URxvt*color5: S_magenta
URxvt*color13: S_violet
!! cyan dark/light
URxvt*color6: S_cyan
URxvt*color14: S_base1
!! white dark/light
URxvt*color7: S_base2
URxvt*color15: S_base3

9
gitconfig Normal file
View File

@ -0,0 +1,9 @@
[user]
name = Sanchayan Maity
email = maitysanchayan@gmail.com
[core]
editor = "emacsclient -t"
[color]
ui = auto
[sendemail]
smtpserver = /usr/bin/msmtp

215
i3/config Normal file
View File

@ -0,0 +1,215 @@
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout some time, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
set $mod Mod4
# Font for window titles. Will also be used by the bar unless a different font
# is used in the bar {} block below.
# This font is widely installed, provides lots of unicode glyphs, right-to-left
# text rendering and scalability on retina/hidpi displays (thanks to pango).
# font pango:DejaVu Sans Mono 8
font pango:Ubuntu-B 8
# Before i3 v4.8, we used to recommend this one as the default:
# font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
# The font above is very space-efficient, that is, it looks good, sharp and
# clear in small sizes. However, its unicode glyph coverage is limited, the old
# X core fonts rendering does not support right-to-left and this being a bitmap
# font, it doesnt scale on retina/hidpi displays.
# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod
# start a terminal
bindsym $mod+Return exec i3-sensible-terminal
# kill focused window
bindsym $mod+Shift+q kill
# start dmenu (a program launcher)
bindsym $mod+d exec dmenu_run
# 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
# installed.
# bindsym $mod+d exec --no-startup-id i3-dmenu-desktop
# change focus
bindsym $mod+j focus left
bindsym $mod+k focus down
bindsym $mod+l focus up
bindsym $mod+semicolon focus right
# alternatively, you can use the cursor keys:
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
# move focused window
bindsym $mod+Shift+j move left
bindsym $mod+Shift+k move down
bindsym $mod+Shift+l move up
bindsym $mod+Shift+semicolon move right
# alternatively, you can use the cursor keys:
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right
# split in horizontal orientation
bindsym $mod+h split h
# split in vertical orientation
bindsym $mod+v split v
# enter fullscreen mode for the focused container
bindsym $mod+f fullscreen
# change container layout (stacked, tabbed, toggle split)
bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split
# toggle tiling / floating
bindsym $mod+Shift+space floating toggle
# change focus between tiling / floating windows
bindsym $mod+space focus mode_toggle
# focus the parent container
bindsym $mod+a focus parent
# focus the child container
#bindsym $mod+d focus child
# switch to workspace 1-10
bindsym $mod+1 workspace 1
bindsym $mod+2 workspace 2
bindsym $mod+3 workspace 3
bindsym $mod+4 workspace 4
bindsym $mod+5 workspace 5
bindsym $mod+6 workspace 6
bindsym $mod+7 workspace 7
bindsym $mod+8 workspace 8
bindsym $mod+9 workspace 9
bindsym $mod+0 workspace 10
# switch to workspace 11-20
bindsym Mod1+1 workspace 11
bindsym Mod1+2 workspace 12
bindsym Mod1+3 workspace 13
bindsym Mod1+4 workspace 14
bindsym Mod1+5 workspace 15
bindsym Mod1+6 workspace 16
bindsym Mod1+7 workspace 17
bindsym Mod1+8 workspace 18
bindsym Mod1+9 workspace 19
bindsym Mod1+0 workspace 20
# move focused container to workspace
bindsym $mod+Shift+1 move container to workspace 1
bindsym $mod+Shift+2 move container to workspace 2
bindsym $mod+Shift+3 move container to workspace 3
bindsym $mod+Shift+4 move container to workspace 4
bindsym $mod+Shift+5 move container to workspace 5
bindsym $mod+Shift+6 move container to workspace 6
bindsym $mod+Shift+7 move container to workspace 7
bindsym $mod+Shift+8 move container to workspace 8
bindsym $mod+Shift+9 move container to workspace 9
bindsym $mod+Shift+0 move container to workspace 10
# reload the configuration file
bindsym $mod+Shift+c reload
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
bindsym $mod+Shift+r restart
# exit i3 (logs you out of your X session)
bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'"
# resize window (you can also use the mouse for that)
mode "resize" {
# These bindings trigger as soon as you enter the resize mode
# Pressing left will shrink the windows width.
# Pressing right will grow the windows width.
# Pressing up will shrink the windows height.
# Pressing down will grow the windows height.
bindsym j resize shrink width 10 px or 10 ppt
bindsym k resize grow height 10 px or 10 ppt
bindsym l resize shrink height 10 px or 10 ppt
bindsym semicolon resize grow width 10 px or 10 ppt
# same bindings, but for the arrow keys
bindsym Left resize shrink width 10 px or 10 ppt
bindsym Down resize grow height 10 px or 10 ppt
bindsym Up resize shrink height 10 px or 10 ppt
bindsym Right resize grow width 10 px or 10 ppt
# back to normal: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+r mode "resize"
# Start i3bar to display a workspace bar (plus the system information i3status
# finds out, if available)
bar {
status_command i3status
}
# ALSA Mixer based
#bindsym XF86AudioRaiseVolume exec amixer -q set Master 2%+ unmute
#bindsym XF86AudioLowerVolume exec amixer -q set Master 2%- unmute
#bindsym XF86AudioMute exec amixer -q set Master toggle
# Pulseaudio based
bindsym XF86AudioRaiseVolume exec pactl set-sink-volume 0 +5%
bindsym XF86AudioLowerVolume exec pactl set-sink-volume 0 -5%
bindsym XF86AudioMute exec pactl set-sink-mute 0 toggle
# Sreen brightness controls
bindsym XF86MonBrightnessUp exec xbacklight -inc 10 # increase screen brightness
bindsym XF86MonBrightnessDown exec xbacklight -dec 10 # decrease screen brightness
# Media player controls
bindsym XF86AudioPlay exec playerctl play
bindsym XF86AudioPause exec playerctl pause
bindsym XF86AudioNext exec playerctl next
bindsym XF86AudioPrev exec playerctl previous
# screen locker (first move to "safe" workspace without any chat app)
bindsym Control+Mod1+l exec i3-msg workspace 1 && i3lock -c 111111 -d -i ${HOME}/Pictures/matrixcode.png
exec --no-startup-id feh --bg-fill ${HOME}/Pictures/matrixcode.png
exec --no-startup-id /usr/bin/xrdb ${HOME}/.Xresources
exec --no-startup-id /usr/bin/urxvtd -q -f -o
# Move the current workspace to the next output
# (effectively toggles when you only have two outputs)
bindsym $mod+x move workspace to output right
set $Locker i3lock && sleep 1
set $mode_system System (l) lock, (e) logout, (s) suspend, (h) hibernate, (r) reboot, (Shift+s) shutdown
mode "$mode_system" {
bindsym l exec --no-startup-id $Locker, mode "default"
bindsym e exec --no-startup-id i3-msg exit, mode "default"
bindsym s exec --no-startup-id $Locker && shutdown -h now, mode "default"
bindsym h exec --no-startup-id $Locker && systemctl hibernate, mode "default"
bindsym r exec --no-startup-id systemctl reboot, mode "default"
bindsym Shift+s exec --no-startup-id systemctl poweroff -i, mode "default"
# back to normal: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+Shift+p mode "$mode_system"

186
imapfilter/config.lua Normal file
View File

@ -0,0 +1,186 @@
function main()
local sanchayan = IMAP {
server = 'imap.gmail.com',
username = 'maitysanchayan@gmail.com',
password = get_pwd_sanchayan(),
ssl = 'tls1',
}
local victor = IMAP {
server = 'imap.gmail.com',
username = 'victorascroft@gmail.com',
password = get_pwd_victor(),
ssl = 'tls1',
}
-- Make sure the account is configured properly
sanchayan.INBOX:check_status()
-- sanchayan['[Gmail]/Trash']:check_status()
-- sanchayan['[Gmail]/Spam']:check_status()
victor.INBOX:check_status()
-- victor['[Gmail]/Trash']:check_status()
-- victor['[Gmail]/Spam']:check_status()
-- Get all mail from INBOX
mails = sanchayan.INBOX:select_all()
-- Move mailing lists from INBOX to correct folders
move_mailing_lists(sanchayan, mails)
mails = victor.INBOX:select_all()
move_mailing_lists(victor, mails)
-- Get all mail from Sent Mail
mails = sanchayan.Sent:select_all()
-- Move mailing lists from Sent mail to correct folders
move_mailing_lists(sanchayan, mails)
mails = victor.Sent:select_all()
move_mailing_lists(victor, mails)
-- Get all mail from trash
mails = sanchayan['[Gmail]/Trash']:select_all()
imap_trash = sanchayan['Trash']:select_all()
-- Move mailing lists from trash to correct folders
move_to_gmail_trash(sanchayan, imap_trash, '[Gmail]/Trash')
delete_from_trash(sanchayan, mails)
mails = victor['[Gmail]/Trash']:select_all()
imap_trash = victor['Trash']:select_all()
-- Move mailing lists from trash to correct folders
move_to_gmail_trash(victor, imap_trash, '[Gmail]/Trash')
delete_from_trash(victor, mails)
-- Get all mail from spam
mails = sanchayan['[Gmail]/Spam']:select_all()
-- Move mailing lists from spam to correct folders
move_mailing_lists(sanchayan, mails)
mails = victor['[Gmail]/Spam']:select_all()
move_mailing_lists(victor, mails)
end
function move_mailing_lists(account, mails)
-- Stefan Agner
move_if_to_contains(account, mails, "stefan@agner.ch", "Stefan")
move_if_from_contains(account, mails, "stefan@agner.ch","Stefan")
move_if_cc_contains(account, mails, "stefan@agner.ch","Stefan")
move_if_to_contains(account, mails, "stefan.agner@toradex.com", "Stefan")
move_if_from_contains(account, mails, "stefan.agner@toradex.com","Stefan")
move_if_cc_contains(account, mails, "stefan.agner@toradex.com","Stefan")
--Barebox
move_if_to_contains(account, mails, "barebox@lists.infradead.org", "Barebox")
move_if_from_contains(account, mails, "barebox@lists.infradead.org","Barebox")
move_if_cc_contains(account, mails, "barebox@lists.infradead.org", "Barebox")
--Buildroot
move_if_to_contains(account, mails, "buildroot@busybox.net", "Buildroot")
move_if_from_contains(account, mails, "buildroot@busybox.net","Buildroot")
move_if_cc_contains(account, mails, "buildroot@busybox.net", "Buildroot")
move_if_to_contains(account, mails, "buildroot@buildroot.org", "Buildroot")
move_if_from_contains(account, mails, "buildroot@buildroot.org","Buildroot")
move_if_cc_contains(account, mails, "buildroot@buildroot.org", "Buildroot")
move_if_to_contains(account, mails, "buildroot@uclibc.org", "Buildroot")
move_if_from_contains(account, mails, "buildroot@uclibc.org","Buildroot")
move_if_cc_contains(account, mails, "buildroot@uclibc.org", "Buildroot")
-- Linux Kernel
move_if_to_contains(account, mails, "lists.infradead.org", "Linux Kernel")
move_if_from_contains(account, mails, "lists.infradead.org", "Linux Kernel")
move_if_cc_contains(account, mails, "lists.infradead.org", "Linux Kernel")
move_if_to_contains(account, mails, "vger.kernel.org", "Linux Kernel")
move_if_from_contains(account, mails, "vger.kernel.org", "Linux Kernel")
move_if_cc_contains(account, mails, "vger.kernel.org", "Linux Kernel")
-- U boot
move_if_to_contains(account, mails, "u-boot@lists.denx.de", "Uboot")
move_if_from_contains(account, mails, "u-boot@lists.denx.de", "Uboot")
move_if_cc_contains(account, mails, "u-boot@lists.denx.de", "Uboot")
-- Jobs
move_if_from_contains(account, mails, "monster.com","Jobs")
move_if_from_contains(account, mails, "naukri.com","Jobs")
-- OE
move_if_to_contains(account, mails, "openembedded-devel@lists.openembedded.org","Openembedded")
move_if_from_contains(account, mails, "openembedded-devel@lists.openembedded.org","Openembedded")
move_if_cc_contains(account, mails, "openembedded-devel@lists.openembedded.org","Openembedded")
-- Kernel Newbies
move_if_to_contains(account, mails, "kernelnewbies@kernelnewbies.org", "kernel newbies")
move_if_from_contains(account, mails, "kernelnewbies@kernelnewbies.org","kernel newbies")
move_if_cc_contains(account, mails, "kernelnewbies@kernelnewbies.org","kernel newbies")
end
function move_if_subject_contains(account, mails, subject, mailbox)
filtered = mails:contain_subject(subject)
filtered:move_messages(account[mailbox]);
end
function move_if_to_contains(account, mails, to, mailbox)
filtered = mails:contain_to(to)
filtered:move_messages(account[mailbox]);
end
function move_if_from_contains(account, mails, from, mailbox)
filtered = mails:contain_from(from)
filtered:move_messages(account[mailbox]);
end
function move_if_cc_contains(account, mails, cc, mailbox)
filtered = mails:contain_cc(cc)
filtered:move_messages(account[mailbox]);
end
function move_to_gmail_trash(account, mails, mailbox)
filtered = mails:select_all()
filtered:move_messages(account[mailbox])
end
function delete_mail_from(account, mails, from)
filtered = mails:contain_from(from)
filtered:delete_messages()
end
function delete_mail_if_subject_contains(account, mails, subject)
filtered = mails:contain_subject(subject)
filtered:delete_messages()
end
function delete_from_trash(account, mails)
filtered = mails:select_all()
filtered:delete_messages()
end
-- Utility function to get IMAP password from file
function get_imap_password(file)
local home = os.getenv("HOME")
local file = home .. "/" .. file
local str = io.open(file):read()
return str;
end
function get_pwd_victor()
local cmd = "gpg --quiet --for-your-eyes-only --no-tty --decrypt ~/.victor.gpg"
local fd = io.popen(cmd, 'r')
pass = fd:read("*a")
fd:close()
return pass;
end
function get_pwd_sanchayan()
local cmd = "gpg --quiet --for-your-eyes-only --no-tty --decrypt ~/.sanchayan.gpg"
local fd = io.popen(cmd, 'r')
pass = fd:read("*a")
fd:close()
return pass;
end
main() -- Call the main function

29
msmtprc Normal file
View File

@ -0,0 +1,29 @@
# echo "YourPassword" | gpg2 --encrypt --recipient "Your Name" -o ~/.mail-tudo-passwd.gpg
# Set default values for all following accounts.
defaults
port 587
protocol smtp
auth on
tls on
tls_trust_file /etc/ssl/certs/ca-certificates.crt
account Sanchayan
host smtp.gmail.com
from maitysanchayan@gmail.com
user maitysanchayan@gmail.com
passwordeval "gpg --quiet --for-your-eyes-only --no-tty --decrypt ~/.sanchayan.gpg"
account Victor
host smtp.gmail.com
from victorascroft@gmail.com
user victorascroft@gmail.com
passwordeval "gpg --quiet --for-your-eyes-only --no-tty --decrypt ~/.victor.gpg"
account Toradex
host smtp.office365.com
from sanchayan.maity@toradex.com
user sanchayan.maity@toradex.com
passwordeval "gpg --quiet --for-your-eyes-only --no-tty --decrypt ~/.toradex.gpg"
# Set a default account
account default : Sanchayan

View File

@ -0,0 +1,15 @@
set from = "maitysanchayan@gmail.com"
set sendmail = "/usr/bin/msmtp -a Sanchayan"
set mbox = "+Sanchayan/Archive"
set postponed = "+Sanchayan/Drafts"
set record = "+Sanchayan/Sent"
color status green default
macro index D \
"<save-message>+Sanchayan/Trash<enter>" \
"move message to the trash"
macro index S \
"<save-message>+Sanchayan/Spam<enter>" \
"mark message as spam"

View File

@ -0,0 +1,14 @@
set from = "sanchayan.maity@toradex.com"
set sendmail = "/usr/bin/msmtp -a Toradex"
set mbox = "+Toradex/archive"
set postponed = "+Toradex/drafts"
set record = "+Toradex/Sent"
macro index D \
"<save-message>+Toradex/Trash<enter>" \
"move message to the trash"
macro index S \
"<save-message>+Toradex/Spam<enter>" \
"mark message as spam"

View File

@ -0,0 +1,15 @@
set from = "victorascroft@gmail.com"
set sendmail = "/usr/bin/msmtp -a Victor"
set mbox = "+Victor/Archive"
set postponed = "+Victor/Drafts"
set record = "+Victor/Sent"
color status cyan default
macro index D \
"<save-message>+Victor/Trash<enter>" \
"move message to the trash"
macro index S \
"<save-message>+Victor/Spam<enter>" \
"mark message as spam"

1
mutt/.mutt/mailcap Normal file
View File

@ -0,0 +1 @@
text/html; lynx -assume_charset=%{charset} -display_charset=utf-8 -dump %s; nametemplate=%s.html; copiousoutput

17
mutt/.mutt/mailnotify.sh Executable file
View File

@ -0,0 +1,17 @@
#!/bin/bash
export DISPLAY=:0
let toradex_mail_count=`ls /home/sanchayan/Mail/Toradex/INBOX/new/|wc -l`
let stefan_mail_count=`ls /home/sanchayan/Mail/Sanchayan/Stefan/new/|wc -l`
let sanchayan_linux=`ls /home/sanchayan/Mail/Sanchayan/Linux\ Kernel/new/|wc -l`
if (("$toradex_mail_count" > 0)); then
/usr/bin/notify-send "You have $toradex_mail_count new mails in Toradex" --icon=dialog-information;
fi
if (("$stefan_mail_count" > 0)); then
/usr/bin/notify-send "You have $stefan_mail_count new mails in Stefan inbox" --icon=dialog-information;
fi
if (("$sanchayan_linux" > 0)); then
/usr/bin/notify-send "You have $sanchayan_linux new mails in Linux Kernel inbox" --icon=dialog-information;
fi

30
mutt/.mutt/mailrun.sh Executable file
View File

@ -0,0 +1,30 @@
#!/usr/bin/env bash
# Check every ten seconds if the process identified as $1 is still
# running. After 5 checks (~60 seconds), kill it. Return non-zero to
# indicate something was killed.
monitor() {
local pid=$1 i=0
while ps $pid &>/dev/null; do
if (( i++ > 3 )); then
echo "Max checks reached. Sending SIGKILL to ${pid}..." >&2
kill -9 $pid; return 1
fi
sleep 60
done
return 0
}
read -r pid < ~/.offlineimap/pid
if ps $pid &>/dev/null; then
echo "Process $pid already running. Exiting..." >&2
exit 1
fi
imapfilter
offlineimap -o -u quiet & monitor $!
#offlineimap -a Toradex -o -u quiet & monitor $!

@ -0,0 +1 @@
Subproject commit 3b23c55eb43849975656dd89e3f35dacd2b93e69

84
mutt/.mutt/muttrc Normal file
View File

@ -0,0 +1,84 @@
set mbox_type = Maildir
set spoolfile = "+Sanchayan/INBOX"
source ~/.mutt/accounts/sanchayan
folder-hook Sanchayan/* source ~/.mutt/accounts/sanchayan
folder-hook Victor/* source ~/.mutt/accounts/victor
folder-hook Toradex/* source ~/.mutt/accounts/toradex
set mail_check = 0
set envelope_from
unset move # gmail does that
set delete # don't ask, just do
unset confirmappend # don't ask, just do!
set quit # don't ask, just do!!
unset mark_old # read/new is good enough for me
# sort/threading
set sort = threads
set sort_aux = reverse-last-date-received
set sort_re
# look and feel
set pager_index_lines = 8
set pager_context = 5
set pager_stop
set menu_scroll
set smart_wrap
set tilde
unset markers
# composing
set fcc_attach
unset mime_forward
set forward_format = "Fwd: %s"
set include
set forward_quote
ignore * # first, ignore all headers
unignore from: to: cc: date: subject: # then, show only these
hdr_order from: to: cc: date: subject: # and in this order
source "~/.mutt/mutt-colors-solarized/mutt-colors-solarized-light-16.muttrc"
macro index 'c' '<change-folder>?<change-dir><home>^K=<enter>'
set send_charset="us-ascii:utf-8"
set send_charset="utf-8"
set editor="nano"
set date_format="%y-%m-%d %T"
set index_format="%2C | %Z [%d] %-30.30F (%-4.4c) %s"
folder-hook *[sS]ent* 'set index_format="%2C | %Z [%d] %-30.30t (%-4.4c) %s"'
folder-hook ! *[sS]ent* 'set index_format="%2C | %Z [%d] %-30.30F (%-4.4c) %s"'
set sleep_time = 0
set mailcap_path = ~/.mutt/mailcap
auto_view text/html
alternative_order text/plain text/html
## Abook
set query_command= "abook --mutt-query '%s'"
macro index,pager A "<pipe-message>abook --add-email-quiet<return>"
## Add this sender to Abook
bind editor <Tab> complete-query
set edit_headers = yes
# 'L' performs a notmuch query, showing only the results
macro index L "<enter-command>unset wait_key<enter><shell-escape>read -p 'notmuch query: ' x; echo \$x >~/.cache/mutt_terms<enter><limit>~i \"\`notmuch search --output=messages \$(cat ~/.cache/mutt_terms) | head -n 600 | perl -le '@a=<>;chomp@a;s/\^id:// for@a;$,=\"|\";print@a'\`\"<enter>" "show only messages matching a notmuch pattern"
# 'a' shows all messages again (supersedes default <alias> binding)
macro index a "<limit>all\n" "show all messages (undo limit)"
set header_cache=~/Mail/mutt_cache/ # a much faster opening of mailboxes...
macro index D "<save-message>+/ACCOUNT/[Gmail].Trash<enter>" "Move message to the trash"
source /etc/Muttrc.gpg.dist

15
mutt/accounts/sanchayan Normal file
View File

@ -0,0 +1,15 @@
set from = "maitysanchayan@gmail.com"
set sendmail = "/usr/bin/msmtp -a Sanchayan"
set mbox = "+Sanchayan/Archive"
set postponed = "+Sanchayan/Drafts"
set record = "+Sanchayan/Sent"
color status green default
macro index D \
"<save-message>+Sanchayan/Trash<enter>" \
"move message to the trash"
macro index S \
"<save-message>+Sanchayan/Spam<enter>" \
"mark message as spam"

14
mutt/accounts/toradex Normal file
View File

@ -0,0 +1,14 @@
set from = "sanchayan.maity@toradex.com"
set sendmail = "/usr/bin/msmtp -a Toradex"
set mbox = "+Toradex/archive"
set postponed = "+Toradex/drafts"
set record = "+Toradex/Sent"
macro index D \
"<save-message>+Toradex/Trash<enter>" \
"move message to the trash"
macro index S \
"<save-message>+Toradex/Spam<enter>" \
"mark message as spam"

15
mutt/accounts/victor Normal file
View File

@ -0,0 +1,15 @@
set from = "victorascroft@gmail.com"
set sendmail = "/usr/bin/msmtp -a Victor"
set mbox = "+Victor/Archive"
set postponed = "+Victor/Drafts"
set record = "+Victor/Sent"
color status cyan default
macro index D \
"<save-message>+Victor/Trash<enter>" \
"move message to the trash"
macro index S \
"<save-message>+Victor/Spam<enter>" \
"mark message as spam"

1
mutt/mailcap Normal file
View File

@ -0,0 +1 @@
text/html; lynx -assume_charset=%{charset} -display_charset=utf-8 -dump %s; nametemplate=%s.html; copiousoutput

17
mutt/mailnotify.sh Executable file
View File

@ -0,0 +1,17 @@
#!/bin/bash
export DISPLAY=:0
let toradex_mail_count=`ls /home/sanchayan/Mail/Toradex/INBOX/new/|wc -l`
let stefan_mail_count=`ls /home/sanchayan/Mail/Sanchayan/Stefan/new/|wc -l`
let sanchayan_linux=`ls /home/sanchayan/Mail/Sanchayan/Linux\ Kernel/new/|wc -l`
if (("$toradex_mail_count" > 0)); then
/usr/bin/notify-send "You have $toradex_mail_count new mails in Toradex" --icon=dialog-information;
fi
if (("$stefan_mail_count" > 0)); then
/usr/bin/notify-send "You have $stefan_mail_count new mails in Stefan inbox" --icon=dialog-information;
fi
if (("$sanchayan_linux" > 0)); then
/usr/bin/notify-send "You have $sanchayan_linux new mails in Linux Kernel inbox" --icon=dialog-information;
fi

30
mutt/mailrun.sh Executable file
View File

@ -0,0 +1,30 @@
#!/usr/bin/env bash
# Check every ten seconds if the process identified as $1 is still
# running. After 5 checks (~60 seconds), kill it. Return non-zero to
# indicate something was killed.
monitor() {
local pid=$1 i=0
while ps $pid &>/dev/null; do
if (( i++ > 3 )); then
echo "Max checks reached. Sending SIGKILL to ${pid}..." >&2
kill -9 $pid; return 1
fi
sleep 60
done
return 0
}
read -r pid < ~/.offlineimap/pid
if ps $pid &>/dev/null; then
echo "Process $pid already running. Exiting..." >&2
exit 1
fi
imapfilter
offlineimap -o -u quiet & monitor $!
#offlineimap -a Toradex -o -u quiet & monitor $!

@ -0,0 +1 @@
Subproject commit 3b23c55eb43849975656dd89e3f35dacd2b93e69

84
mutt/muttrc Normal file
View File

@ -0,0 +1,84 @@
set mbox_type = Maildir
set spoolfile = "+Sanchayan/INBOX"
source ~/.mutt/accounts/sanchayan
folder-hook Sanchayan/* source ~/.mutt/accounts/sanchayan
folder-hook Victor/* source ~/.mutt/accounts/victor
folder-hook Toradex/* source ~/.mutt/accounts/toradex
set mail_check = 0
set envelope_from
unset move # gmail does that
set delete # don't ask, just do
unset confirmappend # don't ask, just do!
set quit # don't ask, just do!!
unset mark_old # read/new is good enough for me
# sort/threading
set sort = threads
set sort_aux = reverse-last-date-received
set sort_re
# look and feel
set pager_index_lines = 8
set pager_context = 5
set pager_stop
set menu_scroll
set smart_wrap
set tilde
unset markers
# composing
set fcc_attach
unset mime_forward
set forward_format = "Fwd: %s"
set include
set forward_quote
ignore * # first, ignore all headers
unignore from: to: cc: date: subject: # then, show only these
hdr_order from: to: cc: date: subject: # and in this order
source "~/.mutt/mutt-colors-solarized/mutt-colors-solarized-light-16.muttrc"
macro index 'c' '<change-folder>?<change-dir><home>^K=<enter>'
set send_charset="us-ascii:utf-8"
set send_charset="utf-8"
set editor="nano"
set date_format="%y-%m-%d %T"
set index_format="%2C | %Z [%d] %-30.30F (%-4.4c) %s"
folder-hook *[sS]ent* 'set index_format="%2C | %Z [%d] %-30.30t (%-4.4c) %s"'
folder-hook ! *[sS]ent* 'set index_format="%2C | %Z [%d] %-30.30F (%-4.4c) %s"'
set sleep_time = 0
set mailcap_path = ~/.mutt/mailcap
auto_view text/html
alternative_order text/plain text/html
## Abook
set query_command= "abook --mutt-query '%s'"
macro index,pager A "<pipe-message>abook --add-email-quiet<return>"
## Add this sender to Abook
bind editor <Tab> complete-query
set edit_headers = yes
# 'L' performs a notmuch query, showing only the results
macro index L "<enter-command>unset wait_key<enter><shell-escape>read -p 'notmuch query: ' x; echo \$x >~/.cache/mutt_terms<enter><limit>~i \"\`notmuch search --output=messages \$(cat ~/.cache/mutt_terms) | head -n 600 | perl -le '@a=<>;chomp@a;s/\^id:// for@a;$,=\"|\";print@a'\`\"<enter>" "show only messages matching a notmuch pattern"
# 'a' shows all messages again (supersedes default <alias> binding)
macro index a "<limit>all\n" "show all messages (undo limit)"
set header_cache=~/Mail/mutt_cache/ # a much faster opening of mailboxes...
macro index D "<save-message>+/ACCOUNT/[Gmail].Trash<enter>" "Move message to the trash"
source /etc/Muttrc.gpg.dist

88
notmuch-config Normal file
View File

@ -0,0 +1,88 @@
# .notmuch-config - Configuration file for the notmuch mail system
#
# For more information about notmuch, see http://notmuchmail.org
# Database configuration
#
# The only value supported here is 'path' which should be the top-level
# directory where your mail currently exists and to where mail will be
# delivered in the future. Files should be individual email messages.
# Notmuch will store its database within a sub-directory of the path
# configured here named ".notmuch".
#
[database]
path=/home/sanchayan/Mail
# User configuration
#
# Here is where you can let notmuch know how you would like to be
# addressed. Valid settings are
#
# name Your full name.
# primary_email Your primary email address.
# other_email A list (separated by ';') of other email addresses
# at which you receive email.
#
# Notmuch will use the various email addresses configured here when
# formatting replies. It will avoid including your own addresses in the
# recipient list of replies, and will set the From address based on the
# address to which the original email was addressed.
#
[user]
name=Sanchayan Maity
primary_email=maitysanchayan@gmail.com
other_email=victorascroft@gmail.com;sanchayan.maity@toradex.com;
# Configuration for "notmuch new"
#
# The following options are supported here:
#
# tags A list (separated by ';') of the tags that will be
# added to all messages incorporated by "notmuch new".
#
# ignore A list (separated by ';') of file and directory names
# that will not be searched for messages by "notmuch new".
#
# NOTE: *Every* file/directory that goes by one of those
# names will be ignored, independent of its depth/location
# in the mail store.
#
[new]
tags=N;
ignore=
# Search configuration
#
# The following option is supported here:
#
# exclude_tags
# A ;-separated list of tags that will be excluded from
# search results by default. Using an excluded tag in a
# query will override that exclusion.
#
[search]
exclude_tags=deleted;spam;
# Maildir compatibility configuration
#
# The following option is supported here:
#
# synchronize_flags Valid values are true and false.
#
# If true, then the following maildir flags (in message filenames)
# will be synchronized with the corresponding notmuch tags:
#
# Flag Tag
# ---- -------
# D draft
# F flagged
# P passed
# R replied
# S unread (added when 'S' flag is not present)
#
# The "notmuch new" command will notice flag changes in filenames
# and update tags, while the "notmuch tag" and "notmuch restore"
# commands will notice tag changes and update flags in filenames
#
[maildir]
synchronize_flags=true

5
offlineimap.py Normal file
View File

@ -0,0 +1,5 @@
import subprocess
def mailpasswd(account):
path = "/home/sanchayan/.%s.gpg" % account
return subprocess.check_output(["gpg", "--quiet", "--batch", "-d", path]).strip()

61
offlineimaprc Normal file
View File

@ -0,0 +1,61 @@
[general]
ui = ttyui
accounts = Sanchayan,Victor,Toradex
fsync = false
pythonfile = ~/.offlineimap.py
[Account Sanchayan]
localrepository = Sanchayan-Local
remoterepository = Sanchayan-Remote
postsynchook = notmuch new
status_backend = sqlite
[Account Victor]
localrepository = Victor-Local
remoterepository = Victor-Remote
postsynchook =- notmuch new
status_backend = sqlite
[Account Toradex]
localrepository = Toradex-Local
remoterepository = Toradex-Remote
status_backend = sqlite
[Repository Sanchayan-Local]
type = Maildir
localfolders = ~/Mail/Sanchayan
[Repository Victor-Local]
type = Maildir
localfolders = ~/Mail/Victor
[Repository Toradex-Local]
type = Maildir
localfolders = ~/Mail/Toradex
[Repository Sanchayan-Remote]
type = Gmail
remoteuser = maitysanchayan@gmail.com
remotepasseval = mailpasswd("sanchayan")
realdelete = yes
sslcacertfile = /etc/ssl/certs/ca-certificates.crt
folderfilter = lambda foldername: foldername not in ['[Gmail]/All Mail','[Gmail]/Trash']
[Repository Victor-Remote]
type = Gmail
remoteuser = victorascroft@gmail.com
remotepasseval = mailpasswd("victor")
realdelete = yes
sslcacertfile = /etc/ssl/certs/ca-certificates.crt
folderfilter = lambda foldername: foldername not in ['[Gmail]/All Mail', '[Gmail]/Trash']
[Repository Toradex-Remote]
type = IMAP
remotehost = outlook.office365.com
remoteuser = sanchayan.maity@toradex.com
remotepasseval = mailpasswd("toradex")
realdelete = yes
sslcacertfile = /etc/ssl/certs/ca-certificates.crt
folderfilter = lambda folder: folder in ['INBOX', 'Sent']
postsynchook = notmuch new

301
spacemacs Normal file
View File

@ -0,0 +1,301 @@
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
(setq-default
;; Base distribution to use. This is a layer contained in the directory
;; `+distribution'. For now available distributions are `spacemacs-base'
;; or `spacemacs'. (default 'spacemacs)
dotspacemacs-distribution 'spacemacs
;; List of additional paths where to look for configuration layers.
;; Paths must have a trailing slash (i.e. `~/.mycontribs/')
dotspacemacs-configuration-layer-path '()
;; List of configuration layers to load. If it is the symbol `all' instead
;; of a list then all discovered layers will be installed.
dotspacemacs-configuration-layers
'(
;; ----------------------------------------------------------------
;; Example of useful layers you may want to use right away.
;; Uncomment some layer names and press <SPC f e R> (Vim style) or
;; <M-m f e R> (Emacs style) to install them.
;; ----------------------------------------------------------------
;; auto-completion
;; better-defaults
emacs-lisp
git
markdown
org
;; (shell :variables
;; shell-default-height 30
;; shell-default-position 'bottom)
;; spell-checking
;; syntax-checking
;; version-control
c-c++
clojure
gtags
latex
)
;; List of additional packages that will be installed without being
;; wrapped in a layer. If you need some configuration for these
;; packages then consider to create a layer, you can also put the
;; configuration in `dotspacemacs/config'.
dotspacemacs-additional-packages '()
;; A list of packages and/or extensions that will not be install and loaded.
dotspacemacs-excluded-packages '()
;; If non-nil spacemacs will delete any orphan packages, i.e. packages that
;; are declared in a layer which is not a member of
;; the list `dotspacemacs-configuration-layers'. (default t)
dotspacemacs-delete-orphan-packages t))
(defun dotspacemacs/init ()
"Initialization function.
This function is called at the very startup of Spacemacs initialization
before layers configuration.
You should not put any user code in there besides modifying the variable
values."
;; This setq-default sexp is an exhaustive list of all the supported
;; spacemacs settings.
(setq-default
;; One of `vim', `emacs' or `hybrid'. Evil is always enabled but if the
;; variable is `emacs' then the `holy-mode' is enabled at startup. `hybrid'
;; uses emacs key bindings for vim's insert mode, but otherwise leaves evil
;; unchanged. (default 'vim)
dotspacemacs-editing-style 'vim
;; If non nil output loading progress in `*Messages*' buffer. (default nil)
dotspacemacs-verbose-loading nil
;; Specify the startup banner. Default value is `official', it displays
;; the official spacemacs logo. An integer value is the index of text
;; banner, `random' chooses a random text banner in `core/banners'
;; directory. A string value must be a path to an image format supported
;; by your Emacs build.
;; If the value is nil then no banner is displayed. (default 'official)
dotspacemacs-startup-banner 'official
;; List of items to show in the startup buffer. If nil it is disabled.
;; Possible values are: `recents' `bookmarks' `projects'.
;; (default '(recents projects))
dotspacemacs-startup-lists '(recents projects)
;; List of themes, the first of the list is loaded when spacemacs starts.
;; Press <SPC> T n to cycle to the next theme in the list (works great
;; with 2 themes variants, one dark and one light)
dotspacemacs-themes '(monokai
spacemacs-dark
spacemacs-light
solarized-light
solarized-dark
leuven
zenburn)
;; If non nil the cursor color matches the state color.
dotspacemacs-colorize-cursor-according-to-state t
;; Default font. `powerline-scale' allows to quickly tweak the mode-line
;; size to make separators look not too crappy.
dotspacemacs-default-font '("Source Code Pro"
:size 13
:weight normal
:width normal
:powerline-scale 1.1)
;; The leader key
dotspacemacs-leader-key "SPC"
;; The leader key accessible in `emacs state' and `insert state'
;; (default "M-m")
dotspacemacs-emacs-leader-key "M-m"
;; Major mode leader key is a shortcut key which is the equivalent of
;; pressing `<leader> m`. Set it to `nil` to disable it. (default ",")
dotspacemacs-major-mode-leader-key ","
;; Major mode leader key accessible in `emacs state' and `insert state'.
;; (default "C-M-m)
dotspacemacs-major-mode-emacs-leader-key "C-M-m"
;; The command key used for Evil commands (ex-commands) and
;; Emacs commands (M-x).
;; By default the command key is `:' so ex-commands are executed like in Vim
;; with `:' and Emacs commands are executed with `<leader> :'.
dotspacemacs-command-key ":"
;; If non nil `Y' is remapped to `y$'. (default t)
dotspacemacs-remap-Y-to-y$ t
;; Location where to auto-save files. Possible values are `original' to
;; auto-save the file in-place, `cache' to auto-save the file to another
;; file stored in the cache directory and `nil' to disable auto-saving.
;; (default 'cache)
dotspacemacs-auto-save-file-location nil
;; If non nil then `ido' replaces `helm' for some commands. For now only
;; `find-files' (SPC f f), `find-spacemacs-file' (SPC f e s), and
;; `find-contrib-file' (SPC f e c) are replaced. (default nil)
dotspacemacs-use-ido nil
;; If non nil, `helm' will try to miminimize the space it uses. (default nil)
dotspacemacs-helm-resize nil
;; if non nil, the helm header is hidden when there is only one source.
;; (default nil)
dotspacemacs-helm-no-header nil
;; define the position to display `helm', options are `bottom', `top',
;; `left', or `right'. (default 'bottom)
dotspacemacs-helm-position 'bottom
;; If non nil the paste micro-state is enabled. When enabled pressing `p`
;; several times cycle between the kill ring content. (default nil)
dotspacemacs-enable-paste-micro-state nil
;; Which-key delay in seconds. The which-key buffer is the popup listing
;; the commands bound to the current keystroke sequence. (default 0.4)
dotspacemacs-which-key-delay 0.4
;; Which-key frame position. Possible values are `right', `bottom' and
;; `right-then-bottom'. right-then-bottom tries to display the frame to the
;; right; if there is insufficient space it displays it at the bottom.
;; (default 'bottom)
dotspacemacs-which-key-position 'bottom
;; If non nil a progress bar is displayed when spacemacs is loading. This
;; may increase the boot time on some systems and emacs builds, set it to
;; nil to boost the loading time. (default t)
dotspacemacs-loading-progress-bar t
;; If non nil the frame is fullscreen when Emacs starts up. (default nil)
;; (Emacs 24.4+ only)
dotspacemacs-fullscreen-at-startup nil
;; If non nil `spacemacs/toggle-fullscreen' will not use native fullscreen.
;; Use to disable fullscreen animations in OSX. (default nil)
dotspacemacs-fullscreen-use-non-native nil
;; If non nil the frame is maximized when Emacs starts up.
;; Takes effect only if `dotspacemacs-fullscreen-at-startup' is nil.
;; (default nil) (Emacs 24.4+ only)
dotspacemacs-maximized-at-startup nil
;; A value from the range (0..100), in increasing opacity, which describes
;; the transparency level of a frame when it's active or selected.
;; Transparency can be toggled through `toggle-transparency'. (default 90)
dotspacemacs-active-transparency 90
;; A value from the range (0..100), in increasing opacity, which describes
;; the transparency level of a frame when it's inactive or deselected.
;; Transparency can be toggled through `toggle-transparency'. (default 90)
dotspacemacs-inactive-transparency 90
;; If non nil unicode symbols are displayed in the mode line. (default t)
dotspacemacs-mode-line-unicode-symbols t
;; If non nil smooth scrolling (native-scrolling) is enabled. Smooth
;; scrolling overrides the default behavior of Emacs which recenters the
;; point when it reaches the top or bottom of the screen. (default t)
dotspacemacs-smooth-scrolling t
;; If non-nil smartparens-strict-mode will be enabled in programming modes.
;; (default nil)
dotspacemacs-smartparens-strict-mode nil
;; Select a scope to highlight delimiters. Possible values are `any',
;; `current', `all' or `nil'. Default is `all' (highlight any scope and
;; emphasis the current one). (default 'all)
dotspacemacs-highlight-delimiters 'all
;; If non nil advises quit functions to keep server open when quitting.
;; (default nil)
dotspacemacs-persistent-server nil
;; List of search tool executable names. Spacemacs uses the first installed
;; tool of the list. Supported tools are `ag', `pt', `ack' and `grep'.
;; (default '("ag" "pt" "ack" "grep"))
dotspacemacs-search-tools '("ag" "pt" "ack" "grep")
;; The default package repository used if no explicit repository has been
;; specified with an installed package.
;; Not used for now. (default nil)
dotspacemacs-default-package-repository nil
))
(defun dotspacemacs/user-init ()
"Initialization function for user code.
It is called immediately after `dotspacemacs/init'. You are free to put any
user code."
)
(defun dotspacemacs/user-config ()
"Configuration function for user code.
This function is called at the very end of Spacemacs initialization after
layers configuration. You are free to put any user code."
;(setq-default c-basic-offset 4 c-default-style "linux")
(setq-default tab-width 8 indent-tabs-mode t)
(global-set-key (kbd "TAB") 'self-insert-command)
(when (fboundp 'electric-indent-mode) (electric-indent-mode -1))
(global-auto-revert-mode t)
(windmove-default-keybindings)
(setq windmove-wrap-around t)
(setq TeX-view-program-selection '((output-pdf "Okular")))
(setq TeX-source-correlate-mode t)
(setq TeX-source-correlate-start-server t)
(setq TeX-source-correlate-method 'synctex)
(setq TeX-view-program-list
'(("Okular" "okular --unique %o#src:%n%b")))
(require 'desktop)
(defvar my-desktop-session-dir
(concat (getenv "HOME") "/.emacs.d/desktop-sessions/")
"*Directory to save desktop sessions in")
(defvar my-desktop-session-name-hist nil
"Desktop session name history")
(defun my-desktop-save (&optional name)
"Save desktop by name."
(interactive)
(unless name
(setq name (my-desktop-get-session-name "Save session" t)))
(when name
(make-directory (concat my-desktop-session-dir name) t)
(desktop-save (concat my-desktop-session-dir name) t)))
(defun my-desktop-save-and-clear ()
"Save and clear desktop."
(interactive)
(call-interactively 'my-desktop-save)
(desktop-clear)
(setq desktop-dirname nil))
(defun my-desktop-read (&optional name)
"Read desktop by name."
(interactive)
(unless name
(setq name (my-desktop-get-session-name "Load session")))
(when name
(desktop-clear)
(desktop-read (concat my-desktop-session-dir name))))
(defun my-desktop-change (&optional name)
"Change desktops by name."
(interactive)
(let ((name (my-desktop-get-current-name)))
(when name
(my-desktop-save name))
(call-interactively 'my-desktop-read)))
(defun my-desktop-name ()
"Return the current desktop name."
(interactive)
(let ((name (my-desktop-get-current-name)))
(if name
(message (concat "Desktop name: " name))
(message "No named desktop loaded"))))
(defun my-desktop-get-current-name ()
"Get the current desktop name."
(when desktop-dirname
(let ((dirname (substring desktop-dirname 0 -1)))
(when (string= (file-name-directory dirname) my-desktop-session-dir)
(file-name-nondirectory dirname)))))
(defun my-desktop-get-session-name (prompt &optional use-default)
"Get a session name."
(let* ((default (and use-default (my-desktop-get-current-name)))
(full-prompt (concat prompt (if default
(concat " (default " default "): ")
": "))))
(completing-read full-prompt (and (file-exists-p my-desktop-session-dir)
(directory-files my-desktop-session-dir))
nil nil nil my-desktop-session-name-hist default)))
(defun on-frame-open (frame)
(if (not (display-graphic-p frame))
(set-face-background 'default "unspecified-bg" frame)))
(on-frame-open (selected-frame))
(add-hook 'after-make-frame-functions 'on-frame-open)
(define-key global-map "\M-[1~" 'beginning-of-line)
(define-key global-map [select] 'end-of-line)
)
;; Do not write anything past this comment. This is where Emacs will
;; auto-generate custom variable definitions.