No more trailing spaces. Minor fixes. Start X automatically on tty1

This commit is contained in:
lanxu 2019-09-22 13:52:40 +03:00
parent 304cee8e85
commit 3553bc147f
4 changed files with 51 additions and 28 deletions

View File

@ -116,8 +116,13 @@ myawesomemenu = {
{ "quit", function() awesome.quit() end} { "quit", function() awesome.quit() end}
} }
lock = function() lock = function()
-- Sync disks before lock (just in case)
awful.util.spawn("sync") awful.util.spawn("sync")
awful.util.spawn("xautolock -locknow")
-- Lock screen
awful.util.spawn("xdg-screensaver lock")
--awful.util.spawn("xautolock -locknow")
--awful.util.spawn("xlock")
end end
mymainmenu = awful.menu({ items = { { "awesome", myawesomemenu, beautiful.awesome_icon }, mymainmenu = awful.menu({ items = { { "awesome", myawesomemenu, beautiful.awesome_icon },
{ "open terminal", terminal }, { "open terminal", terminal },
@ -280,7 +285,7 @@ awful.screen.connect_for_each_screen(function(s)
s.mylayoutbox, s.mylayoutbox,
} }
end end
-- Add widgets to the wibox -- Add widgets to the wibox
s.mywibox:setup { s.mywibox:setup {
layout = wibox.layout.align.horizontal, layout = wibox.layout.align.horizontal,
@ -406,8 +411,8 @@ client.focus:raise()
awful.key({ modkey }, "p", function() menubar.show() end, awful.key({ modkey }, "p", function() menubar.show() end,
{description = "show the menubar", group = "launcher"}), {description = "show the menubar", group = "launcher"}),
-- Menubar (dmenu) -- Menubar (dmenu)
awful.key({ modkey }, "d", awful.key({ modkey }, "d",
function() function()
--awful.spawn(string.format("dmenu_run -i -b -l 20 -fn 'Fura Code Nerd Font:size=10:style=Regular'")) --awful.spawn(string.format("dmenu_run -i -b -l 20 -fn 'Fura Code Nerd Font:size=10:style=Regular'"))
awful.spawn(string.format("rofi -show combi -combi-modi 'window,run,ssh' -modi combi")) awful.spawn(string.format("rofi -show combi -combi-modi 'window,run,ssh' -modi combi"))
end, end,
@ -512,25 +517,25 @@ for i = 1, 9 do
volume.update() volume.update()
end, end,
{description = "Lower audio volume", group = "audio"}), {description = "Lower audio volume", group = "audio"}),
awful.key({ any }, "XF86AudioMute", awful.key({ any }, "XF86AudioMute",
function() function()
awful.spawn(string.format("pactl set-sink-mute %s 1", volume.device)) awful.spawn(string.format("pactl set-sink-mute %s 1", volume.device))
volume.update() volume.update()
end, end,
{description = "mute audio", group = "audio"}), {description = "mute audio", group = "audio"}),
awful.key({ 'Shift' }, "XF86AudioMute", awful.key({ 'Shift' }, "XF86AudioMute",
function() function()
awful.spawn(string.format("pactl set-sink-mute %s 0", volume.device)) awful.spawn(string.format("pactl set-sink-mute %s 0", volume.device))
volume.update() volume.update()
end, end,
{description = "unmute audio", group = "audio"}), {description = "unmute audio", group = "audio"}),
awful.key({ }, "Print", awful.key({ }, "Print",
function () function ()
--local command = [[bash -c 'escrotum "$(xdg-user-dir PICTURES)/%Y-%m-%d_%T_screenshot.png"']] --local command = [[bash -c 'escrotum "$(xdg-user-dir PICTURES)/%Y-%m-%d_%T_screenshot.png"']]
for i=1,screen:count() do for i=1,screen:count() do
local command = "bash -c 'flameshot screen -n ".. i-1 .." -p \"$(xdg-user-dir PICTURES)/\"'" local command = "bash -c 'flameshot screen -n ".. i-1 .." -p \"$(xdg-user-dir PICTURES)/\"'"
awful.spawn.easy_async(command, function(stdout, stderr) awful.spawn.easy_async(command, function(stdout, stderr)
--naughty.notify { --naughty.notify {
-- title = "Screenshot saved!", -- title = "Screenshot saved!",
-- text = stdout, -- text = stdout,
--} --}
@ -539,12 +544,12 @@ for i = 1, 9 do
end, end,
{description = "Take screenshot", group = "video"}), {description = "Take screenshot", group = "video"}),
awful.key({ 'Shift' }, "Print", awful.key({ 'Shift' }, "Print",
function () function ()
--local command = [[bash -c 'escrotum "$(xdg-user-dir PICTURES)/%Y-%m-%d_%T_screenshot.png"']] --local command = [[bash -c 'escrotum "$(xdg-user-dir PICTURES)/%Y-%m-%d_%T_screenshot.png"']]
for i=1,screen:count() do for i=1,screen:count() do
local command = "bash -c 'flameshot gui -p \"$(xdg-user-dir PICTURES)/\"'" local command = "bash -c 'flameshot gui -p \"$(xdg-user-dir PICTURES)/\"'"
awful.spawn.easy_async(command, function(stdout, stderr) awful.spawn.easy_async(command, function(stdout, stderr)
--naughty.notify { --naughty.notify {
-- title = "Screenshot saved!", -- title = "Screenshot saved!",
-- text = stdout, -- text = stdout,
--} --}
@ -616,7 +621,7 @@ awful.rules.rules = {
role = { role = {
"pop-up", -- e.g. Google Chrome's (detached) Developer Tools. "pop-up", -- e.g. Google Chrome's (detached) Developer Tools.
} }
}, properties = { }, properties = {
floating = true floating = true
} }
}, },
@ -720,12 +725,13 @@ local function remove_client(tabl, c)
if index then if index then
table.remove(tabl, index) table.remove(tabl, index)
if #tabl == 0 then if #tabl == 0 then
awful.util.spawn("xset s blank")
awful.util.spawn("xset s on") awful.util.spawn("xset s on")
awful.util.spawn("xset +dpms") awful.util.spawn("xset +dpms")
naughty.notify({ preset = naughty.config.presets.low, naughty.notify({ preset = naughty.config.presets.low,
title = "DPMS information", title = "DPMS information",
text = "Display power management is now back ON"}) text = "Display power management is now back ON"})
end end
end end
end end
@ -733,9 +739,10 @@ client.connect_signal("property::fullscreen", function(c)
if c.fullscreen then if c.fullscreen then
table.insert(fullscreened_clients, c) table.insert(fullscreened_clients, c)
if #fullscreened_clients == 1 then if #fullscreened_clients == 1 then
awful.util.spawn("xset s noblank")
awful.util.spawn("xset s off") awful.util.spawn("xset s off")
awful.util.spawn("xset -dpms") awful.util.spawn("xset -dpms")
naughty.notify({ naughty.notify({
preset = naughty.config.presets.low, preset = naughty.config.presets.low,
title = "DPMS information", title = "DPMS information",
text = "Display power management is now OFF" text = "Display power management is now OFF"
@ -758,10 +765,9 @@ awful.util.spawn_with_shell("run-once nm-applet")
awful.util.spawn_with_shell("run-once 'nextcloud --background'") awful.util.spawn_with_shell("run-once 'nextcloud --background'")
awful.util.spawn_with_shell("run-once 'udiskie --tray --notify --automount'") awful.util.spawn_with_shell("run-once 'udiskie --tray --notify --automount'")
awful.util.spawn_with_shell("run-once 'mpd /home/lanxu/.config/mpd/mpd.conf'") awful.util.spawn_with_shell("run-once 'mpd /home/lanxu/.config/mpd/mpd.conf'")
awful.util.spawn_with_shell("run-once 'xscreensaver -no-splash'")
--awful.util.spawn_with_shell("run-once conky") --awful.util.spawn_with_shell("run-once conky")
--awful.util.spawn_with_shell("run-once dropboxd")
--awful.util.spawn_with_shell("run-once light-locker") --awful.util.spawn_with_shell("run-once light-locker")
--awful.util.spawn_with_shell("run-once xscreensaver -no-splash")
--awful.util.spawn_with_shell("run-once firefox-developer-edition") --awful.util.spawn_with_shell("run-once firefox-developer-edition")
--awful.util.spawn_with_shell("run-once firefox") --awful.util.spawn_with_shell("run-once firefox")

View File

@ -9,3 +9,5 @@ lain/
ranger/bookmarks ranger/bookmarks
ranger/history ranger/history
ranger/tagged ranger/tagged
i3blocks

34
.vimrc
View File

@ -15,8 +15,8 @@ Plug 'rust-lang/rust.vim', {'for': 'rust'}
"Plug 'racer-rust/vim-racer', {'for': 'rust'} "Plug 'racer-rust/vim-racer', {'for': 'rust'}
" Syntax checking " Syntax checking
Plug 'Valloric/YouCompleteMe' " alternative #1, full-blown "Plug 'Valloric/YouCompleteMe' " alternative #1, full-blown
"Plug 'w0rp/ale', Plug 'w0rp/ale',
" Useful plugins " Useful plugins
Plug 'Raimondi/delimitMate' Plug 'Raimondi/delimitMate'
@ -64,6 +64,8 @@ set autoindent " Automatically indent
set cindent " Indentation for c set cindent " Indentation for c
set number " Add line numbers set number " Add line numbers
set hlsearch " Highlight search set hlsearch " Highlight search
set modeline
set modelines=5
"set sessionoptions=blank,buffers,curdir,folds,globals,help,localoptions,options,resize,tabpages,winsize,winpos "set sessionoptions=blank,buffers,curdir,folds,globals,help,localoptions,options,resize,tabpages,winsize,winpos
set autochdir " Change directory automatically set autochdir " Change directory automatically
"set backupdir=~/.vim/temp/ " Save temporary backups to temp dir "set backupdir=~/.vim/temp/ " Save temporary backups to temp dir
@ -76,7 +78,7 @@ set autochdir " Change directory automatically
set colorcolumn=80 set colorcolumn=80
" Set GUI parameters " Set GUI parameters
if has("gui_running") if has("gui_running")
" GUI options. " GUI options.
set guioptions-=m " remove menu bar set guioptions-=m " remove menu bar
set guioptions-=T " remove toolbar set guioptions-=T " remove toolbar
set guioptions-=r " remove right-hand scroll bar set guioptions-=r " remove right-hand scroll bar
@ -86,7 +88,7 @@ if has("gui_running")
endif endif
" Keybindings " Keybindings
" Long list following " Long list following
" Indentation " Indentation
map <F7> mzgg=G`z map <F7> mzgg=G`z
map <F3> %s<cr> map <F3> %s<cr>
@ -142,15 +144,23 @@ let g:UltiSnipsJumpForwardTrigger="<c-b>"
let g:UltiSnipsJumpBackwardTrigger="<c-z>" let g:UltiSnipsJumpBackwardTrigger="<c-z>"
augroup lexical augroup lexical
autocmd! autocmd!
autocmd FileType markdown,mkd call lexical#init() autocmd FileType markdown,mkd call lexical#init()
autocmd FileType textile call lexical#init() autocmd FileType textile call lexical#init()
autocmd FileType text call lexical#init({ 'spell': 0 }) autocmd FileType text call lexical#init({ 'spell': 0 })
augroup END augroup END
let g:ale_linters = { let g:ale_linters = {
\ 'javascript': ['standard'], \'javascript': ['standard'],
\ 'vue': ['standard --plugin html "**/*.{js,vue}"'] \'vue': ['standard --plugin html "**/*.{js,vue}"'],
\} \'jsx': ['standard --plugin html "**/*.{js,jsx}"'],
let g:racer_experimental_completer = 1 \'rust': ['cargo']
\}
let b:ale_fixers = {
\'*': ['remove_trailing_lines', 'trim_whitespace'],
\'rust': ['rustfmt']
\}
let g:ale_fix_on_save = 1
let g:ale_completion_enabled = 1
set completeopt+=preview set completeopt+=preview

View File

@ -8,7 +8,7 @@ export PATH=$ANDROID_SDK_ROOT:$PATH
export PATH=$ANDROID_SDK_ROOT/tools:$PATH export PATH=$ANDROID_SDK_ROOT/tools:$PATH
export PATH=$ANDROID_SDK_ROOT/platform-tools:$PATH export PATH=$ANDROID_SDK_ROOT/platform-tools:$PATH
# Cocos and Ionic # Cocos and Ionic
export COCOS_CONSOLE_ROOT=${HOME}/Sovellukset/cocos2d-js-v3.6.1/tools/cocos2d-console/bin export COCOS_CONSOLE_ROOT=${HOME}/Sovellukset/cocos2d-js-v3.6.1/tools/cocos2d-console/bin
export IONIC_INSTALL=${HOME}/Asiakirjat/Work/Android/ionic/node_modules/.bin export IONIC_INSTALL=${HOME}/Asiakirjat/Work/Android/ionic/node_modules/.bin
export PATH=$IONIC_INSTALL:$COCOS_CONSOLE_ROOT:$PATH export PATH=$IONIC_INSTALL:$COCOS_CONSOLE_ROOT:$PATH
@ -56,3 +56,8 @@ export PATH="${HOME}/.cargo/bin:$PATH"
# Caffe # Caffe
export CAFFE_DIR="${HOME}/Koodit/github/caffe/build/install" export CAFFE_DIR="${HOME}/Koodit/github/caffe/build/install"
# Start X on tty1 automatically
if systemctl -q is-active graphical.target && [[ ! $DISPLAY && $XDG_VTNR -eq 1 ]]; then
exec startx
fi