Browse Categories All Posts
Categories
K
Kai
Post Timeline
This PC
Timeline
Recycle Bin
kde maximize window no title

kde maximize window no title

 Edit the file ~/.config/kwinrc to add the line:

BorderlessMaximizedWindows=true 
 or

under the [Windows] section, so that it looks something like this:

[Windows]  

BorderlessMaximizedWindows=true 


kwin --replace
or  
kwin_x11 --replace
kwin_wayland --replace

pactl

pactl

pactl list sinks short | cut -f2

pactl list sources short | cut -f2

pactl list | grep -A2 'Source #' | grep 'Name: .*\.monitor$' | cut -d" " -f2 

windows copy file on same vs diff partition

windows copy file on same vs diff partition

 Let's compare to the two operations. First, copying a file from one partition to another:

  1. The source is opened.

  2. The destination is opened/created.

  3. Space is allocated for the destination.

  4. Every byte of file data is read from the source and written to the destination.

  5. The destination file is closed.

  6. The source file handle is set to unlink on close.

  7. The source file handle is closed, unlinking the file.

  8. Since that is (typically) the last reference to the source file data, the source file data has to be made free.

Now, copying a file from one folder to another on the same partition.

  1. The source is opened.

  2. A new hard link is created to the source file in the destination directory.

  3. The handle to the source file is set to unlink on close.

  4. The source handle is closed, unlinking it. The source file is still linked to the destination directory, so no free space needs to be changed.

     

    https://superuser.com/questions/424650/why-copying-files-in-one-partition-is-much-faster-than-copying-files-to-another

rofi-bluetooth control

rofi-bluetooth control

dependencies

sudo pacman -S rofi bluez-utils

sudo systemctl enable bluetooth

https://raw.githubusercontent.com/nickclyde/rofi-bluetooth/master/rofi-bluetooth


polybar config

[module/bluetooth]
type = custom/script
exec = rofi-bluetooth --status
interval = 1
click-left = rofi-bluetooth & 
 
i3 config
bindsym $mod+b exec --no-startup-id rofi-bluetooth 
polybar menu guide

polybar menu guide

 ------------------------------------------


it use like arrays :: '

; If true, <label-toggle> will be to the left of the menu items (default).
; If false, it will be on the right of all the items
"menu-LEVEL-N" has the same properties as "label-NAME" with
; the additional "exec" property
; Commands will be executed using "/bin/sh -c $COMMAND"
; Available tags:
;   <label-toggle> (default) - gets replaced with <label-(open|close)>
;   <menu> (default)
; If expand-right is true, the default will be "<label-toggle><menu>" and the
; other way around otherwise.
; Note that if you use <label-toggle> you must also include
; the definition for <label-open>
; format = <label-toggle><menu>  

first menu starts with 0 ::  

 [module/menxx]
type = custom/menu

expand-right = true

label-open =shortcut

label-close = close

---------------------------------------------------------------

syntax menu-LEVEL-N

#define first menu root menu it can be opened with  menu-open-0

menu-0-0 = menu1
menu-0-0-exec = menu-open-1

#define second  menu item
menu-0-1 = menu2
menu-0-1-exec = menu-open-2

#define third menu item
menu-0-2 = menu3
menu-0-2-exec= menu-open-3

#define Nth menu item

menu-0-(N-1) = menuN
menu-0-(N-1)-exec= menu-open-N

## define menu1 ###

menu-1-0 = cancel
menu-1-0-exec = menu-open-0
## on pressing this open root menu 

menu-1-1 = reboot
menu-1-1-exec =  reboot 

.......

......

menu-1-N=somelabel

menu-1-N-exec=someaction


##define menu2 ##

menu-2-0 = power off
menu-2-0-exec =  poweroff
menu-2-1 = cancel
menu-2-1-exec = menu-open-0

----

---

menu-2-N= somelabel

menu-2-N-exec= someaction

 

###define menu 3 ###

menu-3-0=simple terminal

menu-3-0-exec= st


---------------------------------------------------------------------------------------

powermenu

menu-0-0 = reboot
menu-0-0-exec = menu-open-1


menu-0-1 = power off
menu-0-1-exec = menu-open-2

menu-1-0 = cancel
menu-1-0-exec = menu-open-0


menu-1-1 = reboot
menu-1-1-exec =  reboot


menu-2-0 = power off
menu-2-0-exec =  poweroff


menu-2-1 = cancel
menu-2-1-exec = menu-open-0

---------------------------------

note 

1d didnt work i.e menu-0 xxx and menu-0-exec xxx didnt work 2d works

menu-0-0=st
menu-0-0-exec= st
menu-0-1=pavucontrol
menu-0-1-exec=pavucontrol

this works on single click

--------------------------------------

my polybar

[settings]
screenchange-reload = true
;compositing-background = xor
;compositing-background = screen
;compositing-foreground = source
;compositing-border = over
;pseudo-transparency = false

[colors]
#background = ${xrdb:color0:#222}
background = ${xrdb:background:#aa000000}
background-alt = ${xrdb:color8:#000}
;foreground = ${xrdb:color7:#222}
foreground = ${xrdb:foreground:#dfdfdf}
foreground-alt = ${xrdb:color7:#444}
primary = ${xrdb:color4:#ffb52a}
secondary = ${xrdb:color7:#e60053}
alert = ${xrdb:color1:#bd2c40}

[global/wm]
margin-top = 0
margin-bottom = 0

[bar/top]
;monitor = ${env:MONITOR:HDMI-1}
width = 100%
height = 30
offset-x = 0%
offset-y = 0
radius = 0
fixed-center = true
bottom=false
background = ${colors.background}
foreground = ${colors.foreground}
line-size = 3
line-color = #f00
border-size = 4
border-color = #00000000
padding-left = 0
padding-right = 2
module-margin-left = 1
module-margin-right = 2

font-0 = KoHo SemiBold:style=Regular:size=12;0
font-1 = Unifont:size=10:style=Medium;0
font-2 = FontAwesome:style=Regular:size=14
font-3 = Weather Icons:size=14;1
font-4 = Source Code Pro:size=14;0

modules-left = i3  xwindow
modules-center =  pulseaudio date xbacklight
modules-right = memory xkeyboard  wlan eth battery    powermenu

wm-restack = i3
;override-redirect = true
;scroll-up = i3wm-wsnext
;scroll-down = i3wm-wsprev
cursor-click = pointer
cursor-scroll = ns-resize


[module/dmenurecord]
type = custom/script
exec=cat /tmp/recordingicon
exec-if = [ -p /tmp/recordingicon ]

[module/xwindow]
type = internal/xwindow
label = %title:0:20:...%


[module/i3]
type = internal/i3
format = <label-state> <label-mode>
index-sort = true
wrapping-scroll = false
; Only show workspaces on the same output as the bar
;pin-workspaces = true
label-mode-padding = 2
label-mode-foreground = #000
label-mode-background = ${colors.primary}
; focused = Active workspace on focused monitor
label-focused = %index%
label-focused-background = ${colors.background-alt}
label-focused-underline= ${colors.primary}
label-focused-padding = 2
; unfocused = Inactive workspace on any monitor
label-unfocused = %index%
label-unfocused-padding = 2
; visible = Active workspace on unfocused monitor
label-visible = %index%
label-visible-background = ${self.label-focused-background}
label-visible-underline = ${self.label-focused-underline}
label-visible-padding = ${self.label-focused-padding}
; urgent = Workspace with urgency hint set
label-urgent = %index%
label-urgent-background = ${colors.alert}
label-urgent-padding = 2
; Separator in between workspaces
; label-separator = |



[module/xbacklight]
type = internal/backlight
card = intel_backlight
format = <ramp> <label>
label = %{A3:exec lxrandr:} %percentage%%%{A}
enable-scroll = true
ramp-0 = 🌕
ramp-1 = 🌔
ramp-2 = 🌓
ramp-3 = 🌒
ramp-4 = 🌑


[module/date]
type = internal/date
interval = 1
date =" %A %d %B %Y"
date-alt = " %m/%d"
time-alt = %I:%M %p
time = %I:%M:%S %p
format-prefix = 
format-prefix-foreground = ${colors.foreground-alt}
label = %date% %time%


[module/pulseaudio]
type = internal/pulseaudio
format-volume =  <ramp-volume> <label-volume>
label-volume = %percentage%%
label-volume-foreground = ${root.foreground}
label-muted =  muted
label-muted-foreground = ${xrdb:color7:#666}
ramp-volume-0 = 
ramp-volume-1 = 
ramp-volume-2 = 
click-right = pavucontrol

[module/memory]
type = internal/memory
label = RAM %gb_used%
; Seconds to sleep between updates
; Default: 1
interval = 3

[module/xkeyboard]
type = internal/xkeyboard
;blacklist-0 = num lock
format-prefix = " "
format-prefix-foreground = ${colors.foreground-alt}
format-prefix-underline = ${colors.secondary}
label-layout = %layout%
label-layout-underline = ${colors.secondary}
label-indicator-padding = 2
label-indicator-margin = 1
label-indicator-background = ${colors.secondary}
label-indicator-underline = ${colors.secondary}


[module/wlan]
type = internal/network
interface = wlan0
interval = 3.0
format-connected = <ramp-signal><label-connected>
format-connected-underline = #9f78e1
label-connected = %{A1:exec  st -e iwctl:} %essid% ↑%upspeed% ↓%downspeed% %{A}
ramp-signal-font = 2
ramp-signal-0 = 
ramp-signal-1 = 
ramp-signal-2 = 
ramp-signal-3 = 
ramp-signal-4 = 
ramp-signal-5 = 
ramp-signal-padding = 1
ramp-signal-foreground = ${colors.foreground-alt}
; ramp-signal-background = ${colors.background-alt}
format-disconnected =


[module/eth]
type = internal/network
interface = net0
interval = 10.0
format-connected-underline = #55aa55
format-connected-prefix = " "
format-connected-prefix-foreground = ${colors.foreground-alt}
label-connected = %local_ip%
format-disconnected =




[module/battery]
type = internal/battery
battery = BAT0
adapter = AC
full-at = 98
format-charging = <animation-charging> <label-charging>
format-charging-underline = ${xrdb:color6:#ffb52a}
format-discharging = <ramp-capacity> <label-discharging>
format-discharging-underline = ${xrdb:color3:#ff9800}
format-full-prefix =
format-full-prefix-foreground = ${colors.foreground-alt}
format-full-underline = ${xrdb:color2:#719611}
; Only applies if <ramp-capacity> is used
ramp-capacity-0 = 
ramp-capacity-1 = 
ramp-capacity-2 = 
ramp-capacity-3 = 
ramp-capacity-4 = 
; Only applies if <bar-capacity> is used
bar-capacity-width = 10
; Only applies if <animation-charging> is used
animation-charging-0 = 
animation-charging-1 = 
animation-charging-2 = 
animation-charging-3 = 
animation-charging-4 = 
; Framerate in milliseconds
animation-charging-framerate = 750


[module/powermenu]
type = custom/menu
expand-right = true
format-spacing = 1
label-open = X
label-open-foreground = ${colors.secondary}
label-close =  cancel
label-close-foreground = ${colors.secondary}
label-separator = |
label-separator-foreground = ${colors.foreground-alt}


menu-0-0 = reboot
menu-0-0-exec = menu-open-1
menu-0-1 = power off
menu-0-1-exec = menu-open-2

menu-1-0 = cancel
menu-1-0-exec = menu-open-0
menu-1-1 = reboot
menu-1-1-exec =  reboot
menu-2-0 = power off
menu-2-0-exec =  poweroff
menu-2-1 = cancel
menu-2-1-exec = menu-open-0



; vim:ft=dosini


i3-msg syntax

i3-msg syntax

  'move', 'exec', 'exit', 'restart', 'reload', 'shmlog', 'debuglog', 'border', 'layout', 'append_layout', 'workspace', 'focus', 'kill', 'open', 'fullscreen', 'sticky', 'split', 'floating', 'mark', 'unmark', 'resize', 'rename', 'nop', 'scratchpad', 'swap', 'title_format', 'mode', 'bar', 'gaps'

---------------------------------------------------

move::
 'window', 'container', 'to', '--no-auto-back-and-forth', 'workspace', 'output', 'mark', 'scratchpad', 'left', 'right', 'up', 'down', 'position', 'absolute'

exec::
 '--no-startup-id', <string>

exit::
close i3

restart::
restart i3

reload::
reload config file

shmlog::
string=log size

debuglog::

border::
 'normal', 'pixel', 'toggle', 'none', '1pixel'

layout::
'default', 'stacked', 'stacking', 'tabbed', 'splitv', 'splith', 'toggle'

append_layout::
<string>

workspace::
'--no-auto-back-and-forth', 'next_on_output', 'prev_on_output', 'next', 'prev', 'back_and_forth', 'number', <string>

focus::
'left', 'right', 'up', 'down', 'prev', 'next', 'output', 'tiling', 'floating', 'mode_toggle', 'parent', 'child', <end>

kill::
exit windiw

open::
new gap empty

fullscreen::
fullscreen window

sticky::
 'enable', 'disable', 'toggle'


split::
 'horizontal', 'vertical', 'toggle', 'v', 'h', 't'


floating::
'enable', 'disable', 'toggle'


mark::
 '--add', '--replace', '--toggle', <string>

unmark::

resize::
'grow', 'shrink', 'set'


rename::
workspace <word> to <word>

nop::
no operation

scratchpad::
show

swap
'container', 'with', 'id', 'con_id', 'mark'

title_format::
<string>

mode::
<string>

bar
 'hidden_state', 'mode'
hidden_state:: hide,show,toggle
mode:: 'dock', 'hide', 'invisible', 'toggle'

gaps
'inner', 'outer', 'horizontal', 'vertical', 'top',
'right', 'bottom', 'left'
    >>:: 'current', 'all'
        >>::'plus', 'minus', 'set', 'toggle'
nvim config bak

nvim config bak

---------------------------------------------------------------------------------------------------------------------------

set number

call plug#begin('~/.vim/plugged')
Plug 'dracula/vim'
Plug 'scrooloose/nerdtree'
Plug 'Xuyuanp/nerdtree-git-plugin'
Plug 'ryanoasis/vim-devicons'
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim'
Plug 'neoclide/coc.nvim', {'branch': 'release'}
let g:coc_global_extensions = ['coc-emmet', 'coc-css', 'coc-html', 'coc-json', 'coc-prettier', 'coc-tsserver']
call plug#end()

 if (has("termguicolors"))
     set termguicolors
 endif
 syntax enable
 colorscheme dracula
 
 let g:NERDTreeShowHidden = 1
 let g:NERDTreeMinimalUI = 1
 let g:NERDTreeIgnore = []
 let g:NERDTreeStatusline = ''
 let g:NERDTreeGitStatusIndicatorMapCustom = {
                    \ 'Modified'  :'✹',
                \ 'Staged'    :'✚',
                \ 'Untracked' :'✭',
                \ 'Renamed'   :'➜',
                \ 'Unmerged'  :'═',
                \ 'Deleted'   :'✖',
                \ 'Dirty'     :'✗',
                \ 'Ignored'   :'☒',
                \ 'Clean'     :'✔︎',
                \ 'Unknown'   :'?',
                \ }
 autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif  
  "  Toggle
nnoremap <silent> <C-b> :NERDTreeToggle<CR>
set splitright
set splitbelow
" turn terminal to normal mode with escape
tnoremap <Esc> <C-\><C-n>
" start terminal in insert mode
au BufEnter * if &buftype == 'terminal' | :startinsert | endif
" open terminal on ctrl+n
function! OpenTerminal()
  split term://bash
  resize 10
endfunction
nnoremap <c-n> :call OpenTerminal()<CR>
" use alt+hjkl to move between split/vsplit panels
tnoremap <A-h> <C-\><C-n><C-w>h
tnoremap <A-j> <C-\><C-n><C-w>j
tnoremap <A-k> <C-\><C-n><C-w>k
tnoremap <A-l> <C-\><C-n><C-w>l
nnoremap <A-h> <C-w>h
nnoremap <A-j> <C-w>j
nnoremap <A-k> <C-w>k
nnoremap <A-l> <C-w>l
"search
nnoremap <C-p> :FZF<CR>
let g:fzf_action = {
  \ 'ctrl-t': 'tab split',
  \ 'ctrl-s': 'split',
  \ 'ctrl-v': 'vsplit'
  \}
"tab completion for coc
inoremap <silent><expr> <TAB>
      \ pumvisible() ? "\<C-n>" :
      \ <SID>check_back_space() ? "\<TAB>" :
      \ coc#refresh()
inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"

autocmd filetype c nnoremap <F9> :w<CR> :!clear<CR> :!gcc % -o %< && ./%<<CR>
autocmd FileType python nnoremap <buffer> <F9> :w<CR>:exec '!python3' shellescape(@%, 1)<CR>