Compare commits
3 Commits
689289c410
...
newi3
| Author | SHA1 | Date | |
|---|---|---|---|
| 2d8eb5b31c | |||
| 174d4b1124 | |||
| c8a55f0f70 |
3
.config/nvim/init.vim
Normal file
3
.config/nvim/init.vim
Normal file
@@ -0,0 +1,3 @@
|
||||
set runtimepath^=~/.vim runtimepath+=~/.vim/after
|
||||
let &packpath=&runtimepath
|
||||
source ~/.vimrc
|
||||
@@ -21,7 +21,7 @@ ${exec ~/.i3/lemonbar/get_vol.sh} \
|
||||
${if_up wlp3s0}${downspeedf wlp3s0} ${upspeedf wlp3s0}\
|
||||
${else}down down${endif}\
|
||||
\
|
||||
${if_up enp2s0}${downspeedf enp2s0} ${upspeedf enp2s0}\
|
||||
${if_up enp5s0}${downspeedf enp2s0} ${upspeedf enp5s0}\
|
||||
${else}down down${endif}\
|
||||
\
|
||||
]]
|
||||
|
||||
@@ -20,7 +20,7 @@ ${cpu} \
|
||||
${mem} \
|
||||
${fs_used_perc /} \
|
||||
${fs_used_perc /home} \
|
||||
${exec ~/.i3/lemonbar/get_bat.sh} \
|
||||
${exec brillo} \
|
||||
F100 \
|
||||
100.00 \
|
||||
${exec /home/kuba/.i3/scripts/lang.sh show}
|
||||
]]
|
||||
|
||||
@@ -270,13 +270,13 @@ class i3Module(LemonModule):
|
||||
# Find out which output the workspace is on
|
||||
output = None # TODO actually use this information
|
||||
for output_ in i3ws.outputs:
|
||||
if output_['name'] == workspace['output']:
|
||||
if output_.name == workspace.output:
|
||||
output = output_
|
||||
break
|
||||
if not output:
|
||||
continue
|
||||
status = i3ws.state.get_state(workspace, output) # FOC or INA
|
||||
name = workspace['name'] # e.g. 5 terms
|
||||
name = workspace.name # e.g. 5 terms
|
||||
current = ''.join([parser.block(click=('i3-msg workspace' + name))
|
||||
, name, parser.block(click='')])
|
||||
if status == "FOC":
|
||||
|
||||
@@ -29,12 +29,12 @@ class State(object):
|
||||
urgent = 'URG'
|
||||
|
||||
def get_state(self, workspace, output):
|
||||
if workspace['focused']:
|
||||
if output['current_workspace'] == workspace['name']:
|
||||
if workspace.focused:
|
||||
if output.current_workspace == workspace.name:
|
||||
return self.focused
|
||||
else:
|
||||
return self.active
|
||||
if workspace['urgent']:
|
||||
if workspace.urgent:
|
||||
return self.urgent
|
||||
else:
|
||||
return self.inactive
|
||||
@@ -132,13 +132,13 @@ class i3ws(object):
|
||||
for workspace in workspaces:
|
||||
output = None
|
||||
for output_ in outputs:
|
||||
if output_['name'] == workspace['output']:
|
||||
if output_.name == workspace.output:
|
||||
output = output_
|
||||
break
|
||||
if not output:
|
||||
continue
|
||||
st = self.state.get_state(workspace, output)
|
||||
name = workspace['name'].replace(" ","___")
|
||||
name = workspace.name.replace(" ","___")
|
||||
item= self.ws_format % (st, name)
|
||||
out += item
|
||||
return self.end_format % out
|
||||
|
||||
22
.i3initrc
Normal file
22
.i3initrc
Normal file
@@ -0,0 +1,22 @@
|
||||
# Generate my i3 config based on hostname
|
||||
# Needs to be sourced by .xprofile (GDM) or .xinitrc (startx)
|
||||
|
||||
# Generate i3 config file
|
||||
i3config="/tmp/i3_${USER}_config"
|
||||
rm -f $i3config
|
||||
|
||||
if [ -f ~/.i3/base.config ]; then
|
||||
cat ~/.i3/base.config >> $i3config
|
||||
fi
|
||||
|
||||
if [ "`hostname`" = "kubaArch" ] && [ -f ~/.i3/home.config ]; then
|
||||
cat ~/.i3/home.config >> $i3config
|
||||
elif [ "`hostname`" = "kubaDesktop" ] && [ -f ~/.i3/home.config ]; then
|
||||
cat ~/.i3/home.config >> $i3config
|
||||
elif [ "`hostname`" = "JakubArch" ] && [ -f ~/.i3/work.config ]; then
|
||||
cat ~/.i3/work.config >> $i3config
|
||||
fi
|
||||
|
||||
#exec i3 -c $i3config -V >> ~/${WM}.log 2>&1
|
||||
sh ~/scripts/displays.sh auto
|
||||
exec i3 -c $i3config
|
||||
5
.vimrc
5
.vimrc
@@ -41,7 +41,10 @@ syntax on
|
||||
"
|
||||
" Set the filetype based on the file's extension, but only if
|
||||
" 'filetype' has not already been set
|
||||
au BufRead,BufNewFile *.config setfiletype conf
|
||||
augroup filetypedetect
|
||||
au BufRead,BufNewFile .i3initrc set filetype=sh
|
||||
au BufRead,BufNewFile *.config setfiletype conf
|
||||
augroup END
|
||||
|
||||
set tabstop=4 " show existing tab with 4 spaces width
|
||||
set shiftwidth=4 " when indenting with '>', use 4 spaces width
|
||||
|
||||
16
.xinitrc
16
.xinitrc
@@ -30,21 +30,7 @@ rm -f "~/${WM}.log"
|
||||
rm -f "~/${WM}.log"
|
||||
|
||||
if [ "$WM" = "i3" ]; then
|
||||
# Generate i3 config file
|
||||
i3config="/tmp/i3_${USER}_config"
|
||||
rm -f $i3config
|
||||
|
||||
if [ -f ~/.i3/base.config ]; then
|
||||
cat ~/.i3/base.config >> $i3config
|
||||
fi
|
||||
|
||||
if [ "`hostname`" = "kubaArch" ] && [ -f ~/.i3/home.config ]; then
|
||||
cat ~/.i3/home.config >> $i3config
|
||||
elif [ "`hostname`" = "JakubArch" ] && [ -f ~/.i3/work.config ]; then
|
||||
cat ~/.i3/work.config >> $i3config
|
||||
fi
|
||||
#exec i3 -c $i3config -V >> ~/${WM}.log 2>&1
|
||||
exec i3 -c $i3config
|
||||
. ~/.i3initrc
|
||||
else
|
||||
exec $WM >> "~/${WM}.log" 2>&1
|
||||
fi
|
||||
|
||||
@@ -1,21 +1,18 @@
|
||||
#!/bin/bash
|
||||
#$1 is -
|
||||
|
||||
#echo "DISP:eDP1"
|
||||
#exit 0
|
||||
|
||||
function primary() {
|
||||
xrandr | grep primary | awk '{print $1}'
|
||||
}
|
||||
|
||||
#displays=($(xrandr | sed -rn 's/(^|(.* ))([^ ]*) connected(( .*)|$)/\3/g; T; p' ))
|
||||
displays=$(xrandr | grep " connected" | awk '{print $1}')
|
||||
displays=$(xrandr --listactivemonitors | grep -v Monitors | awk '{print $NF}')
|
||||
case "$1" in
|
||||
"auto")
|
||||
echo "$displays" | while read display; do
|
||||
xrandr --output $display --auto
|
||||
done
|
||||
;;
|
||||
"connected")
|
||||
echo "$displays"
|
||||
# for i in "${displays[@]}"; do
|
||||
# echo "$i"
|
||||
# done
|
||||
;;
|
||||
"lemonbar")
|
||||
echo "DISP ${displays[@]}" | sed "s/ /:/g"
|
||||
|
||||
Reference in New Issue
Block a user