commit 3a06751bb83867233a9afd8932a1fb64c53c93bd Author: Marat Date: Wed Sep 4 00:54:15 2024 +0600 first commit diff --git a/README.md b/README.md new file mode 100644 index 0000000..c63daa6 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +sudo ansible-playbook -i inventory --vault-password-file ~/.pass local.yml diff --git a/group_vars/all.yml b/group_vars/all.yml new file mode 100644 index 0000000..804856f --- /dev/null +++ b/group_vars/all.yml @@ -0,0 +1,215 @@ +main_user: + name: fs + +ssh_pub: !vault | + $ANSIBLE_VAULT;1.1;AES256 + 66653837363432653965336536613163613862383837633234363466663038303062346232656165 + 6566663330643338613762646561313861363361353338340a363938323933666262303961623530 + 32323833643361356261393436653062626134666665656262313938373634366333636135666565 + 3338343837626433620a373563346166626233613134386666613462316563383933366162353732 + 33623635313164346337303964376163356631373035323537666166303565363165393865616530 + 35623237656666616639363237626565663532376239316636323536653637316665373439636366 + 30363535353465616362636630643064323731306135613431636464383634613039303034306439 + 66316136313262396635636163623037343638353331383762646339646662653464666265393638 + 30633736623338323638663730373537366137343664653938633866343261363464396530353239 + 32633265393239353036653635303731626162346232386231333335333632646433326330623466 + 39343234626134653964643662636638383835303831363934363833636438623262643237656130 + 33373762323437383264313032343764313236326431646233373731633635623934306232663461 + 66636238326238636136646434626361303632393936336663666433363765323261636539333131 + 36626366383230306465613339376265303838386333383163383237643638663538396535613932 + 31626365316362376232376132663635353534613861613832333334356536633237326539633063 + 61323238613432393333316139363330626430656538616435623732663235613033313530643839 + 61653461323863353535393734393630376465313139663432393737643233393063366165343864 + 38663364396338373830313239363432636237613663333530303362333833653839626365336232 + 37626230323666373861656334316630613232363764353231663363343132353439386664336636 + 35393032636438356338326661396166663736343436636130643966363237623538323162323138 + 65643565666362313234613433653733366636623266333539343430623938373333333335623437 + 36313435633665303030623936353065343132303732386563646534326632363865306566643135 + 66666537646239633762333630326264373338303731323433333762626130653962653163663537 + 31363534656230363935373838666433363366356364363631353433323835336461363735373437 + 33383961383162396664333233646432316666626563623234663737666539356437666361303362 + 38623238643563633131633832393339626465626364343762653938626238366463323634626435 + 33373833613036393135366632336231323664663531353038623630343139316663376565663538 + 61373434323837663231613362383330383430666333613662643336363934386665663137386565 + 32666636343566656461663265386137316633626136353633313065656532353030303234306134 + 61643039633536373131383935363436633266326634616635636436663832613232616166633538 + 64663766386662636162666334343935343165663139363330623539323235313439356263666561 + 38616631616563633035343736333937636437633139393737313536663530353331353735373166 + 3435 + +ssh_private: !vault | + $ANSIBLE_VAULT;1.1;AES256 + 37643364396263626663383037343863666638303535643463616438663665303137396637366435 + 6465343866373132663564623765653838303738373038620a303732663832343863623739663438 + 35383438306364313839653637656532336463336433333962376538636137373733623361383866 + 3236643632663361310a383730346364366561656639363561653333316333373237613139666561 + 62623965623534633138353361316166326363386262656630356665376239303861633663653638 + 61623334303635666239306439633338376330343066653462613261363333333735346136313034 + 32343135306232333439396633313137366231326436356133306137333534306430353766313966 + 33313063626138663238313964373966346663626531653035303761393665336132393633343032 + 32393932323662613563393264326137353564306433616536346464313839646537303239313537 + 36373561306337313763643034303263363064343135616635306239303361666562363439623665 + 34343164343365313937383831323665383136663538366232363964643637616639353062323436 + 33636231343961663165666165393536353964373865656333376430363038636336306562613333 + 37316234393836396635363265646136663231313138666161383435653239343461336633343837 + 64363737383636666639313435653464633239353962353139656434623563373863633366343333 + 35356362383562326230386635623063663337393231366434633165336434363339303235626433 + 35666233666366393730656537653734326333343034343166653739326265333933663362613334 + 64393435643661396665303565363735633061356464366663376531656139393736313330356366 + 39303036333639386263393438346137323433383565353431623838313634396231313332303961 + 36316234353034386437356161613439393631353731383631323337316233626232316135396439 + 62373737353439306363656637396231313163333262633830623866653464353165343537393563 + 31386264626365326265316361353262363636633635636361303363313830393631613266323865 + 33663238626361623837383833353761343964363338356634663738643635313637313730396266 + 39356362393264326466353166383964663261373233333165353662383338373963343237386166 + 38663364363635626433396132333437313161386237656165363763643138626535393937633835 + 39363763643834646262623066613039643564666232356566663530383464616231363433636538 + 64316263356635633364303863376435363437653764343962396361656631623232666664383732 + 34336262653733353738393733323265353535636133653638626334326235653364363537373461 + 33336330656137376431396235343265393066353231353531306237393335613565633935316165 + 36363935653738386664626238613138333765353761306237333733613164613539306636383638 + 32303965356331316265393831366261333865633863633035343935636630393065373664313362 + 33353039363139343165323732666434663839393165363732626665656330633737636330363931 + 32656364353731303037373133366434663234663862343139383362333032383530643963353363 + 30643238303839643163363737663235326534393166373164363730306439616130626265393032 + 33316661613932333137303337343065636537303538623032336332353539346236613031666233 + 34336563353332316133663763353138386562373332626461366466653630656561653765333339 + 30386562353631623363616637643462383038386134376162393861383538623535636566646565 + 39343136353133303232393832316163356635653933613465376432616565356361353839636235 + 62363361383137376365313165613366386435636332373564353939623338666235303037303830 + 32663136653862646130636666323363636638666362613231383465373833333435383166393733 + 32616462303165633537393663333531363761643236333062353263333365656233343064613061 + 33376333396165633932343739343530396237303263383962353232396436623632666331363132 + 61326462363233363561313531643734626235643762393136613334383966383637366632633837 + 37323161333534333634313565373632343361643237393631643836616461303261323462663030 + 33303634356632353739633834336130396330633465353437663366366138323363356431626530 + 31613931663866383436373931336539303165343330313430336138646365383130623230373033 + 33303730626230643466643638323565646631636661356238643435653463343030303264613335 + 63353634333932633535646433313161643131333133363738316366366562313230626632343261 + 38353161393263326463643466643934356631386264656365613363303666376338323637343636 + 62346637383834303235656366613664343464333334323930613334323062643938333130633038 + 62396563313662306464336662643865323231613331616265653538646162323834643532383562 + 35393861313233323930333636356235643938316232343037363764653934613138306661656562 + 31643932663532323333613739333830316138353238383739626666313765643434303161653763 + 64313336363733353338313630383832393636323335313339373438343533393438376332626262 + 63643133656664313463623163633961613636343463326536363564356264353866313063386533 + 36323864663365613434333836616231366230643465383132303163386238323461613665636562 + 30333235646531303239383361633964393039663561623934353632613865373231663039656262 + 35653931333134343137653133393261316264353833373738346138633364316333656139613065 + 37613862366438633534633761336434343432373830653630326433343762356632623363383861 + 36306233363534356634373634303166636439656631633836613030623764323330643730313333 + 39383836323862643739613265633436333936373338356535643065343932383762303365373062 + 65326366653162643636663932393238356539643038376439616130353737626564653432366536 + 63366563653234666134626665396131303539386333336231386232346563393130383236376530 + 31353134666138386538643261323564323831373336303735383531383932343461336636616134 + 32633633313132333061343435343966323464626663656266356632646139353735643134303966 + 35373937643165313065393235313561303636326165636335373836613637396462616561323032 + 35383135346465366138333237666535656633373236383461343532636334363461323939316131 + 33353230373939393630663165653735313835303662306535623236353665353236323132306163 + 31353038626161636630623963653032376161353038663938363539303130303135316361326539 + 36386331306365323661386466636638336366653637303033333936376664346339316133306531 + 62626233336537636564396637323236633132383432316263656163653731663332373230626636 + 31356566653262643765323836353661626162336362333065616662316266306235356634313937 + 34323430306164386533613365303232373938323236666262666630303664633937633430323239 + 39336662666234643333653565383939623030333839393339653839313938343935393833326363 + 36363562643638633634663339326138656536626633656532633236613130313933393433613332 + 35353763643461663463383032646234653939363765666335646438636536623539656261613566 + 32376663333932346664643438383431373564623537656266333666623263346432636362316464 + 32633434363830623435393961643063613865323363326436326135303739383263393465376538 + 31653236613565386139343633386137316265623831643333663835666139373062306439626530 + 62633030663962313534313061383365613561326565376431313537653136396666663833393439 + 33616361323232376562613264636230646362666564386539336336366566626164323031333964 + 37336638383863366561623663373364366138666431656430326635316364643635633864313737 + 32616636363635626239663734623431353430323130386633346335336239616635666235346339 + 34353239383465653232666437326131313965333564353066363038343534323165326232653933 + 66343738393033623730366333303931666635316130346365396330336338346238613636633937 + 65346666313336303563366266393238643863376339376431613437366633373731346332353166 + 30343666333434663339333737326230663765346435343936323365303632313336623064353937 + 38613639646565313364636538663262393333363631303232633533376662616534633664623732 + 32353130323834626563653335613764616335326666303330616562613933376336616132323362 + 63656437356232363238633533633265376634336333366663396530386162393363633861623965 + 65343937663039333566333265356239383466393562636662353738633337373838393132643266 + 61633336353432336330333165613861336461326365636533383962383365643166613536393937 + 63393061356334383837643636376266363034333833386465323364643334386562356536323965 + 30313961643038343734366436656663643930376637396666383131306333633566366665316439 + 65666564663962356164306530393562303061336533646136323261346137316532646338373630 + 36616536633938633136396666326561323164623865306330653736663837323232366564626566 + 34613730363265343964343632633735383539393436613932333235326431356638353066356361 + 34316434306536653030626564346237653136333161346638656434396262643430316231363264 + 39333237383162623732356661623238333338353534333138326664616530613939313032643837 + 36613832346262386538393638393738626163393632353833323439393162393034653632643932 + 66616363303961306461343837383861323838303739666530323834363464343138653465333530 + 34396534346133393432663466386430326266653861366662393734656336663633383537313838 + 37316232313362373061346434376431393565646137306264323361333438376239323438633237 + 37346164306138633235346136396236356634653964383835353063656230363262373764396235 + 34396239613339626262376130623361643237363064353336643565623633396362323563623535 + 33623336656431653364656361623630373938343762373538353930656162363331353132366532 + 36633736326662373532323130313037303231356261383330313537336666303935303130613732 + 63633565343538396562393335306635336161396137633435346639333133636533643431313233 + 64623931373439336131383161303732396464623261393365663661666438376437666139643033 + 38363532363065613830356535346439386265626630396564626632386233633464356365653366 + 32396566306239393038356562343539613765356265333965666136346130653135393132633435 + 32656231363466656632336132656464376262623535323861333463643035393038363538663734 + 35353739633236373934326632376536333532663362393934396238396334316539366261376235 + 66366633343461343665396530656338396266623032333833366137343261633237643432366166 + 36633434623738366632643765353432613938336337356637386631303836333361613531653638 + 61353736343637613934376263343032353363383338323636363537636166653535653636396437 + 37653531303464336363303263643166396134376432636365663737363139356264343934393437 + 61313732323964616266336136313537373238313536336336313434303563383638333937303130 + 33626436636333323461303534306533373135656463373531363463663039336238346632346335 + 35303439353738366266393434356536646338366130333732303631613064636230316235643439 + 38383264396363646536336465333836306364386239636564393739393661356237333562333138 + 36616561626530653132646530356462616230356464643732306135373732356161323037633665 + 61636566393863303434343965666664383363663432323538663632353964383430336630373333 + 65366236393663336163396362336362333531663763623939353861643036313036353330393034 + 66383931636631393937663833366266303937646464323761303539646233646563363466343437 + 35633664303165623138323864373165636535333462643663336166346461636434326166633036 + 34363863373338376630613363636162383334626333333461366263393630303831643731383266 + 66383135353934656336643430393433373533303131613531343662303231393435373538626264 + 66393163656638363535663365306231303634616463306632313530303833373238623866343734 + 31626364333735643736666437653038343139613862333965636432363434323437656432376166 + 66333437316439663439626231343966336638373262373133323436363166613664643831396331 + 62616566306531383539643139646632333136303135326433643636336330383038363235646530 + 65366466616365616432663961383136363039623738376237663439353363313734643165376437 + 38323864353436373835313033346562666134373532316539373838656539356531 + +ssh_vpn_private: !vault | + $ANSIBLE_VAULT;1.1;AES256 + 63336265303234636366636531623433643432653131393430343064653133313763613865366163 + 6362306439613032303562386531613338613262633437380a653962323532623833363231616564 + 36313939373236303066376636656130393633653437353930356564623133663364663339376537 + 6665313766393865620a343965333932333866356465353364363265346632656436633132393334 + 65386232383337663835653433663961373466366462313862383430303836313931363064623666 + 66363330313861616534353561646664643966333634626530386634303661666363646433663237 + 65383266663933373638373035343065643632306663666633623361383834393333626132643534 + 37383563623363346638646234363635363336336462626235386566316131626135386666356564 + 31343263396339636234353830353035313839366463343764653931616162633531363464646530 + 39633132393531326537373234336164643638396633666133306266336538313961333735396538 + 30366335303837326265346266343965623566383064656130393163663635666239646631643535 + 65373434343430616662663930363738373962373765326637653230356563343634323038643536 + 30366234643734326162626131653039653730303564633738333963626263623037303864363966 + 38333264636539393538633836396665623531396261323563396466616562656161353664646438 + 37643566356139316565353562323630363135356432393232633534643064356135623961316463 + 38376632336261373763376238666530326436393763666130316430633732303331356566643533 + 38323631626661623037623461383161626635613132633863316561313936323237303564373262 + 65343261326132636639333232383962336235353664336138313730363464373531613938653064 + 39306262646234333663306161653533396266383164643063363463386532306238313935326430 + 39643062313536393936613730616339343332363562636237366365346532333665326161336132 + 62306263303231383364393433386637303435656365336137333562386630383833623636383338 + 66613365303836323838366461643230633965643462633932323634636438343866386533613364 + 31613639653531646632626334633031383431346238306635633135343031323138366337393165 + 65306336353261626563373166373539623035353861633736343036646330653637383363353963 + 37353463613230616361613461646635303139306561656437636464636432653238633861396565 + 3763656561343064373430643035386635326434653862353435 + +ssh_vpn_pub: !vault | + $ANSIBLE_VAULT;1.1;AES256 + 38666634666465353066356538393831396532666462333637653336633439623031666263313862 + 3965303035666432373633363632326235656462333033630a386264643263336333303466306138 + 64623531656336353735383238666665316566623934623230666232356263626437616139353265 + 3630396239316661340a346238623234346464646234666263303637613631306136353733336233 + 31386537353465316264333131643464643235663835613234396335373765633261666530393864 + 35323761373661383133653135653230373937616364353239623737626661333633626537636138 + 62646364376438626432623865616338333366326265353462623963393561386332633662356230 + 32646663346261613631333833313166396665663435333236646462666131643439313639306635 + 6137 diff --git a/inventory b/inventory new file mode 100644 index 0000000..53418ad --- /dev/null +++ b/inventory @@ -0,0 +1,5 @@ +[local] +localhost + +[local:vars] +display_server=wayland diff --git a/library/aur b/library/aur new file mode 100644 index 0000000..17045b4 --- /dev/null +++ b/library/aur @@ -0,0 +1,201 @@ +#!/usr/bin/python + +# The MIT License (MIT) +# +# Copyright (c) 2014 Austin Hyde +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +import os +import pwd +import platform + + +def cower_in_path(module): + """ + Determine if cower is available. + """ + rc, stdout, stderr = module.run_command('which cower', check_rc=False) + return rc == 0 + + +def pacman_in_path(module): + """ + Determine if pacman is available. + """ + rc, stdout, stderr = module.run_command('which pacman', check_rc=False) + return rc == 0 + + +def package_installed(module, pkg): + """ + Determine if a package is already installed. + """ + rc, stdout, stderr = module.run_command('pacman -Q %s' % pkg, check_rc=False) + return rc == 0 + + +def check_packages(module, pkgs): + """ + Inform the user what would change if the module were run. + """ + would_be_changed = [] + + for pkg in pkgs: + installed = package_installed(module, pkg) + if not installed: + would_be_changed.append(pkg) + + if would_be_changed: + module.exit_json(changed=True, msg='%s package(s) would be installed' % (len(would_be_changed))) + else: + module.exit_json(changed=False, msg='all packages are already installed') + + +def download_packages(module, pkgs, dir, user): + """ + Download the specified packages. + """ + # Use cower, if available. + if cower_in_path(module): + cmds = ['sudo -u %s cower -dqf %s', ] + # Otherwise, fall back to cURL + else: + cmds = ['sudo -u %s curl -O https://aur.archlinux.org/cgit/aur.git/snapshot/%s.tar.gz', + 'sudo -u %s tar xzf %s.tar.gz'] + for pkg in pkgs: + # If the package is already installed, skip the download. + if package_installed(module, pkg): + continue + # Change into the specified directory for download. + os.chdir(dir) + # Attempt to install the package. + for cmd in cmds: + rc, stdout, stderr = module.run_command(cmd % (user, pkg), check_rc=False) + if rc != 0: + module.fail_json(msg='failed to download package %s, because: %s' % (pkg,stderr)) + + +def install_packages(module, pkgs, dir, user, virtual): + """ + Install the specified packages via makepkg. + """ + num_installed = 0 + + if platform.machine().startswith('arm') or platform.machine().startswith('aarch64'): + makepkg_args = '-Acsrf' + else: + makepkg_args = '-csrf' + cmd = 'sudo -u %s PKGEXT=".pkg.tar" makepkg %s --noconfirm --needed --noprogressbar' % (user, makepkg_args) + if module.params['skip_pgp']: + cmd += ' --skippgpcheck' + for pkg in pkgs: + # If the package is already installed, skip the install. + if package_installed(module, pkg): + continue + + # Change into the package directory. + # Check if the package is a virtual package + if virtual: + os.chdir(os.path.join(dir, virtual)) + else: + os.chdir(os.path.join(dir, pkg)) + + # Attempt to build the directory. + rc, stdout, stderr = module.run_command(cmd, check_rc=False) + if rc != 0: + module.fail_json(msg='failed to build package %s, because: %s' % (pkg,stderr)) + + # If the package was succesfully built, install it. + rc, stdout, stderr = module.run_command('pacman -U --noconfirm *.pkg.tar*', check_rc=False, use_unsafe_shell=True) + if rc != 0: + module.fail_json(msg='failed to install package %s, because: %s' % (pkg,stderr)) + else: + num_installed += 1 + + # Exit with the number of packages succesfully installed. + if num_installed > 0: + module.exit_json(changed=True, msg='installed %s package(s)' % num_installed) + else: + module.exit_json(changed=False, msg='all packages were already installed') + + +def main(): + module = AnsibleModule( + argument_spec = dict( + name = dict(required=True, type='list'), + user = dict(required=True), + dir = dict(), + skip_pgp = dict(default=False, type='bool'), + virtual = dict(), + ), + supports_check_mode = True + ) + + # Fail of pacman is not available. + if not pacman_in_path(module): + module.fail_json(msg="could not locate pacman executable") + + p = module.params + + # Get all the requested package names. + pkgs = p['name'] + + # Fail if the specified user does not exist. + try: + pwd.getpwnam(p['user']) + except KeyError: + module.fail_json(msg="user %s does not exist" % p['user']) + else: + user = p['user'] + + # If no directory was given, assume the packages should be downloaded to + # ~user/aur. + if not p['dir']: + home = os.path.expanduser('~%s' % user) + if not os.path.exists(home): + module.fail_json(msg="%s's home directory %s does not exist" % (user, home)) + + dir = os.path.join(home, 'aur') + if not os.path.exists(dir): + os.makedirs(dir) + uid = pwd.getpwnam(user).pw_uid + os.chown(dir, uid, -1) + else: + dir = os.path.expanduser(p['dir']) + + # Fail if the specified directory does not exist. + if not os.path.exists(dir): + module.fail_json(msg="directory %s does not exist" % dir) + + if module.check_mode: + check_packages(module, pkgs) + + download_packages(module, pkgs, dir, user) + # Check if the package is virtual + if p['virtual']: + virtual = p['virtual'] + else: + virtual = False + + install_packages(module, pkgs, dir, user, virtual) + + +from ansible.module_utils.basic import * +main() diff --git a/local.yml b/local.yml new file mode 100644 index 0000000..893284e --- /dev/null +++ b/local.yml @@ -0,0 +1,8 @@ +--- +- hosts: localhost + connection: local + become: true + + roles: + # - dots + - packages diff --git a/roles/dots/files/config/kitty/ayu.conf b/roles/dots/files/config/kitty/ayu.conf new file mode 100644 index 0000000..871e1ec --- /dev/null +++ b/roles/dots/files/config/kitty/ayu.conf @@ -0,0 +1,22 @@ +#background #0F1419 +background #000000 +foreground #e5e1cf +cursor #f19618 +selection_background #243340 +color0 #000000 +color8 #323232 +color1 #ff3333 +color9 #ff6565 +color2 #b8cc52 +color10 #e9fe83 +color3 #e6c446 +color11 #fff778 +color4 #36a3d9 +color12 #68d4ff +color5 #f07078 +color13 #ffa3aa +color6 #95e5cb +color14 #c7fffc +color7 #ffffff +color15 #ffffff +selection_foreground #0e1419 diff --git a/roles/dots/files/config/kitty/black-metal.conf b/roles/dots/files/config/kitty/black-metal.conf new file mode 100644 index 0000000..4593f6e --- /dev/null +++ b/roles/dots/files/config/kitty/black-metal.conf @@ -0,0 +1,32 @@ +# BlackMetal by metalelf0, https://github.com/metalelf0 +# This schemes are available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT). + +selection_foreground #000000 +selection_background #ffffff + +foreground #ffffff +background #000000 + +color0 #000000 +color1 #5f8787 +color2 #dd9999 +color3 #a06666 +color4 #888888 +color5 #999999 +color6 #aaaaaa +color7 #c1c1c1 +color8 #333333 +color9 #5f8787 +color10 #dd9999 +color11 #a06666 +color12 #888888 +color13 #999999 +color14 #aaaaaa +color15 #c1c1c1 + +active_tab_foreground #ffffff +active_tab_background #000000 +inactive_tab_foreground #666666 +inactive_tab_background #000000 + +active_border_color #ffffff diff --git a/roles/dots/files/config/kitty/black_metal.conf b/roles/dots/files/config/kitty/black_metal.conf new file mode 100644 index 0000000..4593f6e --- /dev/null +++ b/roles/dots/files/config/kitty/black_metal.conf @@ -0,0 +1,32 @@ +# BlackMetal by metalelf0, https://github.com/metalelf0 +# This schemes are available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT). + +selection_foreground #000000 +selection_background #ffffff + +foreground #ffffff +background #000000 + +color0 #000000 +color1 #5f8787 +color2 #dd9999 +color3 #a06666 +color4 #888888 +color5 #999999 +color6 #aaaaaa +color7 #c1c1c1 +color8 #333333 +color9 #5f8787 +color10 #dd9999 +color11 #a06666 +color12 #888888 +color13 #999999 +color14 #aaaaaa +color15 #c1c1c1 + +active_tab_foreground #ffffff +active_tab_background #000000 +inactive_tab_foreground #666666 +inactive_tab_background #000000 + +active_border_color #ffffff diff --git a/roles/dots/files/config/kitty/current-theme.conf b/roles/dots/files/config/kitty/current-theme.conf new file mode 100644 index 0000000..716499a --- /dev/null +++ b/roles/dots/files/config/kitty/current-theme.conf @@ -0,0 +1,33 @@ +## name: Gruvbox Light +## author: Pavel Pertsev +## license: MIT/X11 +## upstream: https://raw.githubusercontent.com/gruvbox-community/gruvbox-contrib/master/kitty/gruvbox-light.conf + + +selection_foreground #3c3836 +selection_background #d65d0e + +background #fbf1c7 +foreground #3c3836 + +color0 #ebdbb2 +color1 #cc241d +color2 #98971a +color3 #d79921 +color4 #458588 +color5 #b16286 +color6 #689d6a +color7 #7c6f64 +color8 #928374 +color9 #9d0006 +color10 #79740e +color11 #b57614 +color12 #076678 +color13 #8f3f71 +color14 #427b58 +color15 #282828 + +cursor #665c54 +cursor_text_color #bdae93 + +url_color #458588 diff --git a/roles/dots/files/config/kitty/dracula.conf b/roles/dots/files/config/kitty/dracula.conf new file mode 100644 index 0000000..1462fb6 --- /dev/null +++ b/roles/dots/files/config/kitty/dracula.conf @@ -0,0 +1,36 @@ +# vim:ft=kitty +## name: Dracula +## author: Keegan Carruthers-Smith +## license: MIT +## upstream: https://raw.githubusercontent.com/dracula/kitty/master/dracula.conf + +foreground #f8f8f2 +# background #282a36 +background #292A35 +selection_foreground #ffffff +selection_background #44475a +url_color #8be9fd +color0 #21222c +color8 #6272a4 +color1 #ff5555 +color9 #ff6e6e +color2 #50fa7b +color10 #69ff94 +color3 #f1fa8c +color11 #ffffa5 +color4 #bd93f9 +color12 #d6acff +color5 #ff79c6 +color13 #ff92df +color6 #8be9fd +color14 #a4ffff +color7 #f8f8f2 +color15 #ffffff +cursor #f8f8f2 +cursor_text_color background +active_tab_foreground #282a36 +active_tab_background #f8f8f2 +inactive_tab_foreground #282a36 +inactive_tab_background #6272a4 +mark1_foreground #282a36 +mark1_background #ff5555 diff --git a/roles/dots/files/config/kitty/everforset-theme.conf b/roles/dots/files/config/kitty/everforset-theme.conf new file mode 100644 index 0000000..f2e95e8 --- /dev/null +++ b/roles/dots/files/config/kitty/everforset-theme.conf @@ -0,0 +1,70 @@ +# vim:ft=kitty +## name: Everforest Dark Hard +## author: Sainnhe Park +## license: MIT +## upstream: https://github.com/ewal/kitty-everforest/blob/master/themes/everforest_dark_hard.conf +## blurb: A green based color scheme designed to be warm and soft + +foreground #d3c6aa +background #272e33 +selection_foreground #9da9a0 +selection_background #4c3743 + +cursor #d3c6aa +cursor_text_color #2e383c + +url_color #7fbbb3 + +active_border_color #a7c080 +inactive_border_color #4f5b58 +bell_border_color #e69875 +visual_bell_color none + +wayland_titlebar_color system +macos_titlebar_color system + +active_tab_background #272e33 +active_tab_foreground #d3c6aa +inactive_tab_background #374145 +inactive_tab_foreground #9da9a0 +tab_bar_background #2e383c +tab_bar_margin_color none + +mark1_foreground #272e33 +mark1_background #7fbbb3 +mark2_foreground #272e33 +mark2_background #d3c6aa +mark3_foreground #272e33 +mark3_background #d699b6 + +#: black +color0 #343f44 +color8 #3d484d + +#: red +color1 #e67e80 +color9 #e67e80 + +#: green +color2 #a7c080 +color10 #a7c080 + +#: yellow +color3 #dbbc7f +color11 #dbbc7f + +#: blue +color4 #7fbbb3 +color12 #7fbbb3 + +#: magenta +color5 #d699b6 +color13 #d699b6 + +#: cyan +color6 #83c092 +color14 #83c092 + +#: white +color7 #859289 +color15 #9da9a0 diff --git a/roles/dots/files/config/kitty/gruvbox.conf b/roles/dots/files/config/kitty/gruvbox.conf new file mode 100644 index 0000000..b93d4a8 --- /dev/null +++ b/roles/dots/files/config/kitty/gruvbox.conf @@ -0,0 +1,32 @@ +## name: Gruvbox Dark +## author: Pavel Pertsev +## license: MIT/X11 +## upstream: https://raw.githubusercontent.com/gruvbox-community/gruvbox-contrib/master/kitty/gruvbox-dark.conf + +selection_foreground #ebdbb2 +selection_background #d65d0e + +background #282828 +foreground #ebdbb2 + +color0 #3c3836 +color1 #cc241d +color2 #98971a +color3 #d79921 +color4 #458588 +color5 #b16286 +color6 #689d6a +color7 #a89984 +color8 #928374 +color9 #fb4934 +color10 #b8bb26 +color11 #fabd2f +color12 #83a598 +color13 #d3869b +color14 #8ec07c +color15 #fbf1c7 + +cursor #bdae93 +cursor_text_color #665c54 + +url_color #458588 diff --git a/roles/dots/files/config/kitty/gruvbox_light.conf b/roles/dots/files/config/kitty/gruvbox_light.conf new file mode 100644 index 0000000..716499a --- /dev/null +++ b/roles/dots/files/config/kitty/gruvbox_light.conf @@ -0,0 +1,33 @@ +## name: Gruvbox Light +## author: Pavel Pertsev +## license: MIT/X11 +## upstream: https://raw.githubusercontent.com/gruvbox-community/gruvbox-contrib/master/kitty/gruvbox-light.conf + + +selection_foreground #3c3836 +selection_background #d65d0e + +background #fbf1c7 +foreground #3c3836 + +color0 #ebdbb2 +color1 #cc241d +color2 #98971a +color3 #d79921 +color4 #458588 +color5 #b16286 +color6 #689d6a +color7 #7c6f64 +color8 #928374 +color9 #9d0006 +color10 #79740e +color11 #b57614 +color12 #076678 +color13 #8f3f71 +color14 #427b58 +color15 #282828 + +cursor #665c54 +cursor_text_color #bdae93 + +url_color #458588 diff --git a/roles/dots/files/config/kitty/kitty.conf b/roles/dots/files/config/kitty/kitty.conf new file mode 100644 index 0000000..f39e15a --- /dev/null +++ b/roles/dots/files/config/kitty/kitty.conf @@ -0,0 +1,33 @@ +font_size 12 +font_family JetBrainsMonoNl Nerd Font Mono +# font_family Firacode Nerd Font +bold_font auto +italic_font auto +bold_italic_font auto + +# brackground_opacity 1 +background_opacity 0.91 +window_padding_width 15 +allow_remote_control yes +enable_audio_bell no +url_style single +tab_bar_style powerline +hide_window_decorations yes + +map ctrl+o copy_to_clipboard +map ctrl+m paste_from_clipboard +# map ctrl+K cancel + + +# BEGIN_KITTY_THEME +# Gruvbox Light +# include current-theme.conf +# include solarized_light.conf +# include ayu.conf +# iinclude tomorrow-night.conf +include gruvbox.conf +# include everforset-theme.conf +# include nord.conf +# include everforset-theme.conf +# include solarized_light.conf +# END_KITTY_THEME diff --git a/roles/dots/files/config/kitty/kitty.conf.bak b/roles/dots/files/config/kitty/kitty.conf.bak new file mode 100644 index 0000000..f1156dd --- /dev/null +++ b/roles/dots/files/config/kitty/kitty.conf.bak @@ -0,0 +1,25 @@ +font_size 16 +font_family JetBrainsMonoNl Nerd Font Mono +# font_family Firacode Nerd Font +bold_font auto +italic_font auto +bold_italic_font auto + +# background_opacity 0.9 +background_opacity 1 +window_padding_width 15 +allow_remote_control yes +enable_audio_bell no +url_style single +tab_bar_style powerline +hide_window_decorations yes + +map ctrl+o copy_to_clipboard +map ctrl+m paste_from_clipboard +# map ctrl+K cancel + + +# BEGIN_KITTY_THEME +# Solarized Light +include current-theme.conf +# END_KITTY_THEME diff --git a/roles/dots/files/config/kitty/kitty_note b/roles/dots/files/config/kitty/kitty_note new file mode 100644 index 0000000..187a666 --- /dev/null +++ b/roles/dots/files/config/kitty/kitty_note @@ -0,0 +1,2 @@ +# set theme +kitty +kitten themes --reload-in=all Nord diff --git a/roles/dots/files/config/kitty/nord-theme.conf b/roles/dots/files/config/kitty/nord-theme.conf new file mode 100644 index 0000000..f48ac3d --- /dev/null +++ b/roles/dots/files/config/kitty/nord-theme.conf @@ -0,0 +1,50 @@ +# vim:ft=kitty +## name: Nord +## author: Connor Holyday +## license: MIT +## upstream: https://raw.githubusercontent.com/connorholyday/nord-kitty/master/nord.conf +## blurb: An arctic, north-bluish clean and elegant Kitty theme. + +# Nord Colorscheme for Kitty +# Based on: +# - https://gist.github.com/marcusramberg/64010234c95a93d953e8c79fdaf94192 +# - https://github.com/arcticicestudio/nord-hyper + +foreground #D8DEE9 +background #2E3440 +selection_foreground #000000 +selection_background #FFFACD +url_color #0087BD +cursor #81A1C1 + +# black +color0 #3B4252 +color8 #4C566A + +# red +color1 #BF616A +color9 #BF616A + +# green +color2 #A3BE8C +color10 #A3BE8C + +# yellow +color3 #EBCB8B +color11 #EBCB8B + +# blue +color4 #81A1C1 +color12 #81A1C1 + +# magenta +color5 #B48EAD +color13 #B48EAD + +# cyan +color6 #88C0D0 +color14 #8FBCBB + +# white +color7 #E5E9F0 +color15 #ECEFF4 diff --git a/roles/dots/files/config/kitty/nord.conf b/roles/dots/files/config/kitty/nord.conf new file mode 100644 index 0000000..f48ac3d --- /dev/null +++ b/roles/dots/files/config/kitty/nord.conf @@ -0,0 +1,50 @@ +# vim:ft=kitty +## name: Nord +## author: Connor Holyday +## license: MIT +## upstream: https://raw.githubusercontent.com/connorholyday/nord-kitty/master/nord.conf +## blurb: An arctic, north-bluish clean and elegant Kitty theme. + +# Nord Colorscheme for Kitty +# Based on: +# - https://gist.github.com/marcusramberg/64010234c95a93d953e8c79fdaf94192 +# - https://github.com/arcticicestudio/nord-hyper + +foreground #D8DEE9 +background #2E3440 +selection_foreground #000000 +selection_background #FFFACD +url_color #0087BD +cursor #81A1C1 + +# black +color0 #3B4252 +color8 #4C566A + +# red +color1 #BF616A +color9 #BF616A + +# green +color2 #A3BE8C +color10 #A3BE8C + +# yellow +color3 #EBCB8B +color11 #EBCB8B + +# blue +color4 #81A1C1 +color12 #81A1C1 + +# magenta +color5 #B48EAD +color13 #B48EAD + +# cyan +color6 #88C0D0 +color14 #8FBCBB + +# white +color7 #E5E9F0 +color15 #ECEFF4 diff --git a/roles/dots/files/config/kitty/one-dark.conf b/roles/dots/files/config/kitty/one-dark.conf new file mode 100644 index 0000000..2cdbb2f --- /dev/null +++ b/roles/dots/files/config/kitty/one-dark.conf @@ -0,0 +1,32 @@ +# One Dark by Giuseppe Cesarano, https://github.com/GiuseppeCesarano +# This work is licensed under the terms of the GPL-2.0 license. +# For a copy, see https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html. + +# Colors + +foreground #979eab +background #282c34 + +color0 #282c34 +color1 #e06c75 +color2 #98c379 +color3 #e5c07b +color4 #61afef +color5 #be5046 +color6 #56b6c2 +color7 #979eab +color8 #393e48 +color9 #d19a66 +color10 #56b6c2 +color11 #e5c07b +color12 #61afef +color13 #be5046 +color14 #56b6c2 +color15 #abb2bf + +# Tab Bar + +active_tab_foreground #282c34 +active_tab_background #979eab +inactive_tab_foreground #abb2bf +inactive_tab_background #282c34 diff --git a/roles/dots/files/config/kitty/solarized_light.conf b/roles/dots/files/config/kitty/solarized_light.conf new file mode 100644 index 0000000..b1f6332 --- /dev/null +++ b/roles/dots/files/config/kitty/solarized_light.conf @@ -0,0 +1,59 @@ +# vim:ft=kitty + +## name: Solarized Light +## author: Ethan Schoonover +## license: MIT +## blurb: Precision colors for machines and people + +# The basic colors +foreground #657b83 +background #fdf6e3 +selection_foreground #586e75 +selection_background #eee8d5 + +# Cursor colors +cursor #657b83 +cursor_text_color #fdf6e3 + +# kitty window border colors +active_border_color #cb4b16 +inactive_border_color #93a1a1 + +# Tab bar colors +active_tab_background #fdf6e3 +active_tab_foreground #657b83 +inactive_tab_background #93a1a1 +inactive_tab_foreground #fdf6e3 + +# The basic 16 colors +# black +color0 #073642 +color8 #93a1a1 + +# red +color1 #dc322f +color9 #cb4b16 + +# green +color2 #859900 +color10 #586e75 + +# yellow +color3 #b58900 +color11 #657b83 + +# blue +color4 #268bd2 +color12 #839496 + +# magenta +color5 #d33682 +color13 #6c71c4 + +# cyan +color6 #2aa198 +color14 #93a1a1 + +# white +color7 #eee8d5 +color15 #fdf6e3 diff --git a/roles/dots/files/config/kitty/space_grey.conf b/roles/dots/files/config/kitty/space_grey.conf new file mode 100644 index 0000000..ba9afeb --- /dev/null +++ b/roles/dots/files/config/kitty/space_grey.conf @@ -0,0 +1,21 @@ +background #20232c +foreground #b2b8c2 +cursor #b2b8c2 +selection_background #15171e +color0 #000000 +color8 #000000 +color1 #af4b57 +color9 #af4b57 +color2 #87b279 +color10 #87b279 +color3 #e5c078 +color11 #e5c078 +color4 #7c8fa3 +color12 #7c8fa3 +color5 #a37996 +color13 #a37996 +color6 #84a6a4 +color14 #84a6a4 +color7 #b2b8c2 +color15 #fffefe +selection_foreground #20232c diff --git a/roles/dots/files/config/kitty/tokyo_night.conf b/roles/dots/files/config/kitty/tokyo_night.conf new file mode 100644 index 0000000..cff7eb5 --- /dev/null +++ b/roles/dots/files/config/kitty/tokyo_night.conf @@ -0,0 +1,37 @@ +background #1a1b26 +foreground #c0caf5 +selection_background #33467C +selection_foreground #c0caf5 +url_color #73daca +cursor #c0caf5 + +# Tabs +active_tab_background #7aa2f7 +active_tab_foreground #1f2335 +inactive_tab_background #292e42 +inactive_tab_foreground #545c7e +#tab_bar_background #15161E + +# normal +color0 #15161E +color1 #f7768e +color2 #9ece6a +color3 #e0af68 +color4 #7aa2f7 +color5 #bb9af7 +color6 #7dcfff +color7 #a9b1d6 + +# bright +color8 #414868 +color9 #f7768e +color10 #9ece6a +color11 #e0af68 +color12 #7aa2f7 +color13 #bb9af7 +color14 #7dcfff +color15 #c0caf5 + +# extended colors +color16 #ff9e64 +color17 #db4b4b diff --git a/roles/dots/files/config/kitty/tomorrow-night.conf b/roles/dots/files/config/kitty/tomorrow-night.conf new file mode 100644 index 0000000..1a18d9d --- /dev/null +++ b/roles/dots/files/config/kitty/tomorrow-night.conf @@ -0,0 +1,22 @@ +# background #1d1f21 +background #000000 +foreground #c4c8c5 +cursor #c4c8c5 +selection_background #363a41 +color0 #000000 +color8 #000000 +color1 #cc6666 +color9 #cc6666 +color2 #b5bd68 +color10 #b5bd68 +color3 #f0c574 +color11 #f0c574 +color4 #80a1bd +color12 #80a1bd +color5 #b294ba +color13 #b294ba +color6 #8abdb6 +color14 #8abdb6 +color7 #fffefe +color15 #fffefe +selection_foreground #1d1f21 diff --git a/roles/dots/files/config/nvim/.projectile b/roles/dots/files/config/nvim/.projectile new file mode 100644 index 0000000..e69de29 diff --git a/roles/dots/files/config/nvim/init.lua b/roles/dots/files/config/nvim/init.lua new file mode 100644 index 0000000..ef832a5 --- /dev/null +++ b/roles/dots/files/config/nvim/init.lua @@ -0,0 +1 @@ +require('some') diff --git a/roles/dots/files/config/nvim/lua/some/common.lua b/roles/dots/files/config/nvim/lua/some/common.lua new file mode 100755 index 0000000..7c5a809 --- /dev/null +++ b/roles/dots/files/config/nvim/lua/some/common.lua @@ -0,0 +1,24 @@ +local set = vim.opt +local g = vim.g + +set.encoding = 'UTF-8' +set.number = true +set.relativenumber = true +set.tabstop = 8 +set.softtabstop = 0 +set.shiftwidth = 4 +set.expandtab = true +set.smarttab = true +set.cursorline = true +set.clipboard = 'unnamed,unnamedplus' + + +set.list = true +-- set.lcs='space:·' +g.mapleader='\\' + +vim.o.termguicolors = true + +set.keymap='russian-jcukenwin' +set.iminsert=0 +set.imsearch=0 diff --git a/roles/dots/files/config/nvim/lua/some/init.lua b/roles/dots/files/config/nvim/lua/some/init.lua new file mode 100755 index 0000000..00b1f78 --- /dev/null +++ b/roles/dots/files/config/nvim/lua/some/init.lua @@ -0,0 +1,5 @@ +require("some.common") +require("some.packer") +require("some.packer_setting") +require("some.scripts") + diff --git a/roles/dots/files/config/nvim/lua/some/packer.lua b/roles/dots/files/config/nvim/lua/some/packer.lua new file mode 100755 index 0000000..6301983 --- /dev/null +++ b/roles/dots/files/config/nvim/lua/some/packer.lua @@ -0,0 +1,86 @@ +vim.cmd [[packadd packer.nvim]] + +return require('packer').startup(function(use) + use 'wbthomason/packer.nvim' + -- theme + use 'navarasu/onedark.nvim' + use 'folke/tokyonight.nvim' + use 'shaunsingh/nord.nvim' + use 'morhetz/gruvbox' + use 'ellisonleao/gruvbox.nvim' + use 'Mofiqul/dracula.nvim' + use 'sainnhe/everforest' + use 'catppuccin/nvim' + use 'bluz71/vim-nightfly-colors' + use 'NTBBloodbath/doom-one.nvim' + use 'metalelf0/base16-black-metal-scheme' + use 'EdenEast/nightfox.nvim' + use 'ayu-theme/ayu-vim' + use 'Shatur/neovim-ayu' + use 'lunacookies/vim-colors-xcode' + use 'chriskempson/vim-tomorrow-theme' + use 'maxmx03/solarized.nvim' + use 'antonk52/lake.nvim' + + -- auto save + use 'pocco81/auto-save.nvim' + + -- nerd tree + use 'preservim/nerdtree' + use 'Xuyuanp/nerdtree-git-plugin' + + -- git + use 'tpope/vim-fugitive' + use 'airblade/vim-gitgutter' + + -- decorations + use 'ryanoasis/vim-devicons' + use 'nvim-tree/nvim-web-devicons' + use {"shortcuts/no-neck-pain.nvim", tag = "*" } + use { + 'phaazon/hop.nvim', + branch = 'v2', + config = function() + require'hop'.setup { keys = 'etovxqpdygfblzhckisuran' } + end + } + -- func + use 'windwp/nvim-autopairs' + + -- telescope + use { + 'nvim-telescope/telescope.nvim', + tag = '0.1.4', + requires = { {'nvim-lua/plenary.nvim'} } + } + use 'nvim-telescope/telescope-file-browser.nvim' + use 'ThePrimeagen/harpoon' + use { + 'nvim-lualine/lualine.nvim', + requires = { 'kyazdani42/nvim-web-devicons', opt = true } + } + use { + 'nvim-treesitter/nvim-treesitter', + run = ':TSUpdate', + } + use 'dense-analysis/ale' + + -- lsp + use { + 'VonHeikemen/lsp-zero.nvim', + branch = 'v3.x', + requires = { + {'williamboman/mason.nvim'}, + {'williamboman/mason-lspconfig.nvim'}, + + {'neovim/nvim-lspconfig'}, + {'hrsh7th/nvim-cmp'}, + {'hrsh7th/cmp-nvim-lsp'}, + {'L3MON4D3/LuaSnip'}, + } + } + -- snippet + use 'honza/vim-snippets' +end) + + diff --git a/roles/dots/files/config/nvim/lua/some/packer_setting.lua b/roles/dots/files/config/nvim/lua/some/packer_setting.lua new file mode 100755 index 0000000..12263b9 --- /dev/null +++ b/roles/dots/files/config/nvim/lua/some/packer_setting.lua @@ -0,0 +1,252 @@ +vim.o.background = 'dark' -- 'dark' or 'light' +vim.g.everforest_background = 'hard' +-- vim.cmd('colorscheme everforest') +-- vim.cmd('colorscheme nord') +-- vim.cmd('colorscheme base16-black-metal') +-- vim.cmd('colorscheme doom-one') +-- vim.cmd('colorscheme dracula') +-- vim.cmd('colorscheme onedark') +-- vim.cmd('colorscheme nightfox') +-- vim.cmd('colorscheme Tomorrow-Night-Bright') +-- vim.cmd('colorscheme doom-one') +-- vim.cmd('colorscheme dracula-soft') +-- vim.cmd('colorscheme solarized') +vim.cmd('colorscheme gruvbox') +-- vim.cmd('colorscheme lake') +-- vim.cmd('highlight Normal guibg=#000000 ctermbg=black') +vim.api.nvim_set_hl(0, 'CursorLine', { underline = true }) +-- vim.cmd('highlight Normal guibg=none') + +-- цвет номеров строк +-- vim.cmd('hi linenr guifg=white') +vim.cmd('hi linenr guifg=#D3C6AA') +-- telescope +local builtin = require('telescope.builtin') + +-- lualine +vim.o.showtabline = 2 +require('lualine').setup() + +-- nerdtree +vim.cmd('autocmd FileType nerdtree setlocal relativenumber') +-- Open the existing NERDTree on each new tab. +vim.cmd("autocmd BufWinEnter * if getcmdwintype() == '' | silent NERDTreeMirror | endif") +-- Close the tab if NERDTree is the only window remaining in it. +vim.cmd("autocmd BufEnter * if winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | quit | endif") +-- Open the existing NERDTree on each new tab. + +vim.g['NERDTreeShowHidden'] = 1 +vim.g['NERDTreeWinSize'] = 50 + + +-- # nvim-treesitter +local status_ok, configs = pcall(require, "nvim-treesitter.configs") +if not status_ok then + return +end + +configs.setup({ + ensure_installed = {"python", "lua", "http", "json"}, + ignore_install = { "" }, -- List of parsers to ignore installing + sync_install = true, + auto_install = true, + highlight = { + enable = true, -- false will disable the whole extension + disable = {}, -- list of language that will be disabled + additional_vim_regex_highlighting = false, + }, + autopairs = { + enable = true, + }, + indent = { enable = true, disable = {} }, +}) + + +-- hob +local hop = require('hop') +hop.setup() +local directions = require('hop.hint').HintDirection +vim.keymap.set('', 'f', function() + hop.hint_char1({ direction = directions.AFTER_CURSOR, current_line_only = true }) +end, {remap=true}) +vim.keymap.set('', 'F', function() + hop.hint_char1({ direction = directions.BEFORE_CURSOR, current_line_only = true }) +end, {remap=true}) + +-- auto pairs +-- Настройка символов, для которых будет автоматически вставляться закрывающая скобка +require('nvim-autopairs').setup{} +require("no-neck-pain").setup({ width = 150 }) + +-- harpoon +print(vim.api.nvim_win_get_width(0)) +require("harpoon").setup({ + menu = { + -- width = vim.api.nvim_win_get_width(0) - 4, + width = 90 + } +}) + +-- ---------------------- +-- lsp +-- ---------------------- +local lsp_zero = require('lsp-zero') +lsp_zero.preset({ + name = 'minimal', + set_lsp_keymaps = true, + manage_nvim_cmp = true, + suggest_lsp_servers = false, +}) + + +lsp_zero.on_attach(function(client, bufnr) + -- see :help lsp-zero-keybindings + -- to learn the available actions + lsp_zero.default_keymaps({buffer = bufnr}) +end) + + +-- cmp +local cmp = require('cmp') +local cmp_action = require('lsp-zero').cmp_action() +local cmp_format = require('lsp-zero').cmp_format({details = true}) + +require('luasnip.loaders.from_vscode').lazy_load() + +cmp.setup({ + sources = { + {name = 'nvim_lsp'}, + {name = 'luasnip'}, + }, + mapping = cmp.mapping.preset.insert({ + [''] = cmp.mapping.confirm({select = true}), + }), + snippet = { + expand = function(args) + require('luasnip').lsp_expand(args.body) + end, + }, + formatting = cmp_format, +}) + + +-- to learn how to use mason.nvim +-- read this: https://github.com/VonHeikemen/lsp-zero.nvim/blob/v3.x/doc/md/guide/integrate-with-mason-nvim.md +require('mason').setup({}) +require('mason-lspconfig').setup({ + ensure_installed = {}, + handlers = { + function(server_name) + require('lspconfig')[server_name].setup({}) + end, + }, +}) + +-- ---------------------- +-- Syntax CHeck +-- ---------------------- +vim.g.ale_echo_msg_error_str = 'E' +vim.g.ale_echo_msg_warning_str = 'W' +vim.g.ale_echo_msg_format = '[%linter%] %s [%severity%]' + +-- ---------------------- +-- SHORTCUTS +-- ---------------------- + +-- vim.keymap.set('n','y','"+y') +-- vim.keymap.set('n','yy','"+yy') +-- vim.keymap.set('n','Y','"+Y') +-- vim.keymap.set('x','y','"+y') +-- vim.keymap.set('x','Y','"+Y') + +vim.keymap.set('n','yy','"gg+yy') +vim.keymap.set('n','Y','"gg+yG') +vim.keymap.set('x','y','"+y') +vim.keymap.set('x','Y','"+Y') + +vim.api.nvim_set_keymap('n', 'v', 'p', { noremap = true, silent = true }) +-- vim.api.nvim_set_keymap('i', 'v', 'pa', { noremap = true, silent = true }) +vim.api.nvim_set_keymap('c', 'v', '"', { noremap = true, silent = true }) + +vim.keymap.set('n', 'cc', ':NoNeckPain') + +vim.keymap.set('n', '', 'zz') +vim.keymap.set('n', '', 'zz') +vim.keymap.set('n', '', 'kzz') +vim.keymap.set('n', '', 'jzz') + +vim.keymap.set('i', 'jk', '') +vim.keymap.set('n', '', '', { silent=true }) + +vim.keymap.set('n', '', ':bn') +vim.keymap.set('n', '', ':bp') + +vim.keymap.set('v', 'p', 'P') +vim.keymap.set('n', '"', ':noh', { silent=true }) + +vim.keymap.set('n', '', ':vertical resize +5') +vim.keymap.set('n', '', ':vertical resize -5') +vim.keymap.set('n', '', ':resize +5') +vim.keymap.set('n', '', ':resize -5') + +vim.keymap.set('n', '', '') +vim.keymap.set('n', '', '') +vim.keymap.set('n', '', '') +vim.keymap.set('n', '', '') + +vim.keymap.set('n', 'll', 'zz') + +vim.keymap.set('n', '', '') +vim.keymap.set('i', '', '') +vim.keymap.set('v', '', '') + +-- nerd tree +vim.keymap.set('n', '', ':NERDTreeFind') +vim.keymap.set('n', '', ':NERDTreeToggle') + +-- save +vim.keymap.set('n', '8', ':w') +vim.keymap.set('n', '2', ':q') +-- exit without save +vim.keymap.set('n', '6', ':q!') + +-- copy +vim.api.nvim_set_keymap('n', 'vl', ':normal!_v$y ', { noremap = true, silent = true }) +vim.api.nvim_set_keymap('v', '', 'y', {}) + +-- move +vim.keymap.set('n', '7', '_') +vim.keymap.set('n', '9', '$') + +vim.keymap.set('v', '7', '_') +vim.keymap.set('v', '9', '$h') + +vim.keymap.set('n', '.', 'zz') +vim.keymap.set('n', ',', 'zz') + +vim.keymap.set('v', '.', 'zz') +vim.keymap.set('v', ',', 'zz') + +-- split +vim.keymap.set('n', 'sh', ':vs') +vim.keymap.set('n', 'sv', ':sp') + +-- telescope +vim.keymap.set('n', '', builtin.find_files, {}) +vim.keymap.set('n', 'pg', builtin.live_grep, {}) +vim.keymap.set('n', 'bb', builtin.buffers, {}) +vim.keymap.set('n', 'm', builtin.marks, {}) + +-- harpoon +vim.api.nvim_set_keymap("n", "ha", "lua require('harpoon.mark').add_file()", { noremap = true, silent = true }) +vim.api.nvim_set_keymap("n", "hl", "lua require('harpoon.ui').toggle_quick_menu()", { noremap = true, silent = true }) + +vim.api.nvim_set_keymap("n", "hn", 'lua require("harpoon.ui").nav_next()', { noremap = true, silent = true }) +vim.api.nvim_set_keymap("n", "hp", 'lua require("harpoon.ui").nav_prev()', { noremap = true, silent = true }) + +vim.api.nvim_set_keymap("n", "h1", 'lua require("harpoon.ui").nav_file(1)', { noremap = true, silent = true }) +vim.api.nvim_set_keymap("n", "h2", 'lua require("harpoon.ui").nav_file(2)', { noremap = true, silent = true }) +vim.api.nvim_set_keymap("n", "h3", 'lua require("harpoon.ui").nav_file(3)', { noremap = true, silent = true }) +vim.api.nvim_set_keymap("n", "h4", 'lua require("harpoon.ui").nav_file(4)', { noremap = true, silent = true }) +vim.api.nvim_set_keymap("n", "h5", 'lua require("harpoon.ui").nav_file(5)', { noremap = true, silent = true }) +vim.api.nvim_set_keymap("n", "h6", 'lua require("harpoon.ui").nav_file(6)', { noremap = true, silent = true }) diff --git a/roles/dots/files/config/nvim/lua/some/scripts.lua b/roles/dots/files/config/nvim/lua/some/scripts.lua new file mode 100755 index 0000000..88440ed --- /dev/null +++ b/roles/dots/files/config/nvim/lua/some/scripts.lua @@ -0,0 +1,78 @@ +-- {"pylint", "flake8", "jedi", "pynvim"} + +-- for httpie +function string.starts(String,Start) + return string.sub(String,1,string.len(Start))==Start +end + +function getPath(str) + -- get dir path from file path + -- /home/tmp/test/foo.json --> /home/tmp/test + return str:match("(.*[/\\])") +end + +function close_window_with_response() + local current_tab = vim.api.nvim_get_current_tabpage() + local windows = vim.api.nvim_tabpage_list_wins(current_tab) + + if #windows > 1 then + local current_window = vim.api.nvim_get_current_win() + local prev_window = nil + for i = #windows, 1, -1 do + local win = windows[i] + if win == current_window then + vim.api.nvim_win_close(prev_window, true) + else + prev_window = win + end + end + end +end + +function rest() + vim.api.nvim_command('w') + + local absolute_current_file = vim.api.nvim_buf_get_name(0) + local neovim_open_path = vim.fn.getcwd() + + local pyhttp = 'python ~/bin/easy_http.py ' .. absolute_current_file .. ' ' .. neovim_open_path + pyhttp_exec = io.popen(pyhttp) + + close_window_with_response() + + local win = vim.api.nvim_get_current_win() + local current_buf = vim.api.nvim_get_current_buf() + vim.cmd('vsplit') + local buf = vim.api.nvim_create_buf(true, true) + + + vim.api.nvim_win_set_buf(win, buf) + vim.api.nvim_buf_set_option(buf, 'buftype', 'nofile') + + http_result = {} + + for line in pyhttp_exec:lines() do + table.insert(http_result, line) + end + + pyhttp_exec.close() + + vim.api.nvim_buf_set_option(buf, 'modifiable', true) + vim.api.nvim_buf_set_lines(buf, 0, 0, true, http_result) + vim.api.nvim_buf_set_option(buf, "ft", "http") + vim.api.nvim_buf_set_option(current_buf, "ft", "http") +end + +vim.cmd("au! BufRead,BufNewFile *.http setfiletype http") + +vim.api.nvim_set_keymap('v', 'j', ':\'<,\'>!jq . ', { noremap = true, silent = true }) + +vim.api.nvim_create_user_command('Test', close_window_with_response, {}) + +vim.api.nvim_create_user_command('R', rest, {}) +vim.api.nvim_set_keymap("n", "rs", ':R', { noremap = true, silent = true }) + +-- custom commands +vim.api.nvim_create_user_command('Ga', 'Git add %', {}) +vim.api.nvim_create_user_command('Gl', 'Git log -p %', {}) +vim.api.nvim_create_user_command('Gd', 'Git diff %', {}) diff --git a/roles/dots/files/config/rofi/themes/launchpad.rasi b/roles/dots/files/config/rofi/themes/launchpad.rasi new file mode 100644 index 0000000..14c2564 --- /dev/null +++ b/roles/dots/files/config/rofi/themes/launchpad.rasi @@ -0,0 +1,94 @@ +/******************************************************************************* + * MACOS LAUNCHPAD LIKE THEME FOR ROFI + * User : LR-Tech + * Theme Repo : https://github.com/lr-tech/rofi-themes-collection + *******************************************************************************/ + +* { + font: "Montserrat 9"; + + bg0: #24242480; + bg1: #363636; + bg2: #f5f5f520; + bg3: #f5f5f540; + bg4: #0860f2E6; + + fg0: #f5f5f5; + fg1: #f5f5f580; + + background-color: transparent; + text-color: @fg0; + padding: 0px; + margin: 0px; +} + +window { + fullscreen: true; + padding: 1em; + background-color: @bg0; +} + +mainbox { + padding: 8px; +} + +inputbar { + background-color: @bg2; + + margin: 0px calc( 50% - 120px ); + padding: 2px 4px; + spacing: 4px; + + border: 1px; + border-radius: 2px; + border-color: @bg3; + + children: [icon-search,entry]; +} + +prompt { + enabled: false; +} + +icon-search { + expand: false; + filename: "search"; + vertical-align: 0.5; +} + +entry { + placeholder: "Search"; + placeholder-color: @bg2; +} + +listview { + margin: 48px calc( 50% - 560px ); + spacing: 48px; + columns: 6; + fixed-columns: true; +} + +element, element-text, element-icon { + cursor: pointer; +} + +element { + padding: 8px; + spacing: 4px; + + orientation: vertical; + border-radius: 16px; +} + +element selected { + background-color: @bg4; +} + +element-icon { + size: 4em; + horizontal-align: 0.5; +} + +element-text { + horizontal-align: 0.5; +} diff --git a/roles/dots/files/config/rofi/themes/nord-oneline.rasi b/roles/dots/files/config/rofi/themes/nord-oneline.rasi new file mode 100644 index 0000000..72e2f57 --- /dev/null +++ b/roles/dots/files/config/rofi/themes/nord-oneline.rasi @@ -0,0 +1,106 @@ +/******************************************************************************* + * ROFI ONELINE THEME USING THE NORD COLOR PALETTE + * User : LR-Tech + * Theme Repo : https://github.com/lr-tech/rofi-themes-collection + * Nord Project Repo : https://github.com/arcticicestudio/nord + *******************************************************************************/ + +* { + font: "Fira Code 10"; + + nord0: #2e3440; + nord1: #3b4252; + nord2: #434c5e; + nord3: #4c566a; + + nord4: #d8dee9; + nord5: #e5e9f0; + nord6: #eceff4; + + nord7: #8fbcbb; + nord8: #88c0d0; + nord9: #81a1c1; + nord10: #5e81ac; + nord11: #bf616a; + + nord12: #d08770; + nord13: #ebcb8b; + nord14: #a3be8c; + nord15: #b48ead; + + background-color: transparent; + text-color: @nord4; + accent-color: @nord8; + + margin: 0px; + padding: 0px; + spacing: 0px; +} + +window { + location: north; + width: 100%; + background-color: @nord0; + children: [ mainbox,message ]; +} + +mainbox { + orientation: horizontal; + children: [ inputbar,listview ]; +} + +inputbar { + width: 25%; + padding: 1px 8px; + spacing: 8px; + children: [ prompt, entry ]; +} + +prompt, entry, element-text, element-icon { + vertical-align: 0.5; +} + +prompt { + text-color: @accent-color; +} + +listview { + layout: horizontal; +} + +element { + padding: 1px 8px; + spacing: 4px; +} + +element normal urgent { + text-color: @nord13; +} + +element normal active { + text-color: @accent-color; +} + +element selected { + text-color: @nord0; +} + +element selected normal { + background-color: @accent-color; +} + +element selected urgent { + background-color: @nord13; +} + +element selected active { + background-color: @nord8; +} + +element-icon { + size: 0.75em; +} + +element-text { + text-color: inherit; +} diff --git a/roles/dots/files/config/rofi/themes/nord-twoLines.rasi b/roles/dots/files/config/rofi/themes/nord-twoLines.rasi new file mode 100644 index 0000000..845bd16 --- /dev/null +++ b/roles/dots/files/config/rofi/themes/nord-twoLines.rasi @@ -0,0 +1,101 @@ +/******************************************************************************* + * ROFI TWO LINES THEME USING THE NORD COLOR PALETTE + * User : LR-Tech + * Theme Repo : https://github.com/lr-tech/rofi-themes-collection + * Nord Project Repo : https://github.com/arcticicestudio/nord + *******************************************************************************/ + +* { + font: "Fira Code 10"; + + nord0: #2e3440; + nord1: #3b4252; + nord2: #434c5e; + nord3: #4c566a; + + nord4: #d8dee9; + nord5: #e5e9f0; + nord6: #eceff4; + + nord7: #8fbcbb; + nord8: #88c0d0; + nord9: #81a1c1; + nord10: #5e81ac; + nord11: #bf616a; + + nord12: #d08770; + nord13: #ebcb8b; + nord14: #a3be8c; + nord15: #b48ead; + + background-color: transparent; + text-color: @nord4; + accent-color: @nord8; + + margin: 0px; + padding: 0px; + spacing: 0px; +} + +window { + background-color: @nord0; + + location: north; + width: 100%; +} + +inputbar { + padding: 2px 8px; + spacing: 8px; + children: [ prompt, entry ]; +} + +prompt, entry, element-text, element-icon { + vertical-align: 0.5; +} + +prompt { + text-color: @accent-color; +} + +listview { + lines: 1; + columns: 4; +} + +element { + padding: 1px 8px; + spacing: 4px; +} + +element normal urgent { + text-color: @nord13; +} + +element normal active { + text-color: @accent-color; +} + +element selected { + text-color: @nord0; +} + +element selected normal { + background-color: @accent-color; +} + +element selected urgent { + background-color: @nord13; +} + +element selected active { + background-color: @nord8; +} + +element-icon { + size: 0.75em; +} + +element-text { + text-color: inherit; +} diff --git a/roles/dots/files/config/rofi/themes/nord.rasi b/roles/dots/files/config/rofi/themes/nord.rasi new file mode 100644 index 0000000..f8b464d --- /dev/null +++ b/roles/dots/files/config/rofi/themes/nord.rasi @@ -0,0 +1,105 @@ +/******************************************************************************* + * ROFI VERTICAL THEME USING THE NORD COLOR PALETTE + * User : LR-Tech + * Theme Repo : https://github.com/lr-tech/rofi-themes-collection + * Nord Project Repo : https://github.com/arcticicestudio/nord + *******************************************************************************/ + +* { + font: "IBM Plex Mono 12"; + + nord0: #2e3440; + nord1: #3b4252; + nord2: #434c5e; + nord3: #4c566a; + + nord4: #d8dee9; + nord5: #e5e9f0; + nord6: #eceff4; + + nord7: #8fbcbb; + nord8: #88c0d0; + nord9: #81a1c1; + nord10: #5e81ac; + nord11: #bf616a; + + nord12: #d08770; + nord13: #ebcb8b; + nord14: #a3be8c; + nord15: #b48ead; + + background-color: transparent; + text-color: @nord4; + accent-color: @nord8; + + margin: 0px; + padding: 0px; + spacing: 0px; +} + +window { + background-color: @nord0; + border-color: @accent-color; + + location: center; + width: 480px; + border: 1px; +} + +inputbar { + padding: 8px 12px; + spacing: 12px; + children: [ prompt, entry ]; +} + +prompt, entry, element-text, element-icon { + vertical-align: 0.5; +} + +prompt { + text-color: @accent-color; +} + +listview { + lines: 8; + columns: 1; + + fixed-height: false; +} + +element { + padding: 8px; + spacing: 8px; +} + +element normal urgent { + text-color: @nord13; +} + +element normal active { + text-color: @accent-color; +} + +element selected { + text-color: @nord0; +} + +element selected normal { + background-color: @accent-color; +} + +element selected urgent { + background-color: @nord13; +} + +element selected active { + background-color: @nord8; +} + +element-icon { + size: 0.75em; +} + +element-text { + text-color: inherit; +} diff --git a/roles/dots/files/config/rofi/themes/rounded-blue-dark.rasi b/roles/dots/files/config/rofi/themes/rounded-blue-dark.rasi new file mode 100644 index 0000000..712d714 --- /dev/null +++ b/roles/dots/files/config/rofi/themes/rounded-blue-dark.rasi @@ -0,0 +1,18 @@ +/******************************************************************************* + * ROUNDED THEME FOR ROFI + * User : LR-Tech + * Theme Repo : https://github.com/lr-tech/rofi-themes-collection + *******************************************************************************/ + +* { + bg0: #212121F2; + bg1: #2A2A2A; + bg2: #3D3D3D80; + bg3: #1A73E8F2; + fg0: #E6E6E6; + fg1: #FFFFFF; + fg2: #969696; + fg3: #3D3D3D; +} + +@import "rounded-common.rasi" diff --git a/roles/dots/files/config/rofi/themes/rounded-common.rasi b/roles/dots/files/config/rofi/themes/rounded-common.rasi new file mode 100644 index 0000000..b39bf4e --- /dev/null +++ b/roles/dots/files/config/rofi/themes/rounded-common.rasi @@ -0,0 +1,93 @@ +/******************************************************************************* + * ROUNDED THEME FOR ROFI + * User : LR-Tech + * Theme Repo : https://github.com/lr-tech/rofi-themes-collection + *******************************************************************************/ + +* { + font: "Roboto 12"; + + background-color: transparent; + text-color: @fg0; + + margin: 0px; + padding: 0px; + spacing: 0px; +} + +window { + location: center; + width: 480; + border-radius: 24px; + + background-color: @bg0; +} + +mainbox { + padding: 12px; +} + +inputbar { + background-color: @bg1; + border-color: @bg3; + + border: 2px; + border-radius: 16px; + + padding: 8px 16px; + spacing: 8px; + children: [ prompt, entry ]; +} + +prompt { + text-color: @fg2; +} + +entry { + placeholder: "Search"; + placeholder-color: @fg3; +} + +message { + margin: 12px 0 0; + border-radius: 16px; + border-color: @bg2; + background-color: @bg2; +} + +textbox { + padding: 8px 24px; +} + +listview { + background-color: transparent; + + margin: 12px 0 0; + lines: 8; + columns: 1; + + fixed-height: false; +} + +element { + padding: 8px 16px; + spacing: 8px; + border-radius: 16px; +} + +element normal active { + text-color: @bg3; +} + +element selected normal, element selected active { + background-color: @bg3; +} + +element-icon { + size: 1em; + vertical-align: 0.5; +} + +element-text { + text-color: inherit; +} diff --git a/roles/dots/files/config/rofi/themes/rounded-gray-dark.rasi b/roles/dots/files/config/rofi/themes/rounded-gray-dark.rasi new file mode 100644 index 0000000..943280d --- /dev/null +++ b/roles/dots/files/config/rofi/themes/rounded-gray-dark.rasi @@ -0,0 +1,18 @@ +/******************************************************************************* + * ROUNDED THEME FOR ROFI + * User : LR-Tech + * Theme Repo : https://github.com/lr-tech/rofi-themes-collection + *******************************************************************************/ + +* { + bg0: #212121F2; + bg1: #2A2A2A; + bg2: #3D3D3D80; + bg3: #616161F2; + fg0: #E6E6E6; + fg1: #FFFFFF; + fg2: #969696; + fg3: #3D3D3D; +} + +@import "rounded-common.rasi" diff --git a/roles/dots/files/config/rofi/themes/rounded-green-dark.rasi b/roles/dots/files/config/rofi/themes/rounded-green-dark.rasi new file mode 100644 index 0000000..a268f62 --- /dev/null +++ b/roles/dots/files/config/rofi/themes/rounded-green-dark.rasi @@ -0,0 +1,18 @@ +/******************************************************************************* + * ROUNDED THEME FOR ROFI + * User : LR-Tech + * Theme Repo : https://github.com/lr-tech/rofi-themes-collection + *******************************************************************************/ + +* { + bg0: #212121F2; + bg1: #2A2A2A; + bg2: #3D3D3D80; + bg3: #4CAF50F2; + fg0: #E6E6E6; + fg1: #FFFFFF; + fg2: #969696; + fg3: #3D3D3D; +} + +@import "rounded-common.rasi" diff --git a/roles/dots/files/config/rofi/themes/rounded-nord-dark.rasi b/roles/dots/files/config/rofi/themes/rounded-nord-dark.rasi new file mode 100644 index 0000000..ef35389 --- /dev/null +++ b/roles/dots/files/config/rofi/themes/rounded-nord-dark.rasi @@ -0,0 +1,22 @@ +/******************************************************************************* + * ROUNDED THEME FOR ROFI + * User : LR-Tech + * Theme Repo : https://github.com/lr-tech/rofi-themes-collection + *******************************************************************************/ + +* { + bg0: #2E3440F2; + bg1: #3B4252; + bg2: #4C566A80; + bg3: #88C0D0F2; + fg0: #D8DEE9; + fg1: #ECEFF4; + fg2: #D8DEE9; + fg3: #4C566A; +} + +@import "rounded-common.rasi" + +element selected { + text-color: @bg1; +} diff --git a/roles/dots/files/config/rofi/themes/rounded-orange-dark.rasi b/roles/dots/files/config/rofi/themes/rounded-orange-dark.rasi new file mode 100644 index 0000000..da4acea --- /dev/null +++ b/roles/dots/files/config/rofi/themes/rounded-orange-dark.rasi @@ -0,0 +1,18 @@ +/******************************************************************************* + * ROUNDED THEME FOR ROFI + * User : LR-Tech + * Theme Repo : https://github.com/lr-tech/rofi-themes-collection + *******************************************************************************/ + +* { + bg0: #212121F2; + bg1: #2A2A2A; + bg2: #3D3D3D80; + bg3: #F57C00F2; + fg0: #E6E6E6; + fg1: #FFFFFF; + fg2: #969696; + fg3: #3D3D3D; +} + +@import "rounded-common.rasi" diff --git a/roles/dots/files/config/rofi/themes/rounded-pink-dark.rasi b/roles/dots/files/config/rofi/themes/rounded-pink-dark.rasi new file mode 100644 index 0000000..2288dc0 --- /dev/null +++ b/roles/dots/files/config/rofi/themes/rounded-pink-dark.rasi @@ -0,0 +1,18 @@ +/******************************************************************************* + * ROUNDED THEME FOR ROFI + * User : LR-Tech + * Theme Repo : https://github.com/lr-tech/rofi-themes-collection + *******************************************************************************/ + +* { + bg0: #212121F2; + bg1: #2A2A2A; + bg2: #3D3D3D80; + bg3: #EC407AF2; + fg0: #E6E6E6; + fg1: #FFFFFF; + fg2: #969696; + fg3: #3D3D3D; +} + +@import "rounded-common.rasi" diff --git a/roles/dots/files/config/rofi/themes/rounded-purple-dark.rasi b/roles/dots/files/config/rofi/themes/rounded-purple-dark.rasi new file mode 100644 index 0000000..55c651b --- /dev/null +++ b/roles/dots/files/config/rofi/themes/rounded-purple-dark.rasi @@ -0,0 +1,18 @@ +/******************************************************************************* + * ROUNDED THEME FOR ROFI + * User : LR-Tech + * Theme Repo : https://github.com/lr-tech/rofi-themes-collection + *******************************************************************************/ + +* { + bg0: #212121F2; + bg1: #2A2A2A; + bg2: #3D3D3D80; + bg3: #AB47BCF2; + fg0: #E6E6E6; + fg1: #FFFFFF; + fg2: #969696; + fg3: #3D3D3D; +} + +@import "rounded-common.rasi" diff --git a/roles/dots/files/config/rofi/themes/rounded-red-dark.rasi b/roles/dots/files/config/rofi/themes/rounded-red-dark.rasi new file mode 100644 index 0000000..c1d71a6 --- /dev/null +++ b/roles/dots/files/config/rofi/themes/rounded-red-dark.rasi @@ -0,0 +1,18 @@ +/******************************************************************************* + * ROUNDED THEME FOR ROFI + * User : LR-Tech + * Theme Repo : https://github.com/lr-tech/rofi-themes-collection + *******************************************************************************/ + +* { + bg0: #212121F2; + bg1: #2A2A2A; + bg2: #3D3D3D80; + bg3: #E53935F2; + fg0: #E6E6E6; + fg1: #FFFFFF; + fg2: #969696; + fg3: #3D3D3D; +} + +@import "rounded-common.rasi" diff --git a/roles/dots/files/config/rofi/themes/rounded-yellow-dark.rasi b/roles/dots/files/config/rofi/themes/rounded-yellow-dark.rasi new file mode 100644 index 0000000..dbdaeb3 --- /dev/null +++ b/roles/dots/files/config/rofi/themes/rounded-yellow-dark.rasi @@ -0,0 +1,18 @@ +/******************************************************************************* + * ROUNDED THEME FOR ROFI + * User : LR-Tech + * Theme Repo : https://github.com/lr-tech/rofi-themes-collection + *******************************************************************************/ + +* { + bg0: #212121F2; + bg1: #2A2A2A; + bg2: #3D3D3D80; + bg3: #FBC02DF2; + fg0: #E6E6E6; + fg1: #FFFFFF; + fg2: #969696; + fg3: #3D3D3D; +} + +@import "rounded-common.rasi" diff --git a/roles/dots/files/config/rofi/themes/simple-tokyonight.rasi b/roles/dots/files/config/rofi/themes/simple-tokyonight.rasi new file mode 100644 index 0000000..0b6f9fa --- /dev/null +++ b/roles/dots/files/config/rofi/themes/simple-tokyonight.rasi @@ -0,0 +1,111 @@ +* { + font: "Iosevka Nerd Font Medium 11"; + + bg0 : #1a1b26; + bg1 : #1f2335; + bg2 : #24283b; + bg3 : #414868; + fg0 : #c0caf5; + fg1 : #a9b1d6; + fg2 : #737aa2; + red : #f7768e; + green : #9ece6a; + yellow : #e0af68; + blue : #7aa2f7; + magenta : #9a7ecc; + cyan : #4abaaf; + + accent: @red; + urgent: @yellow; + + background-color : transparent; + text-color : @fg0; + + margin : 0; + padding : 0; + spacing : 0; +} + +element-icon, element-text, scrollbar { + cursor: pointer; +} + +window { + location : northwest; + width : 280px; + x-offset : 4px; + y-offset : 26px; + + background-color: @bg1; + border: 1px; + border-color: @bg3; + border-radius: 6px; +} + +inputbar { + spacing : 8px; + padding : 4px 8px; + children : [ icon-search, entry ]; + + background-color: @bg0; +} + +icon-search, entry, element-icon, element-text { + vertical-align: 0.5; +} + +icon-search { + expand : false; + filename : "search-symbolic"; + size : 14px; +} + +textbox { + padding : 4px 8px; + background-color : @bg2; +} + +listview { + padding : 4px 0px; + lines : 12; + columns : 1; + scrollbar : true; + fixed-height : false; + dynamic : true; +} + +element { + padding : 4px 8px; + spacing : 8px; +} + +element normal urgent { + text-color: @urgent; +} + +element normal active { + text-color: @accent; +} + +element selected { + text-color : @bg1; + background-color : @accent; +} + +element selected urgent { + background-color: @urgent; +} + +element-icon { + size: 0.8em; +} + +element-text { + text-color: inherit; +} + +scrollbar { + handle-width : 4px; + handle-color : @fg2; + padding : 0 4px; +} diff --git a/roles/dots/files/config/rofi/themes/spotlight-dark.rasi b/roles/dots/files/config/rofi/themes/spotlight-dark.rasi new file mode 100644 index 0000000..0e27360 --- /dev/null +++ b/roles/dots/files/config/rofi/themes/spotlight-dark.rasi @@ -0,0 +1,98 @@ +/******************************************************************************* + * MACOS SPOTLIGHT LIKE DARK THEME FOR ROFI + * User : LR-Tech + * Theme Repo : https://github.com/lr-tech/rofi-themes-collection + *******************************************************************************/ + +* { + font: "Montserrat 12"; + + bg0: #242424E6; + bg1: #7E7E7E80; + bg2: #0860f2E6; + + fg0: #DEDEDE; + fg1: #FFFFFF; + fg2: #DEDEDE80; + + background-color: transparent; + text-color: @fg0; + + margin: 0; + padding: 0; + spacing: 0; +} + +window { + background-color: @bg0; + + location: center; + width: 640; + border-radius: 8; +} + +inputbar { + font: "Montserrat 20"; + padding: 12px; + spacing: 12px; + children: [ icon-search, entry ]; +} + +icon-search { + expand: false; + filename: "search"; + size: 28px; +} + +icon-search, entry, element-icon, element-text { + vertical-align: 0.5; +} + +entry { + font: inherit; + + placeholder : "Search"; + placeholder-color : @fg2; +} + +message { + border: 2px 0 0; + border-color: @bg1; + background-color: @bg1; +} + +textbox { + padding: 8px 24px; +} + +listview { + lines: 10; + columns: 1; + + fixed-height: false; + border: 1px 0 0; + border-color: @bg1; +} + +element { + padding: 8px 16px; + spacing: 16px; + background-color: transparent; +} + +element normal active { + text-color: @bg2; +} + +element selected normal, element selected active { + background-color: @bg2; + text-color: @fg1; +} + +element-icon { + size: 1em; +} + +element-text { + text-color: inherit; +} diff --git a/roles/dots/files/config/rofi/themes/spotlight.rasi b/roles/dots/files/config/rofi/themes/spotlight.rasi new file mode 100644 index 0000000..395e3f0 --- /dev/null +++ b/roles/dots/files/config/rofi/themes/spotlight.rasi @@ -0,0 +1,98 @@ +/******************************************************************************* + * MACOS SPOTLIGHT LIKE THEME FOR ROFI + * User : LR-Tech + * Theme Repo : https://github.com/lr-tech/rofi-themes-collection + *******************************************************************************/ + +* { + font: "Montserrat 12"; + + bg0: #F5F5F5BF; + bg1: #7E7E7E80; + bg2: #0860F2E6; + + fg0: #242424; + fg1: #FFFFFF; + fg2: #24242480; + + background-color: transparent; + text-color: @fg0; + + margin: 0; + padding: 0; + spacing: 0; +} + +window { + background-color: @bg0; + + location: center; + width: 640; + border-radius: 8; +} + +inputbar { + font: "Montserrat 20"; + padding: 12px; + spacing: 12px; + children: [ icon-search, entry ]; +} + +icon-search { + expand: false; + filename: "search"; + size: 28px; +} + +icon-search, entry, element-icon, element-text { + vertical-align: 0.5; +} + +entry { + font: inherit; + + placeholder : "Search"; + placeholder-color : @fg2; +} + +message { + border: 2px 0 0; + border-color: @bg1; + background-color: @bg1; +} + +textbox { + padding: 8px 24px; +} + +listview { + lines: 10; + columns: 1; + + fixed-height: false; + border: 1px 0 0; + border-color: @bg1; +} + +element { + padding: 8px 16px; + spacing: 16px; + background-color: transparent; +} + +element normal active { + text-color: @bg2; +} + +element selected normal, element selected active { + background-color: @bg2; + text-color: @fg1; +} + +element-icon { + size: 1em; +} + +element-text { + text-color: inherit; +} diff --git a/roles/dots/files/config/rofi/themes/squared-everforest.rasi b/roles/dots/files/config/rofi/themes/squared-everforest.rasi new file mode 100644 index 0000000..4243ef0 --- /dev/null +++ b/roles/dots/files/config/rofi/themes/squared-everforest.rasi @@ -0,0 +1,95 @@ +/******************************************************************************* + * ROFI SQUARED THEME USING THE EVERFOREST PALETTE + * User : LR-Tech + * Theme Repo : https://github.com/lr-tech/rofi-themes-collection + *******************************************************************************/ + +* { + font: "FiraCode Nerd Font Medium 12"; + + bg0: #2B3339; + bg1: #323D43; + fg0: #D3C6AA; + + accent-color: #A7C080; + urgent-color: #DBBC7F; + + background-color: transparent; + text-color: @fg0; + + margin: 0; + padding: 0; + spacing: 0; +} + +window { + location: center; + width: 480; + + background-color: @bg0; +} + +inputbar { + spacing: 8px; + padding: 8px; + + background-color: @bg1; +} + +prompt, entry, element-icon, element-text { + vertical-align: 0.5; +} + +prompt { + text-color: @accent-color; +} + +textbox { + padding: 8px; + background-color: @bg1; +} + +listview { + padding: 4px 0; + lines: 8; + columns: 1; + + fixed-height: false; +} + +element { + padding: 8px; + spacing: 8px; +} + +element normal normal { + text-color: @fg0; +} + +element normal urgent { + text-color: @urgent-color; +} + +element normal active { + text-color: @accent-color; +} + +element selected { + text-color: @bg0; +} + +element selected normal, element selected active { + background-color: @accent-color; +} + +element selected urgent { + background-color: @urgent-color; +} + +element-icon { + size: 0.8em; +} + +element-text { + text-color: inherit; +} diff --git a/roles/dots/files/config/rofi/themes/squared-material-red.rasi b/roles/dots/files/config/rofi/themes/squared-material-red.rasi new file mode 100644 index 0000000..aa6b8fc --- /dev/null +++ b/roles/dots/files/config/rofi/themes/squared-material-red.rasi @@ -0,0 +1,95 @@ +/******************************************************************************* + * ROFI SQUARED THEME USING THE MATERIAL DARKER PALETTE + * User : LR-Tech + * Theme Repo : https://github.com/lr-tech/rofi-themes-collection + *******************************************************************************/ + +* { + font: "FiraCode Nerd Font Medium 12"; + + bg0: #212121; + bg1: #404040; + fg0: #eeffff; + + accent-color: #f07178; + urgent-color: #ffcb6b; + + background-color: transparent; + text-color: @fg0; + + margin: 0; + padding: 0; + spacing: 0; +} + +window { + location: center; + width: 480; + + background-color: @bg0; +} + +inputbar { + spacing: 8px; + padding: 8px; + + background-color: @bg1; +} + +prompt, entry, element-icon, element-text { + vertical-align: 0.5; +} + +prompt { + text-color: @accent-color; +} + +textbox { + padding: 8px; + background-color: @bg1; +} + +listview { + padding: 4px 0; + lines: 8; + columns: 1; + + fixed-height: false; +} + +element { + padding: 8px; + spacing: 8px; +} + +element normal normal { + text-color: @fg0; +} + +element normal urgent { + text-color: @urgent-color; +} + +element normal active { + text-color: @accent-color; +} + +element selected { + text-color: @bg0; +} + +element selected normal, element selected active { + background-color: @accent-color; +} + +element selected urgent { + background-color: @urgent-color; +} + +element-icon { + size: 0.8em; +} + +element-text { + text-color: inherit; +} diff --git a/roles/dots/files/config/rofi/themes/squared-nord.rasi b/roles/dots/files/config/rofi/themes/squared-nord.rasi new file mode 100644 index 0000000..689e359 --- /dev/null +++ b/roles/dots/files/config/rofi/themes/squared-nord.rasi @@ -0,0 +1,95 @@ +/******************************************************************************* + * ROFI SQUARED THEME USING THE NORD PALETTE + * User : LR-Tech + * Theme Repo : https://github.com/lr-tech/rofi-themes-collection + *******************************************************************************/ + +* { + font: "FiraCode Nerd Font Medium 12"; + + bg0: #2E3440; + bg1: #3B4252; + fg0: #D8DEE9; + + accent-color: #88C0D0; + urgent-color: #EBCB8B; + + background-color: transparent; + text-color: @fg0; + + margin: 0; + padding: 0; + spacing: 0; +} + +window { + location: center; + width: 480; + + background-color: @bg0; +} + +inputbar { + spacing: 8px; + padding: 8px; + + background-color: @bg1; +} + +prompt, entry, element-icon, element-text { + vertical-align: 0.5; +} + +prompt { + text-color: @accent-color; +} + +textbox { + padding: 8px; + background-color: @bg1; +} + +listview { + padding: 4px 0; + lines: 8; + columns: 1; + + fixed-height: false; +} + +element { + padding: 8px; + spacing: 8px; +} + +element normal normal { + text-color: @fg0; +} + +element normal urgent { + text-color: @urgent-color; +} + +element normal active { + text-color: @accent-color; +} + +element selected { + text-color: @bg0; +} + +element selected normal, element selected active { + background-color: @accent-color; +} + +element selected urgent { + background-color: @urgent-color; +} + +element-icon { + size: 0.8em; +} + +element-text { + text-color: inherit; +} diff --git a/roles/dots/files/config/rofi/themes/windows11-grid-dark.rasi b/roles/dots/files/config/rofi/themes/windows11-grid-dark.rasi new file mode 100644 index 0000000..ee4d1e2 --- /dev/null +++ b/roles/dots/files/config/rofi/themes/windows11-grid-dark.rasi @@ -0,0 +1,108 @@ +* { + font: "Roboto 10"; + + bg0 : #1f1f1f80; + bg1 : #202020bf; + bg2 : #2c2c2c; + bg3 : #393939bf; + fg0 : #ffffff; + fg1 : #cecece; + accent : #60cdff; + urgent : @accent; + + background-color : transparent; + text-color : @fg0; + + margin : 0; + padding : 0; + spacing : 0; +} + +element-icon, element-text, scrollbar { + cursor: pointer; +} + +window { + location : south; + width : 600px; + height : 600px; + y-offset : -4px; + + background-color : @bg1; + border-radius : 8px; +} + +mainbox { + padding : 24px; + spacing : 24px; +} + +inputbar { + padding : 8px; + spacing : 4px; + children : [ icon-search, entry ]; + border : 0 0 2px 0 solid; + border-color : @accent; + border-radius : 2px; + background-color : @bg0; +} + +icon-search, entry, element-icon, element-text { + vertical-align: 0.5; +} + +icon-search { + expand : false; + filename : "search-symbolic"; + size : 24px; +} + +entry { + font : "Roboto 12"; + placeholder : "Type here to search"; + placeholder-color : @fg1; +} + +textbox { + padding : 4px 8px; + background-color : @bg2; +} + +listview { + columns : 6; + spacing : 8px; + fixed-height : true; + fixed-columns : true; +} + +element { + orientation : vertical; + spacing : 4px; + padding : 8px; + border-radius : 2px; +} + +element normal urgent { + text-color: @urgent; +} + +element normal active { + text-color: @accent; +} + +element selected { + background-color: @bg3; +} + +element selected urgent { + background-color: @urgent; +} + +element-icon { + size: 2em; +} + +element-text { + text-color : inherit; + horizontal-align : 0.5; +} diff --git a/roles/dots/files/config/rofi/themes/windows11-grid-light.rasi b/roles/dots/files/config/rofi/themes/windows11-grid-light.rasi new file mode 100644 index 0000000..972b481 --- /dev/null +++ b/roles/dots/files/config/rofi/themes/windows11-grid-light.rasi @@ -0,0 +1,108 @@ +* { + font: "Roboto 10"; + + bg0 : #ffffff80; + bg1 : #f9f9f9bf; + bg2 : #f7f7f7; + bg3 : #fefefebf; + fg0 : #1a1a1a; + fg1 : #5f5f5f; + accent : #005fb8; + urgent : @accent; + + background-color : transparent; + text-color : @fg0; + + margin : 0; + padding : 0; + spacing : 0; +} + +element-icon, element-text, scrollbar { + cursor: pointer; +} + +window { + location : south; + width : 600px; + height : 600px; + y-offset : -4px; + + background-color : @bg1; + border-radius : 8px; +} + +mainbox { + padding : 24px; + spacing : 24px; +} + +inputbar { + padding : 8px; + spacing : 4px; + children : [ icon-search, entry ]; + border : 0 0 2px 0 solid; + border-color : @accent; + border-radius : 2px; + background-color : @bg0; +} + +icon-search, entry, element-icon, element-text { + vertical-align: 0.5; +} + +icon-search { + expand : false; + filename : "search-symbolic"; + size : 24px; +} + +entry { + font : "Roboto 12"; + placeholder : "Type here to search"; + placeholder-color : @fg1; +} + +textbox { + padding : 4px 8px; + background-color : @bg2; +} + +listview { + columns : 6; + spacing : 8px; + fixed-height : true; + fixed-columns : true; +} + +element { + orientation : vertical; + spacing : 4px; + padding : 8px; + border-radius : 2px; +} + +element normal urgent { + text-color: @urgent; +} + +element normal active { + text-color: @accent; +} + +element selected { + background-color: @bg3; +} + +element selected urgent { + background-color: @urgent; +} + +element-icon { + size: 2em; +} + +element-text { + text-color : inherit; + horizontal-align : 0.5; +} diff --git a/roles/dots/files/config/rofi/themes/windows11-list-dark.rasi b/roles/dots/files/config/rofi/themes/windows11-list-dark.rasi new file mode 100644 index 0000000..3f8b3fc --- /dev/null +++ b/roles/dots/files/config/rofi/themes/windows11-list-dark.rasi @@ -0,0 +1,106 @@ +* { + font: "Roboto 10"; + + bg0 : #1f1f1f80; + bg1 : #202020bf; + bg2 : #2c2c2c; + bg3 : #393939bf; + fg0 : #ffffff; + fg1 : #cecece; + accent : #60cdff; + urgent : @accent; + + background-color : transparent; + text-color : @fg0; + + margin : 0; + padding : 0; + spacing : 0; +} + +element-icon, element-text, scrollbar { + cursor: pointer; +} + +window { + location : south; + width : 600px; + height : 600px; + y-offset : -4px; + + background-color : @bg1; + border-radius : 8px; +} + +mainbox { + padding : 24px; + spacing : 24px; +} + +inputbar { + padding : 8px; + spacing : 4px; + children : [ icon-search, entry ]; + border : 0 0 2px 0 solid; + border-color : @accent; + border-radius : 2px; + background-color : @bg0; +} + +icon-search, entry, element-icon, element-text { + vertical-align: 0.5; +} + +icon-search { + expand : false; + filename : "search-symbolic"; + size : 24px; +} + +entry { + font : "Roboto 12"; + placeholder : "Type here to search"; + placeholder-color : @fg1; +} + +textbox { + padding : 4px 8px; + background-color : @bg2; +} + +listview { + columns : 2; + spacing : 8px; + fixed-height : true; + fixed-columns : true; +} + +element { + spacing : 1em; + padding : 8px; + border-radius : 2px; +} + +element normal urgent { + text-color: @urgent; +} + +element normal active { + text-color: @accent; +} + +element selected { + background-color: @bg3; +} + +element selected urgent { + background-color: @urgent; +} + +element-icon { + size: 1.5em; +} + +element-text { + text-color: inherit; +} diff --git a/roles/dots/files/config/rofi/themes/windows11-list-light.rasi b/roles/dots/files/config/rofi/themes/windows11-list-light.rasi new file mode 100644 index 0000000..12c7dad --- /dev/null +++ b/roles/dots/files/config/rofi/themes/windows11-list-light.rasi @@ -0,0 +1,106 @@ +* { + font: "Roboto 10"; + + bg0 : #ffffff80; + bg1 : #f9f9f9bf; + bg2 : #f7f7f7; + bg3 : #fefefebf; + fg0 : #1a1a1a; + fg1 : #5f5f5f; + accent : #005fb8; + urgent : @accent; + + background-color : transparent; + text-color : @fg0; + + margin : 0; + padding : 0; + spacing : 0; +} + +element-icon, element-text, scrollbar { + cursor: pointer; +} + +window { + location : south; + width : 600px; + height : 600px; + y-offset : -4px; + + background-color : @bg1; + border-radius : 8px; +} + +mainbox { + padding : 24px; + spacing : 24px; +} + +inputbar { + padding : 8px; + spacing : 4px; + children : [ icon-search, entry ]; + border : 0 0 2px 0 solid; + border-color : @accent; + border-radius : 2px; + background-color : @bg0; +} + +icon-search, entry, element-icon, element-text { + vertical-align: 0.5; +} + +icon-search { + expand : false; + filename : "search-symbolic"; + size : 24px; +} + +entry { + font : "Roboto 12"; + placeholder : "Type here to search"; + placeholder-color : @fg1; +} + +textbox { + padding : 4px 8px; + background-color : @bg2; +} + +listview { + columns : 2; + spacing : 8px; + fixed-height : true; + fixed-columns : true; +} + +element { + spacing : 1em; + padding : 8px; + border-radius : 2px; +} + +element normal urgent { + text-color: @urgent; +} + +element normal active { + text-color: @accent; +} + +element selected { + background-color: @bg3; +} + +element selected urgent { + background-color: @urgent; +} + +element-icon { + size: 1.5em; +} + +element-text { + text-color: inherit; +} diff --git a/roles/dots/files/home/.Xresources b/roles/dots/files/home/.Xresources new file mode 100644 index 0000000..fbc4a2d --- /dev/null +++ b/roles/dots/files/home/.Xresources @@ -0,0 +1,2 @@ +Xcursor.size: 24 + diff --git a/roles/dots/files/home/.alacritty.toml b/roles/dots/files/home/.alacritty.toml new file mode 100644 index 0000000..652068f --- /dev/null +++ b/roles/dots/files/home/.alacritty.toml @@ -0,0 +1,25 @@ +[font] +size = 12.0 + +[font.bold] +family = "JetBrainsMonoNl Nerd Font Mono" +style = "Bold" + +[font.bold_italic] +family = "JetBrainsMonoNl Nerd Font Mono" +style = "Bold Italic" + +[font.italic] +family = "JetBrainsMonoNl Nerd Font Mono" +style = "Italic" + +[font.normal] +family = "JetBrainsMonoNl Nerd Font Mono" +style = "Regular" + +[window] +padding = { x = 15, y = 15 } +opacity = 0.8 + +[colors.primary] +background = "#000000" diff --git a/roles/dots/files/home/.bashrc b/roles/dots/files/home/.bashrc new file mode 100644 index 0000000..caf5dff --- /dev/null +++ b/roles/dots/files/home/.bashrc @@ -0,0 +1,134 @@ +# +# ~/.bashrc +# + +# If not running interactively, don't do anything +[[ $- != *i* ]] && return + +export PATH="$HOME/.config/emacs/bin:$PATH" +export PATH="$HOME/.local/bin:$PATH" + +alias ls='ls --color=auto' +alias grep='grep --color=auto' + +echo "" +# PS1="[\w] ($(git branch 2>/dev/null | grep '^*' | colrm 1 2)) \n-> " +PS1='[\w]$(git rev-parse --is-inside-work-tree &>/dev/null && echo " ($(git branch 2>/dev/null | grep '\''^\*'\'' | colrm 1 2))") \n-> ' + +export VISUAL=nvim +export EDITOR="$VISUAL" + +function tmux_create_session_with_FZF() { + # tmux new session + DIR=$(find /home/fs/Desktop/pet /home/fs/Desktop/tmp /home/fs/Desktop/work -maxdepth 2 -type d ! -readable -prune -o -print | fzf) + + if [ -z "$DIR" ]; then + return + fi + + DIR_NAME=$(basename "$DIR") + CURRENT_DIR=$(echo "${DIR}" | awk -F'/' '{print $(NF-1)}') + + SESSION_NAME="${CURRENT_DIR}/${DIR_NAME}" + + if ! tmux has-session -t "$SESSION_NAME" 2>/dev/null; then + tmux new-session -s "$SESSION_NAME" -c "$DIR" + else + tmux attach-session -t "$SESSION_NAME" + fi +} + +function tmux_attach_session_FZF() { + # tmux open exist session + SESSION_NAME=$(tmux ls | awk '{print $1}' | sed s/:// | fzf) + if [ -z "$SESSION_NAME" ]; then + return + fi + + tmux attach-session -t "$SESSION_NAME" +} + +function cd_with_FZF() { + cd $(find /home/fs/Desktop/pet /home/fs/Desktop/tmp /home/fs/Desktop/work -maxdepth 2 -type d ! -readable -prune -o -print | fzf) +} + +function git_checkout_FZF() { + BRANCH_FZF_OUTPUT="$(git branch | fzf)" + BRANCH_NAME="$(echo "$BRANCH_FZF_OUTPUT" | sed 's/ //g')" + + git checkout "$BRANCH_NAME" +} + +function git_checkout_r_FZF() { + BRANCH_FZF_OUTPUT="$(git branch -r | fzf)" + BRANCH_NAME="$(echo "$BRANCH_FZF_OUTPUT" | sed 's/ //g')" + NEW_BRANCH_NAME="$(echo "$BRANCH_NAME" | sed 's/origin\///g')" + + git checkout -b "$NEW_BRANCH_NAME" "$BRANCH_NAME" +} + +function git_pull() { + BRANCH_NAME="$(git branch | grep "*" | sed s/*// | sed s/\ //)" + git pull origin "$BRANCH_NAME" +} + +set -o vi +bind '"jk":"\e"' + +# main +alias v='nvim' +alias s='exa -al --color=always --group-directories-first' +alias c='clear' + +# pyenv +alias en='source ../../env/bin/activate' +alias end='source env/bin/activate' + +# docker +alias dc='docker compose' +alias db='docker compose exec backend bash' +alias ds='docker compose exec backend sh' + +# tmux +alias tw="if ! tmux has-session -t work 2>/dev/null; then tmux new-session -s work; else tmux attach-session -t work; fi" +alias some="if ! tmux has-session -t some 2>/dev/null; then tmux new-session -s some; else tmux attach-session -t some; fi" +alias tn="tmux new-session -s" +alias tl='tmux ls' +alias tf=tmux_create_session_with_FZF +alias ta=tmux_attach_session_FZF +alias f=cd_with_FZF + +# daily features +alias fm="pcmanfm &" +alias moc='mocp -T tty' +alias ff3='/home/fs/Desktop/a79/env/bin/python3 /home/fs/Desktop/a79/ff3.py' +alias bg='feh --bg-fil' +alias em='emacsclient -t' +alias wifi='/home/fs/bin/wifi.py' +alias bgg='/home/fs/bin/gifwall.sh' + +# git +alias gdel='f() { git branch -D $(git branch | grep "$1"); }; f' +alias gbl='git branch' +alias gnew='git checkout -b $1' +alias gs='git status' + +alias gf="git fetch" +alias gc=git_checkout_FZF +alias gcr=git_checkout_r_FZF +alias gpu=git_pull + +alias gsl='git stash list' +alias gss='git stash save' +alias gsp='git stash pop' + +# ============ CHEAT SHEET ============ +# Forward Tunnel: map port from remote machine/network on local machine +# ssh -L $LOCAL_PORT:$REMOTE_IP:$REMOTE_PORT $USER@$SERVER + +# Reverse Tunnel: make local port accessable to remote machine +# ssh -R $REMOTE_PORT:$LOCAL_IP:$LOCAL_PORT $USER@$SERVER +# + +[ -f "/home/fs/.ghcup/env" ] && . "/home/fs/.ghcup/env" # ghcup-env + diff --git a/roles/dots/files/home/.emacs.d/config.org b/roles/dots/files/home/.emacs.d/config.org new file mode 100644 index 0000000..2ba0ee6 --- /dev/null +++ b/roles/dots/files/home/.emacs.d/config.org @@ -0,0 +1,1034 @@ +#+TITLE:Config +#+AUTH +#+STARTUP: showeverything + +* :toc: +- [[#auto-install-packages][auto install packages]] +- [[#common][common]] +- [[#main-packages][main packages]] + - [[#general-keybindings][General keybindings]] + - [[#evil-mode][Evil Mode]] + - [[#pojectile][pojectile]] + - [[#ivy][Ivy]] + - [[#counsel][Counsel]] + - [[#dired][dired]] + - [[#openwith][openwith]] + - [[#org-download][org-download]] + - [[#perspective][perspective]] + - [[#anzu][anzu]] + - [[#doom-modeline][doom-modeline]] + - [[#perfect-margin][Perfect margin]] + - [[#neotree][NeoTree]] +- [[#keybinds][KeyBinds]] + - [[#file][file]] + - [[#marks][marks]] + - [[#buffer--bookmarks--harpoon][buffer & bookmarks & harpoon]] + - [[#project][project]] + - [[#sudo-edit--code-sudo-editsplitperfect-marginjson][Sudo Edit & code (sudo edit/split/perfect margin/json)]] + - [[#magit][Magit]] +- [[#org-settings][ORG settings]] + - [[#org-hot-key][org hot key]] + - [[#org-temo-chet-sheet][Org Temo chet sheet]] + - [[#toc][toc]] + - [[#org-babel-execute][org babel execute]] + - [[#org-agenda][org agenda]] + - [[#org-image][Org Image]] +- [[#programming][PROGRAMMING]] + - [[#python][python]] + - [[#go][go]] +- [[#decorations][decorations]] + - [[#colorthemes][colorthemes]] + - [[#diff][diff]] + - [[#fonts][fonts]] + - [[#ligature][ligature]] + - [[#icons][icons]] + - [[#rainbow-mode][rainbow mode]] + - [[#nyan-mode][Nyan-mode]] + - [[#evil-snipe][evil-snipe]] + - [[#org-chckbox-hl][org chckbox hl]] + - [[#hl-todo][hl-todo]] +- [[#scripts][scripts]] + - [[#add-projectile-project][add projectile project]] + - [[#rest][REST]] + - [[#results_output][results_output]] + - [[#open-terminal][open terminal]] +- [[#tood][TOOD]] + +* auto install packages +#+begin_src emacs-lisp +(require 'package) +(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t) +(package-initialize) + +;; Список пакетов для установки. +(defvar my-required-packages + '(doom-themes + doom-modeline + evil + evil-collection + evil-surround + evil-snipe + which-key + general + key-chord + toc-org + org-bullets + projectile + sudo-edit + ivy + counsel + harpoon + bm + vterm + org-download + restclient + magit + magit-delta + image-dired + + ;; decorations + rainbow-mode + all-the-icons + all-the-icons-dired ;; M-x all-the-icons-install-fonts + centered-window + nyan-mode + perfect-margin + hl-todo + ligature + + tree-sitter + diff-hl + dired-subtree + tree-sitter-langs + flycheck + flycheck-pycheckers + ;; python + elpy + ;; copilot + ;; editorconfig + ; jsonrpc + haskell-mode + + ;; frontend + web-mode + )) + +;; Установите недостающие пакеты. +(dolist (p my-required-packages) + (unless (package-installed-p p) + (package-install p))) +#+end_src + + +* common +#+begin_src emacs-lisp +(menu-bar-mode -1) ; Отключение меню-бара +(tool-bar-mode -1) ; Отключение панели инструментов +(scroll-bar-mode -1) ; Отключение вертикальной полосы прокрутки +(show-paren-mode 1) ; Включение подсветки соответствующих скобок + +(setq make-backup-files nil) ; Отключение создания файлов резервных копий (файлов с суффиксом ~) +(setq auto-save-default nil) ; Отключение автосохранения и создания файлов с префиксом .# +(setq inhibit-startup-screen t) ; Отключение стартового экрана при запуске Emacs + +(setq-default isearch-lazy-highlight t) ; Включение "ленивой" подсветки при поиске + +(global-visual-line-mode t) ; Включение переноса строк вместо горизонтального скролла +(setq-default display-line-numbers 'relative) ; Включение относительных номеров строк + +(prefer-coding-system 'utf-8) ; Установка предпочтительной системы кодирования на UTF-8 +(set-default-coding-systems 'utf-8) ; Установка системы кодирования по умолчанию на UTF-8 +(set-terminal-coding-system 'utf-8) ; Установка системы кодирования терминала на UTF-8 +(set-keyboard-coding-system 'utf-8) ; Установка системы кодирования клавиатуры на UTF-8 +(setq default-buffer-file-coding-system 'utf-8) ; Установка системы кодирования файловых буферов на UTF-8 +(setq scroll-conservatively 10000) ; Установка плавного скроллинга без резкого перемещения экрана +(electric-pair-mode 1) ; автоматически закрывать скопки +(global-hl-line-mode 1) ; cursor line +(add-hook 'before-save-hook 'delete-trailing-whitespace) ; Удаление пустых пробелов в конце строк перед сохранением файла +(blink-cursor-mode 0) ; cursorline +(setq display-fill-column-indicator nil) ; отключить вертикальные линии +(setq warning-minimum-level :error) ; отключить предупреждения +#+end_src + +* main packages + +** General keybindings +https://github.com/noctuid/general.el +*** Setup +#+begin_src emacs-lisp +(use-package general + :ensure t + :config + (general-evil-setup) + + (general-create-definer spc-leader + :states '(normal insert visual emacs) + :keymaps 'override + :prefix "SPC" ;; set leader key + :global-prefix "M-SPC")) ;; access leader in insert mode +#+end_src + +*** KeyBind +#+begin_src emacs-lisp +(spc-leader + "8" '(save-buffer :wk "save file") + "2" '(evil-quit :wk "quit file") + "7" '(evil-first-non-blank :wk "first non blank") + "9" '(evil-last-non-blank :wk "last non blank") + "h r r" '((lambda () (interactive) (load-file "/home/fs/.emacs.d/init.el")) :wk "Reload emacs config") +) +#+end_src + +** Evil Mode +https://github.com/emacs-evil/evil +*** Setup +#+begin_src emacs-lisp +(use-package evil + :ensure t + :init + (setq evil-want-integration t) + (setq evil-want-keybinding nil) + (setq evil-vsplit-window-right t) + (setq evil-split-window-below t) + (setq evil-want-C-u-scroll t) + :config + (evil-mode 1) + (define-key evil-normal-state-map "p" 'evil-paste-after) + (setq evil-kill-on-visual-paste nil)) + +(use-package evil-collection + :after evil + :ensure t + :config + (setq evil-collection-mode-list '(dashboard dired ibuffer)) + (evil-collection-init)) + +(use-package evil-surround + :ensure t + :config + (global-evil-surround-mode 1) + (setq-default evil-surround-pairs-alist '((?\( . ("(" . ")")) + (?\[ . ("[" . "]")) + (?\{ . ("{" . "}")) + (?\" . ("\"" . "\"")) + (?\` . ("`" . "`")) + (?\' . ("'" . "'")) + (?\) . ("(" . ")")) + (?\] . ("[" . "]")) + (?\} . ("{" . "}"))))) +#+end_src + +*** KeyBing +#+begin_src emacs-lisp +(require 'key-chord) +(key-chord-mode 1) +(key-chord-define evil-insert-state-map "jk" 'evil-normal-state) +(key-chord-define evil-insert-state-map "kj" 'evil-normal-state) + +(advice-add 'evil-scroll-up :after #'evil-scroll-line-to-center) +(advice-add 'evil-scroll-down :after #'evil-scroll-line-to-center) + +(define-key evil-normal-state-map (kbd ",") 'evil-scroll-up) +(define-key evil-normal-state-map (kbd ".") 'evil-scroll-down) + +(spc-leader + "l l" 'evil-scroll-line-to-center) +#+end_src + +** pojectile +#+begin_src emacs-lisp +(use-package projectile + :ensure t + :init + (projectile-mode +1) + :config + (setq projectile-completion-system 'ivy)) +#+end_src + +** Ivy +*** Setup +#+begin_src emacs-lisp +(use-package ivy + :ensure t + :init + (ivy-mode +1)) + +(define-key ivy-minibuffer-map (kbd "C-l") 'ivy-immediate-done) +(define-key ivy-minibuffer-map (kbd "RET") 'ivy-done) +(define-key ivy-minibuffer-map (kbd "") 'ivy-done) +#+end_src + +*** KeyBind +#+begin_src emacs-lisp +(define-key ivy-minibuffer-map (kbd "C-j") 'ivy-next-line) +(define-key ivy-minibuffer-map (kbd "C-k") 'ivy-previous-line) +#+end_src + +** Counsel +#+begin_src emacs-lisp +(unless (package-installed-p 'counsel) + (package-refresh-contents) + (package-install 'counsel)) + +(setq counsel-fzf-cmd "find . -type f -not -path '*/.*' | fzf -f \"%s\"") +#+end_src + +** dired +*** setup +#+begin_src emacs-lisp +(require 'dired) + +(defun dired-open-file-in-new-tab () + "Open the current file in dired in a new tab." + (interactive) + (tab-new) + (dired-find-file)) + +(setq dired-listing-switches "-alXGh --group-directories-first" + dired-recursive-copies 'always + dired-recursive-deletes 'top + global-auto-revert-non-file-buffers t + auto-revert-verbose nil + dired-dwim-target t + wdired-allow-to-change-permissions t) + +#+end_src + + + +*** открыть файл в вертикально разделенном экране +#+begin_src emacs-lisp +(defun dired-open-split-horizontal () + "In dired, open current file in another window if exists, otherwise split window horizontally." + (interactive) + ;; Сохраняем путь текущего файла + (let ((current-file (dired-get-file-for-visit))) + ;; Проверяем, есть ли другое окно + (if (one-window-p) + (split-window-horizontally)) + ;; Переключаемся на другое окно + (other-window 1) + ;; Открываем файл или каталог, используя сохраненный путь + (find-file current-file)) + (other-window 1) +) + +(define-key dired-mode-map (kbd "s") 'dired-open-in-split-window) + +(evil-define-key 'normal dired-mode-map (kbd "s") 'dired-open-split-horizontal) +(evil-define-key 'normal dired-mode-map (kbd "h") 'dired-up-directory) +#+end_src + +*** копировать текущий путь +#+begin_src emacs-lisp +(defun copy-current-file-path-to-clipboard () + "Copy the current buffer file name to the clipboard." + (interactive) + (let ((filename (if (equal major-mode 'dired-mode) + default-directory + (buffer-file-name)))) + (when filename + (kill-new filename) + (message "Copied buffer file name '%s' to the clipboard." filename)))) +#+end_src + +*** dired subtree +#+begin_src emacs-lisp +(require 'dired-subtree) + +(evil-define-key 'normal dired-mode-map (kbd "i") 'dired-subtree-insert) +(evil-define-key 'normal dired-mode-map (kbd "r") 'dired-subtree-remove) +(evil-define-key 'normal dired-mode-map (kbd "o") 'dired-open-file-in-new-tab) + +#+end_src + +*** открыть pcmanfm +#+begin_src emacs-lisp +(defun dired-open-pcmanfm () + "Open the current directory in Dired with PCManFM." + (interactive) + (let ((current-dir (dired-current-directory))) + (start-process "pcmanfm" nil "pcmanfm" current-dir))) + +(define-key dired-mode-map (kbd "C-c o") 'dired-open-pcmanfm) + +#+end_src + +*** dired hot keys +#+begin_src emacs-lisp +(spc-leader + "d" '(:ignore t :wk "dired") + "d o" '(dired :wk "open dired") + + "d c" '(:ignore t :wk "copy/crete") + "d c c" '(dired-do-copy :wk "dired copy") + "d c d" '(dired-create-directory :wk "create dir") + "d c f" '(dired-create-empty-file :wk "crete file") + "d c p" '(copy-current-file-path-to-clipboard :wk "copy file path to clipboard") + "d r" '(dired-do-rename :wk "renema & move") + + "d p" '(:ignore t :wk "permissions") + "d p p" '(dired-do-chmod :wk "chmod") + "d p o" '(dired-do-chown :wk "chown") + + "d h" '(dired-hide-details-mode :wk "hide/show deteils") +) +#+end_src + +** openwith +#+begin_src emacs-lisp +(use-package openwith + :ensure t + :config + +(openwith-mode t) +(setq openwith-associations + (list (list (openwith-make-extension-regexp '("pdf")) + "atril" '(file)) + (list (openwith-make-extension-regexp '("flac" "mp3" "wav")) + "vlc" '(file)) + (list (openwith-make-extension-regexp '("bmp" "jpeg" "jpg" "png")) + "vimiv" '(file)) + (list (openwith-make-extension-regexp '("mpv" "mkv" "mp4")) + "mpv" '(file)) + (list (openwith-make-extension-regexp '("doc" "docx" "odt")) + "libreoffice" '("--writer" file)) + (list (openwith-make-extension-regexp '("ods" "xls" "xlsx")) + "libreoffice" '("--calc" file)) + (list (openwith-make-extension-regexp '("odp" "pps" "ppt" "pptx")) + "libreoffice" '("--impress" file)) + ))) + +;; Отключить автоматическое открытие изображений в Emacs +(setq auto-mode-alist (rassq-delete-all 'image-mode auto-mode-alist)) + +;; Функция для отключения openwith-mode в org-mode +(defun disable-openwith-in-org-mode () + "Disable openwith-mode in org-mode." + (when openwith-mode + (openwith-mode -1))) + +;; Добавляем хук для отключения openwith-mode в org-mode +(add-hook 'org-mode-hook 'disable-openwith-in-org-mode) +#+end_src + + +** org-download +#+begin_src emacs-lisp +(require 'org-download) +(defun my-org-download-set-dir () + "Set `org-download-image-dir` to the directory of the current + buffer's file." + (setq-local org-download-image-dir (concat (file-name-directory + (buffer-file-name)) "/images/" (file-name-base buffer-file-name) "/") )) + +(add-hook 'org-mode-hook 'my-org-download-set-dir) +(add-hook 'dired-mode-hook 'org-download-enable) +#+end_src + + +** perspective +#+begin_src emacs-lisp +(use-package perspective + :ensure t + :config + (setq persp-mode-prefix-key nil + persp-suppress-no-prefix-key-warning t) + (persp-mode)) + +(spc-leader + "w" '(:ignore t :wk "workspace") + "w i" '(persp-switch :wk "switch workspace") + "w n" '(persp-next :wk "next workspace") + "w p" '(persp-prev :wk "prev workspace") + "w k" '(persp-kill :wk "kill workspace") + "w r" '(persp-rename :wk "rename workspace") + + "w l" '(persp-state-load :wk "state load") + "w s" '(persp-state-save :wk "state save") + + "w 1" '((lambda () (interactive) (persp-switch-by-number 1)) :wk "1") + "w 2" '((lambda () (interactive) (persp-switch-by-number 2)) :wk "2") + "w 3" '((lambda () (interactive) (persp-switch-by-number 3)) :wk "3") + "w 4" '((lambda () (interactive) (persp-switch-by-number 4)) :wk "4") + "w 5" '((lambda () (interactive) (persp-switch-by-number 5)) :wk "5") + "w 6" '((lambda () (interactive) (persp-switch-by-number 6)) :wk "6") + "w 7" '((lambda () (interactive) (persp-switch-by-number 7)) :wk "7") + "w 8" '((lambda () (interactive) (persp-switch-by-number 8)) :wk "8") + "w 9" '((lambda () (interactive) (persp-switch-by-number 9)) :wk "9") +) +#+end_src + +** anzu +#+begin_src emacs-lisp +(use-package anzu + :ensure t + :config +) + +(use-package evil-anzu + :ensure t + :after (evil anzu) + :config + (setq anzu-search-threshold 0) + (setq anzu-cons-mode-line-p nil) + (global-anzu-mode 1)) +#+end_src + +** doom-modeline +#+begin_src emacs-lisp +(require 'doom-modeline) +(doom-modeline-mode 1) +#+end_src + +** Perfect margin +#+begin_src emacs-lisp +(setq perfect-margin-visible-width 150) +#+end_src + +** NeoTree +*** Setup +#+begin_src emacs-lisp +(use-package neotree + :ensure t + :bind ("" . neotree-toggle) + :config + ;; Отображать файлы и папки на том же уровне + (setq-default neo-smart-open t) + ;; Вертикальное расположение окна neotree + (setq neo-window-position 'left) + ) + +;; Активация пакетов +(use-package all-the-icons :ensure t) +(setq neo-theme (if (display-graphic-p) 'icons 'arrow)) +(setq neo-window-fixed-size nil) +(setq neo-smart-open t) +(setq neo-window-width 50) + + +(add-hook 'neotree-mode-hook + (lambda () + (define-key evil-normal-state-local-map (kbd "q") 'neotree-hide) + (define-key evil-normal-state-local-map (kbd "RET") 'neotree-enter) + (define-key evil-normal-state-local-map (kbd "g") 'neotree-refresh) + (define-key evil-normal-state-local-map (kbd "f") 'neotree-create-node) + )) +#+end_src + +*** KeyBind +#+begin_src emacs-lisp +(spc-leader + "c c" '(neotree-show :wk "toggle neoTree") +) +#+end_src + +* KeyBinds +** file +#+begin_src emacs-lisp +(defun open-current-directory-in-dired () + "Open the current directory of the current file in Dired. +If a Dired buffer is already opened, navigate to that buffer." + (interactive) + (let ((dir (file-name-directory (or buffer-file-name default-directory)))) + (if (get-buffer-window (dired-noselect dir)) + (switch-to-buffer-other-window (dired-noselect dir)) + (dired-jump nil dir)))) + +(spc-leader + "f" '(:ignore t :wk "file") + "f c" '(copy-file :wk "copy file") + "f o" '(open-current-directory-in-dired :wk "open in dired")) +#+end_src + +** marks +#+begin_src emacs-lisp +(spc-leader + "m" '(:ignore t :wk "marks") + "m a" '(bm-toggle :wk "toggle mark") + ;; "m n" '(bm-next :wk "next mark") + "m n" '(lambda () (interactive) (bm-next) (recenter) :wk "next mark") + "m p" '(lambda () (interactive) (bm-previous) (recenter) :wk "prev mark") + ;; "m p" '(bm-previous :wk "prev mark") + "m l" '(bm-show :wk "list marks") + "m g" '(lambda () (interactive) (bm-show-goto-bookmark) (recenter) :wk "goto bookmark") + "m c" '(bm-remove-all-all-buffers :wk "claer mark")) + +(setq bm-marker 'bm-marker-left) +(setq bm-highlight-style nil) +(setq bm-highlight-style 'bm-highlight-only-fringe) +(custom-set-faces + '(bm-face ((t (:background "yellow" :foreground "black" :weight bold))))) +#+end_src + +** buffer & bookmarks & harpoon +#+begin_src emacs-lisp +(spc-leader + ;; buffer + "b" '(:ignore t :wk "buffer") + "b i" '(ibuffer :wk "Switch ibuffer") + "b b" '(projectile-switch-to-buffer :wk "Switch buffer") + "b k" '(kill-this-buffer :wk "Kill this buffer") + ;; bookmark + "b s" '(bookmark-set :wk "set bookmarks") + "b d" '(bookmark-delete :wk "delete bookmarks") + "b l" '(list-bookmarks :wk "list bookmarks") + "b j" '(bookmark-jump :wk "list jump") + "b a" '(bookmark-set :wk "bookmarks set") + "b r" '(revert-buffer :wk "Reload buffer")) + +(spc-leader + "TAB" '(:ignore t :wk "?") + "TAB TAB" '(comment-line :wk "comment line") +) + +(spc-leader + "h" '(:ignore t :wk "help & harpoon") + "h a" '(harpoon-add-file :wk "add to harpoon") + "h c" '(harpoon-clear :wk "harboon clear") + "h l" '(harpoon-toggle-quick-menu :wk "toggle menu") + "h m" '(harpoon-quick-menu-hydra :wk "quick menu") + + "h 1" '(harpoon-go-to-1 :wk "1") + "h 2" '(harpoon-go-to-2 :wk "2") + "h 3" '(harpoon-go-to-3 :wk "3") + "h 4" '(harpoon-go-to-4 :wk "4") + "h 5" '(harpoon-go-to-5 :wk "5") + + "h d" '(harpoon-delete-item :wk "delete item") +) +#+end_src + +** project +add and switch project +#+begin_src emacs-lisp +(defun projectile/open-and-switch-project (directory) + " - " + (interactive (list (read-directory-name "What directory? "))) + (let ( + (projectile-file-path (concat directory "/.projectile")) + (git-directory-path (concat directory "/.git"))) + (unless (file-directory-p git-directory-path) + (unless (file-exists-p projectile-file-path) + (make-empty-file projectile-file-path))) + (projectile-add-known-project directory))) + +#+end_src + +hot keys +#+begin_src emacs-lisp +(spc-leader + "," '(find-file :wk "find file") + "SPC" '(counsel-fzf :wk "fzf find file") + "." '(swiper :wk "swiper") + + "p" '(:ignore t :wk "projectile") + "p a" '(projectile/open-and-switch-project :wk "add project") + "p s" '(projectile-switch-project :wk "switch project") + ;; "p g" '(counsel-rg :wk "project tile grep") + "p g" '(lambda () (interactive) (counsel-rg) (recenter) :wk "project tile grep") + + "b i" '(projectile-ibuffer :wk "Switch buffer") + "b n" '(projectile-next-project-buffer :wk "next project buffer") + "b p" '(projectile-previous-project-buffer :wk "previous project buffer")) + +#+end_src + +** Sudo Edit & code (sudo edit/split/perfect margin/json) +#+begin_src emacs-lisp +(require 'sudo-edit) +(spc-leader + "c" '(:ignore t :wk "code") + "c s" '(sudo-edit :wk "sudo-edit") + "c u" '(comment-line :wk "comment line") + + "s" '(:ignore t :wk "split window") + "s h" '(split-window-right :wk "split window horizontaly") + "s v" '(split-window-below :wk "split window verticalty") + + "c p" '(perfect-margin-mode :wk "center") + "c j" '(json-pretty-print :wk "json") +) +#+end_src + +** Magit +#+begin_src emacs-lisp + +(require 'magit) + (spc-leader + "g" '(:ignore t :wk "git") + "g g" '(magit :wk "magit") + "g a" '(magit-stage-buffer-file :wk "add curent file") + "g u" '(magit-unstage-buffer-file :wk "unstage current file") + + "g l" '(:ignore t :wk "log") + "g l g" '(magit-log-current :wk "log") + "g l l" '(magit-log-buffer-file :wk "log buffer") + + "g c" '(magit-commit t :wk "commit") + + "g b" '(:ignore t :wk "branch") + "g b b" '(magit-branch-checkout t :wk "checkout") + "g b c" '(magit-branch-create t :wk "create branch") + "g b p" '(magit-pull-branch t :wk "pull") + + "g s" '(:ignore t :wk "stash") + "g s s" '(magit-stash t :wk "stash") + "g s p" '(magit-stash-pop t :wk "stash pop") + + "g d" '(:ignore t :wk "diff") + "g d d" '(magit-diff-buffer-file :wk "log buffer") + "g d g" '(magit-diff-unstaged :wk "diff unstaged buffer") + "g d s" '(magit-diff-staged :wk "diff staged buffer") + ) +#+end_src + +* ORG settings +** org hot key +#+begin_src emacs-lisp + +(spc-leader + "o" '(:ignore t :wk "org hot key") + "o c" '(org-time-stamp :wk "calendar paste date") + "o l" '(org-shiftmetaright :wk "move metric right") + "o h" '(org-shiftmetaleft :wk "move metric left") + "o t" '(org-tree-to-indirect-buffer :wk "tree to inderect buffer") + "o o" '(org-cycle-global :wk "org cycle global") + "o i" '(org-display-inline-images :wk "display image") + + "o m" '(org-babel-execute-src-block :wk "org babel execute") + "o e" '(org-edit-src-code :wk "org babel execute") + "o r" '(org-reset-checkbox-state-subtree :wk "reset checkboxs") + "o g" '(org-agenda :wk "org agenda") + "o m" '(eval-buffer :wk "eval buffer") + + "h RET" '(org-meta-return :wk "org return (insert lists))") +) +#+end_src + +** Org Temo chet sheet +| Typing the below + TAB | Expands to ... | +|------------------------+---------------------------------------| +| " "<|||" "<==>" "" "---" "-<<" + "<~~" "<~>" "<*>" "<||" "<|>" "<$>" "<==" "<=>" "<=<" "<->" + "<--" "<-<" "<<=" "<<-" "<<<" "<+>" "" "###" "#_(" "..<" + "..." "+++" "/==" "///" "_|_" "www" "&&" "^=" "~~" "~@" "~=" + "~>" "~-" "**" "*>" "*/" "||" "|}" "|]" "|=" "|>" "|-" "{|" + "[|" "]#" "::" ":=" ":>" ":<" "$>" "==" "=>" "!=" "!!" ">:" + ">=" ">>" ">-" "-~" "-|" "->" "--" "-<" "<~" "<*" "<|" "<:" + "<$" "<=" "<>" "<-" "<<" "<+" "" "++" "?:" + "?=" "?." "??" ";;" "/*" "/=" "/>" "//" "__" "~~" "(*" "*)" + "\\\\" "://")) + ;; Enables ligature checks globally in all buffers. You can also do it + ;; per mode with `ligature-mode'. + (global-ligature-mode t)) +#+end_src + + +** icons +#+begin_src emacs-lisp +(require 'all-the-icons) +(require 'all-the-icons-dired) +(add-hook 'dired-mode-hook 'all-the-icons-dired-mode) +#+end_src + +** rainbow mode +This minor mode sets background color to strings that match color +names, e.g. #0000ff is displayed in white with a blue background. +#+begin_src emacs-lisp +(require 'rainbow-mode) +(add-hook 'org-mode-hook 'rainbow-mode) +(add-hook 'prog-mode-hook 'rainbow-mode) +#+end_src + +** Nyan-mode +#+begin_src emacs-lisp +(require 'nyan-mode) +(nyan-mode +1) +(setq nyan-toggle-wavy-trail t) +(setq nyan-start-animation t) +#+end_src + +** evil-snipe +#+begin_src emacs-lisp +(require 'evil-snipe) +(evil-snipe-mode +1) +(evil-snipe-override-mode +1) +(setq evil-snipe-smart-case +1) +#+end_src + +** org chckbox hl +#+begin_src emacs-lisp +(defface org-checkbox-done-text + '((t (:inherit org-done))) + "Face for the text part of a checked org-mode checkbox.") + + (font-lock-add-keywords + 'org-mode + `(("^[ \t]*\\(?:[-+*]\\|[0-9]+[).]\\)[ \t]+\\(\\(?:\\[@\\(?:start:\\)?[0-9]+\\][ \t]*\\)?\\[\\(?:X\\|\\([0-9]+\\)/\\2\\)\\][^\n]*\n\\)" 1 'org-checkbox-done-text prepend)) + 'append) +#+end_src + +** hl-todo +#+begin_src emacs-lisp +;(require 'hl-todo) +;(global-hl-todo-mode +1) +#+end_src + +* scripts +** add projectile project +#+begin_src emacs-lisp +(defun create-empty-projectile-file () + "Create an empty .projectile file in the current directory." + (interactive) + (let ((projectile-file ".projectile")) + (if (file-exists-p projectile-file) + (message ".projectile file already exists in this directory.") + (write-region "" nil projectile-file) + (message ".projectile file created successfully.")))) +#+end_src +** REST +#+begin_src emacs-lisp +(defun send-easy-http () + (interactive) + (let ( + (output-buffer (get-buffer-create "*Rest Output*")) + (command (concat "python /home/fs/bin/easy_http.py " buffer-file-name " " (projectile-project-root)))) + (save-buffer) + (unless (get-buffer-window output-buffer) + (split-window-right) + (other-window 1) + (switch-to-buffer output-buffer) + (other-window -1)) + (with-current-buffer output-buffer + (js-mode) + (erase-buffer) + (shell-command command output-buffer) + (goto-char (point-max))) + (message command))) + +(require 'restclient) +(add-to-list 'auto-mode-alist '("\\.http\\'" . restclient-mode)) + +(spc-leader + "r" '(:ignore t :wk "rest") + "r s" '(send-easy-http :wk "send http") + "r a" '(create-empty-projectile-file :wk "create projectile file") +) +#+end_src + +** results_output +#+begin_src emacs-lisp +(defun insert-results-output () + (interactive) + (insert " :results output") +) + +(spc-leader + "i c r" '(insert-results-output :wk " :results output") +) +#+end_src + +** open terminal +#+begin_src emacs-lisp +(defun open-term () + "Open a terminal in a new right split window." + (interactive) + (let ((term-buffer (generate-new-buffer "*term*"))) + (set-window-buffer (split-window-right) term-buffer) + (select-window (get-buffer-window term-buffer)) + (vterm))) + +(spc-leader + "t t" '(open-term :wk "terminal") +) +#+end_src + +* TOOD +1. сохронять файл при смене буфера +2. горячие клавиши для изменения размера окон +3. найти альтернативу format all +4. более быстрый python lsp +5. copilot +6. найти более подходящий спсоб работы со шрифтами и добавить горячие клавиши для управления размерами шрифтов +7. org mod upgrade +8. протестить дерево сохранений diff --git a/roles/dots/files/home/.emacs.d/init.el b/roles/dots/files/home/.emacs.d/init.el new file mode 100644 index 0000000..8f4c8b8 --- /dev/null +++ b/roles/dots/files/home/.emacs.d/init.el @@ -0,0 +1,24 @@ +(org-babel-load-file + (expand-file-name + "config.org" + user-emacs-directory)) + +; (custom-set-faces +; ;; custom-set-faces was added by Custom. +; ;; If you edit it by hand, you could mess it up, so be careful. +; ;; Your init file should contain only one such instance. +; ;; If there is more than one, they won't work right. +(custom-set-variables + ;; custom-set-variables was added by Custom. + ;; If you edit it by hand, you could mess it up, so be careful. + ;; Your init file should contain only one such instance. + ;; If there is more than one, they won't work right. + '(custom-safe-themes + '("3cdd0a96236a9db4e903c01cb45c0c111eb1492313a65790adb894f9f1a33b2d" "fa7caecc85dd0aaf60d4f74e42300a1a69f32efbad61fbd3ca26d0dcf6dfedd5" "88f7ee5594021c60a4a6a1c275614103de8c1435d6d08cc58882f920e0cec65e" "8d3ef5ff6273f2a552152c7febc40eabca26bae05bd12bc85062e2dc224cde9a" "9e1cf0f16477d0da814691c1b9add22d7cb34e0bb3334db7822424a449d20078" "9f297216c88ca3f47e5f10f8bd884ab24ac5bc9d884f0f23589b0a46a608fe14" "a44e2d1636a0114c5e407a748841f6723ed442dc3a0ed086542dc71b92a87aee" "e87fd8e24e82eb94d63b1a9c79abc8161d25de9f2f13b64014d3bf4b8db05e9a" "75b2a02e1e0313742f548d43003fcdc45106553af7283fb5fad74359e07fe0e2" "8f5b54bf6a36fe1c138219960dd324aad8ab1f62f543bed73ef5ad60956e36ae" "e3daa8f18440301f3e54f2093fe15f4fe951986a8628e98dcd781efbec7a46f2" "7e377879cbd60c66b88e51fad480b3ab18d60847f31c435f15f5df18bdb18184" default)) + '(package-selected-packages + '(perfect-margin helm-swoop yaml-mode which-key websocket vterm use-package-hydra tree-sitter-langs toc-org telega sudo-edit smooth-scrolling scroll-on-jump ripgrep restclient-jq rainbow-mode projectile polymode persp-mode org-download org-bullets nyan-mode nordic-night-theme neotree magit key-chord ivy-rich helpful haskell-mode harpoon good-scroll git-gutter git-gutter+ general flycheck-pyflakes flycheck-pycheckers ewal-doom-themes evil-surround evil-snipe evil-easymotion evil-collection elpy dracula-theme doom-modeline diredfl dired-subtree dired-ranger diff-hl counsel centered-window centaur-tabs bm beacon anzu almost-mono-themes all-the-icons-dired))) +(custom-set-faces + ;; custom-set-faces was added by Custom. + ;; If you edit it by hand, you could mess it up, so be careful. + ;; Your init file should contain only one such instance. + ;; If there is more than one, they won't work right. diff --git a/roles/dots/files/home/.emacs.d/lan/go-cf.org b/roles/dots/files/home/.emacs.d/lan/go-cf.org new file mode 100644 index 0000000..cb21c26 --- /dev/null +++ b/roles/dots/files/home/.emacs.d/lan/go-cf.org @@ -0,0 +1,48 @@ +gopls: официальный язык сервер для Go +#+begin_quote +go install golang.org/x/tools/gopls@latest +#+end_quote + +goimports: инструмент для автоматического форматирования и управления импортами +#+begin_quote +go install golang.org/x/tools/cmd/goimports@latest +#+end_quote + +#+begin_src emacs-lisp +;; Установка и настройка lsp-mode +(use-package lsp-mode + :ensure t + :commands (lsp lsp-deferred) + :init + (setq lsp-keymap-prefix "C-c l") + :config + (lsp-enable-which-key-integration t)) + +;; Установка lsp-ui для улучшенного интерфейса +(use-package lsp-ui + :ensure t + :commands lsp-ui-mode) + +;; Установка company-mode для автодополнения +(use-package company + :ensure t + :config + (setq company-minimum-prefix-length 1 + company-idle-delay 0.0)) ;; Опционально, для немедленного отображения + +;; Настройка Go-mode +(use-package go-mode + :ensure t + :hook ((go-mode . lsp-deferred) + (before-save . lsp-format-buffer) ;; Форматирование перед сохранением + (before-save . lsp-organize-imports))) + +;; Форматирование кода с использованием goimports +(setq gofmt-command "goimports") +(add-hook 'before-save-hook 'gofmt-before-save) + +(add-hook 'go-mode-hook #'lsp-deferred) + +;; Дополнительные настройки для LSP с Go +(setq lsp-go-use-gofumpt t) ;; Использовать gofumpt вместо gofmt +#+end_src diff --git a/roles/dots/files/home/.emacs.d/lan/python-cf.el b/roles/dots/files/home/.emacs.d/lan/python-cf.el new file mode 100644 index 0000000..6abf4d2 --- /dev/null +++ b/roles/dots/files/home/.emacs.d/lan/python-cf.el @@ -0,0 +1,27 @@ +(require 'use-package) +(message "hello from python mode") + +(add-hook 'python-mode-hook #'tree-sitter-mode +1) +(add-hook 'python-mode-hook #'tree-sitter-hl-mode +1) + +(use-package flycheck + :ensure t + :init + (global-flycheck-mode) + :config + (setq-default flycheck-disabled-checkers '(lsp)) + (setq flycheck-python-flake8-executable "flake8") + (setq flycheck-python-pylint-executable "pylint") + (flycheck-add-next-checker 'python-flake8 'python-pylint) + ) + +(use-package python + :hook (python-mode . (lambda () + (flycheck-mode) + ))) + +(use-package elpy + :ensure t + :init + (elpy-enable)) +(add-hook 'elpy-mode-hook (lambda () (highlight-indentation-mode -1))) diff --git a/roles/dots/files/home/.emacs.d/lan/python-cf.org b/roles/dots/files/home/.emacs.d/lan/python-cf.org new file mode 100644 index 0000000..01b66dc --- /dev/null +++ b/roles/dots/files/home/.emacs.d/lan/python-cf.org @@ -0,0 +1,43 @@ +* python +** ' option, then you will need to add 'screen.' to this list. +# Note that this is only a partial test; the value of the WINDOW environment +# variable must also be a number (which screen(1) sets). +#ScreenTerms = screen:screen-w:vt100 + +# Values of the TERM environment variable which are deemed to be xterms. If +# you are using MOC within screen(1) under an xterm, then add screen(1)'s +# TERM setting here as well to cause MOC to update the xterm's title. +#XTerms = xterm +#XTerms += xterm-colour:xterm-color +#XTerms += xterm-256colour:xterm-256color +#XTerms += rxvt:rxvt-unicode +#XTerms += rxvt-unicode-256colour:rxvt-unicode-256color +#XTerms += eterm + +# Theme file to use. This can be absolute path or relative to +# /usr/share/moc/themes/ (depends on installation prefix) or +# ~/.moc/themes/ . +# +# Example: Theme = laras_theme +# +#Theme = + +# The theme used when running on an xterm. +# +# Example: XTermTheme = transparent-background +# +#XTermTheme = + +# Should MOC try to autoload the default lyrics file for an audio? (The +# default lyrics file is a text file with the same file name as the audio +# file name with any trailing "extension" removed.) +#AutoLoadLyrics = yes + +# MOC directory (where pid file, socket and state files are stored). +# You can use ~ at the beginning. +#MOCDir = ~/.moc + +# Use mmap() to read files. mmap() is much slower on NFS. +#UseMMap = no + +# Use MIME to identify audio files. This can make for slower loading +# of playlists but is more accurate than using "extensions". +#UseMimeMagic = no + +# Assume this encoding for ID3 version 1/1.1 tags (MP3 files). Unlike +# ID3v2, UTF-8 is not used here and MOC can't guess how tags are encoded. +# Another solution is using librcc (see the next option). This option is +# ignored if UseRCC is set to 'yes'. +#ID3v1TagsEncoding = WINDOWS-1250 + +# Use librcc to fix ID3 version 1/1.1 tags encoding. +#UseRCC = yes + +# Use librcc to filenames and directory names encoding. +#UseRCCForFilesystem = yes + +# When this option is set the player assumes that if the encoding of +# ID3v2 is set to ISO-8859-1 then the ID3v1TagsEncoding is actually +# that and applies appropriate conversion. +#EnforceTagsEncoding = no + +# Enable the conversion of filenames from the local encoding to UTF-8. +#FileNamesIconv = no + +# Enable the conversion of the xterm title from UTF-8 to the local encoding. +#NonUTFXterm = no + +# Should MOC precache files to assist gapless playback? +#Precache = yes + +# Remember the playlist after exit? +#SavePlaylist = yes + +# When using more than one client (interface) at a time, do they share +# the playlist? +#SyncPlaylist = yes + +# Choose a keymap file (relative to '~/.moc/' or using an absolute path). +# An annotated example keymap file is included ('keymap.example'). +# +# Example: Keymap = my_keymap +# +Keymap = keymap + +# Use ASCII rather than graphic characters for drawing lines. This +# helps on some terminals. +#ASCIILines = no + +# FastDirs, these allow you to jump directly to a directory, the key +# bindings are in the keymap file. +# +# Examples: Fastdir1 = /mp3/rock +# Fastdir2 = /mp3/electronic +# Fastdir3 = /mp3/rap +# Fastdir4 = /mp3/etc +# +#Fastdir1 = +#Fastdir2 = +#Fastdir3 = +#Fastdir4 = +#Fastdir5 = +#Fastdir6 = +#Fastdir7 = +#Fastdir8 = +#Fastdir9 = +#Fastdir10 = + +# How fast to seek (in number of seconds per keystroke). The first +# option is for normal seek and the second for silent seek. +#SeekTime = 1 +#SilentSeekTime = 5 + +# PreferredDecoders allows you to specify which decoder should be used +# for any given audio format. It is a colon-separated list in which +# each entry is of the general form 'code(decoders)', where 'code' +# identifies the audio format and 'decoders' is a comma-separated list +# of decoders in order of preference. +# +# The audio format identifier may be either a filename extension or a +# MIME media type. If the latter, the format is 'type/subtype' (e.g., +# 'audio/flac'). Because different systems may give different MIME +# media types, any 'x-' prefix of the subtype is ignored both here and +# in the actual file MIME type (so all combinations of 'audio/flac' and +# 'audio/x-flac' match each other). +# +# For Internet streams the matching is done on MIME media type and on +# actual content. For files the matches are made on MIME media type +# (if the 'UseMimeMagic' option is set) and on filename extension. The +# MIME media type of a file is not determined until the first entry for +# MIME is encountered in the list. +# +# The matching is done in the order of appearance in the list with any +# entries added from the command line being matched before those listed +# here. Therefore, if you place all filename extension entries before +# all MIME entries you will speed up MOC's processing of directories +# (which could be significant for remote file systems). +# +# The decoder list may be empty, in which case no decoders will be used +# for files (and files with that audio format ignored) while Internet +# streams will be assessed on the actual content. Any decoder position +# may contain an asterisk, in which case any decoder not otherwise listed +# which can handle the audio format will be used. It is not an error to +# list the same decoder twice, but neither does it make sense to do so. +# +# If you have a mix of audio and non-audio files in your directories, you +# may wish to include entries at top of the list which ignore non-audio +# files by extension. +# +# In summary, the PreferredDecoders option provides fine control over the +# type of matching which is performed (filename extension, MIME media +# type and streamed media content) and which decoder(s) (if any) are used +# based on the option's list entries and their ordering. +# +# Examples: aac(aac,ffmpeg) first try FAAD2 for AACs then FFmpeg +# mp3() ignore MP3 files +# wav(*,sndfile) use sndfile for WAV as a last resort +# ogg(vorbis,*):flac(flac,*) try Xiph decoders first +# ogg():audio/ogg() ignore OGG files, and +# force Internet selection by content +# gz():html() ignore some non-audio files +# +# Any unspecified audio formats default to trying all decoders. +# Any unknown (or misspelt) drivers are ignored. +# All names are case insensitive. +# The default setting reflects the historical situation modified by +# the experience of users. +# +#PreferredDecoders = aac(aac,ffmpeg):m4a(ffmpeg) +#PreferredDecoders += mpc(musepack,*,ffmpeg):mpc8(musepack,*,ffmpeg) +#PreferredDecoders += sid(sidplay2):mus(sidplay2) +#PreferredDecoders += wav(sndfile,*,ffmpeg) +#PreferredDecoders += wv(wavpack,*,ffmpeg) +#PreferredDecoders += audio/aac(aac):audio/aacp(aac):audio/m4a(ffmpeg) +#PreferredDecoders += audio/wav(sndfile,*) + +# The following PreferredDecoders attempt to handle the ambiguity surrounding +# container types such as OGG for files. The first two entries will force +# a local file to the correct decoder (assuming the .ogg file contains Vorbis +# audio), while the MIME media types will cause Internet audio streams to +# be assessed on content (which may be either Vorbis or Speex). +# +#PreferredDecoders += ogg(vorbis,ffmpeg):oga(vorbis,ffmpeg):ogv(ffmpeg) +#PreferredDecoders += opus(ffmpeg) +#PreferredDecoders += spx(speex) +#PreferredDecoders += application/ogg(vorbis):audio/ogg(vorbis) + +# Which resampling method to use. There are a few methods of resampling +# sound supported by libresamplerate. The default is 'Linear') which is +# also the fastest. A better description can be found at: +# +# http://www.mega-nerd.com/libsamplerate/api_misc.html#Converters +# +# but briefly, the following methods are based on bandlimited interpolation +# and are higher quality, but also slower: +# +# SincBestQuality - really slow (I know you probably have an xx GHz +# processor, but it's still not enough to not see +# this in the top output :) The worst case +# Signal-to-Noise Ratio is 97dB. +# SincMediumQuality - much faster. +# SincFastest - the fastest bandlimited interpolation. +# +# And these are lower quality, but much faster methods: +# +# ZeroOrderHold - really poor quality, but it's really fast. +# Linear - a bit better and a bit slower. +# +#ResampleMethod = Linear + +# Always use this sample rate (in Hz) when opening the audio device (and +# resample the sound if necessary). When set to 0 the device is opened +# with the file's rate. +#ForceSampleRate = 0 + +# By default, even if the sound card reports that it can output 24bit samples +# MOC converts 24bit PCM to 16bit. Setting this option to 'yes' allows MOC +# to use 24bit output. (The MP3 decoder, for example, uses this format.) +# This is disabled by default because there were reports that it prevents +# MP3 files from playing on some soundcards. +#Allow24bitOutput = no + +# Use realtime priority for output buffer thread. This will prevent gaps +# while playing even with heavy load. The user who runs MOC must have +# permissions to set such a priority. This could be dangerous, because it +# is possible that a bug in MOC will freeze your computer. +#UseRealtimePriority = no + +# The number of audio files for which MOC will cache tags. When this limit +# is reached, file tags are discarded on a least recently used basis (with +# one second resolution). You can disable the cache by giving it a size of +# zero. Note that if you decrease the cache size below the number of items +# currently in the cache, the number will not decrease immediately (if at +# all). +#TagsCacheSize = 256 + +# Number items in the playlist. +#PlaylistNumbering = yes + +# Main window layouts can be configured. You can change the position and +# size of the menus (directory and playlist). You have three layouts and +# can switch between then using the 'l' key (standard mapping). By default, +# only two layouts are configured. +# +# The format is as follows: +# +# - Each layout is described as a list of menu entries. +# - Each menu entry is of the form: +# +# menu(position_x, position_y, width, height) +# +# where 'menu' is either 'directory' or 'playlist'. +# - The parameters define position and size of the menu. They can +# be absolute numbers (like 10) or a percentage of the screen size +# (like 45%). +# - 'width' and 'height' can have also value of 'FILL' which means +# fill the screen from the menu's position to the border. +# - Menus may overlap. +# +# You must describe at least one menu (default is to fill the whole window). +# There must be at least one layout (Layout1) defined; others can be empty. +# +# Example: Layout1 = playlist(50%,50%,50%,50%) +# Layout2 = "" +# Layout3 = "" +# +# Just one layout, the directory will occupy the whole +# screen, the playlist will have 1/4 of the screen size +# and be positioned at lower right corner. (Note that +# because the playlist will be hidden by the directory +# you will have to use the TAB key to make the playlist +# visible.) +# +# Example: Layout1 = playlist(0,0,100%,10):directory(0,10,100%,FILL) +# +# The screen is split into two parts: playlist at the top +# and the directory menu at the bottom. Playlist will +# occupy 10 lines and the directory menu the rest. +# +#Layout1 = directory(0,0,50%,100%):playlist(50%,0,FILL,100%) +#Layout2 = directory(0,0,100%,100%):playlist(0,0,100%,100%) +#Layout3 = "" + +# When the song changes, should the menu be scrolled so that the currently +# played file is visible? +#FollowPlayedFile = yes + +# What to do if the interface was started and the server is already playing +# something from the playlist? If CanStartInPlaylist is set to 'yes', the +# interface will switch to the playlist. When set to 'no' it will start +# from the last directory. +#CanStartInPlaylist = yes + +# Executing external commands (1 - 10) invoked with key commands (F1 - F10 +# by default). +# +# Some arguments are substituted before executing: +# +# %f - file path +# %i - title made from tags +# %S - start block mark (in seconds) +# %E - end block mark (in seconds) +# +# Data from tags can also be substituted: +# +# %t - title +# %a - album +# %r - artist +# %n - track +# %m - time of the file (in seconds) +# +# The parameters above apply to the currently selected file. If you change +# them to capital letters, they are taken from the file currently playing. +# +# Programs are run using execv(), not a shell, so you can't do things like +# redirecting the output to a file. The command string is split using blank +# characters as separators; the first element is the command to be executed +# and the rest are its parameters, so if you use "echo Playing: %I" we run +# program 'echo' (from $PATH) with 2 parameters: the string 'Playing:' and +# the title of the file currently playing. Even if the title contains +# spaces, it's still one parameter and it's safe if it contains `rm -rf /`. +# +# Examples: ExecCommand1 = "cp %f /mnt/usb_drive" +# ExecCommand2 = "/home/joe/now_playing %I" +# +#ExecCommand1 = +#ExecCommand2 = +#ExecCommand3 = +#ExecCommand4 = +#ExecCommand5 = +#ExecCommand6 = +#ExecCommand7 = +#ExecCommand8 = +#ExecCommand9 = +#ExecCommand10 = + +# Display the cursor in the line with the selected file. Some braille +# readers (the Handy Tech modular series ZMU 737, for example) use the +# cursor to focus and can make use of it to present the file line even +# when other fields are changing. +#UseCursorSelection = no + +# Set the terminal title when running under xterm. +#SetXtermTitle = yes + +# Set the terminal title when running under screen(1). If MOC can detect +# that it is running under screen(1), then it will set an appropriate +# title (see description of ScreenTerms above). However, if multiple +# levels of screen management are involved, detection might fail and this +# could cause a screen upset. In that situation you can use this option +# to force screen titles off. +#SetScreenTitle = yes + +# Display full paths instead of just file names in the playlist. +#PlaylistFullPaths = yes + +# The following setting describes how block markers are displayed in +# the play time progress bar. Its value is a string of exactly three +# characters. The first character is displayed in a position which +# corresponds to the time marked as the start of a block and the last +# character to the time marked as the end of the block. The middle +# character is displayed instead if both the start and the end of the block +# would fall in the same position (within the resolution of the interface). +# You can turn off the displaying of these block marker positions by using +# three space characters. +#BlockDecorators = "`\"'" + +# How long (in seconds) to leave a message displayed on the screen. +# Setting this to a high value allows you to scroll through the messages +# using the 'hide_message' key. Setting it to zero means you'll have to +# be quick to see any message at all. Any new messages will be queued up +# and displayed after the current message's linger time expires. +#MessageLingerTime = 3 + +# Does MOC display a prefix on delayed messages indicating +# the number of queued messages still to be displayed? +#PrefixQueuedMessages = yes + +# String to append to the queued message count if any +# error messages are still waiting to be displayed. +#ErrorMessagesQueued = "!" + +# Self-describing ModPlug options (with 'yes' or 'no' values). +#ModPlug_Oversampling = yes +#ModPlug_NoiseReduction = yes +#ModPlug_Reverb = no +#ModPlug_MegaBass = no +#ModPlug_Surround = no + +# ModPlug resampling mode. +# Valid values are: +# +# FIR - 8 tap fir filter (extremely high quality) +# SPLINE - Cubic spline interpolation (high quality) +# LINEAR - Linear interpolation (fast, good quality) +# NEAREST - No interpolation (very fast, extremely bad sound quality) +# +#ModPlug_ResamplingMode = FIR + +# Other self-describing ModPlug audio characteristic options. +# (Note that the 32 bit sample size seems to be buggy.) +#ModPlug_Channels = 2 # 1 or 2 channels +#ModPlug_Bits = 16 # 8, 16 or 32 bits +#ModPlug_Frequency = 44100 # 11025, 22050, 44100 or 48000 Hz +#ModPlug_ReverbDepth = 0 # 0 (quiet) to 100 (loud) +#ModPlug_ReverbDelay = 0 # Delay in ms (usually 40-200ms) +#ModPlug_BassAmount = 0 # 0 (quiet) to 100 (loud). +#ModPlug_BassRange = 10 # Cutoff in Hz (10-100). +#ModPlug_SurroundDepth = 0 # Surround level 0(quiet)-100(heavy). +#ModPlug_SurroundDelay = 0 # Surround delay in ms, usually 5-40ms. +#ModPlug_LoopCount = 0 # 0 (never), n (times) or -1 (forever) + +# Self-describing TiMidity audio characteristic options. +#TiMidity_Rate = 44100 # Between 8000 and 48000 +#TiMidity_Bits = 16 # 8 or 16 +#TiMidity_Channels = 2 # 1 or 2 +#TiMidity_Volume = 100 # 0 to 800 + +# You can setup a TiMidity-Config-File here. +# Leave it unset to use library defaults (/etc/timidity.cfg mostly). +# Setting it to 'yes' also uses the library defaults. +# Set it to 'no' if you don't have any configuration file. +# Otherwise set it to the name of a specific file. +#TiMidity_Config = + +# Self-describing SidPlay2 audio characteristic options. +#SidPlay2_DefaultSongLength = 180 # If not in database (in seconds) +#SidPlay2_MinimumSongLength = 0 # Play at least n (in seconds) +#SidPlay2_Frequency = 44100 # 4000 to 48000 +#SidPlay2_Bits = 16 # 8 or 16 +#SidPlay2_Optimisation = 0 # 0 (worst quality) to 2 (best quality) + +# Set path to a HVSC-compatible database (if not set, database is disabled). +#SidPlay2_Database = + +# SidPlay2 playback Mode: +# +# "M": Mono (best for many SIDs) +# "S": Stereo +# "L"/"R": Left / Right +# +#SidPlay2_PlayMode = "M" + +# Use start-song information from SID ('yes') or start at first song +# ('no'). Songs before the start-song won't be played. (Note that this +# option previously took the values 1 and 0; these are now deprecated +# in favour of 'yes' and 'no'.) +#SidPlay2_StartAtStart = yes + +# Play sub-tunes. (Note that this option previously took the values 1 +# and 0; these are now deprecated in favour of 'yes' and 'no'.) +#SidPlay2_PlaySubTunes = yes + +# Run the OnSongChange command when a new song starts playing. +# Specify the full path (i.e. no leading '~') of an executable to run. +# Arguments will be passed, and you can use the following escapes: +# +# %a artist +# %r album +# %f filename +# %t title +# %n track +# %d file duration in XX:YY form +# %D file duration, number of seconds +# +# No pipes/redirects can be used directly, but writing a shell script +# can do the job. +# +# Example: OnSongChange = "/home/jack/.moc/myscript %a %r" +# +#OnSongChange = + +# If RepeatSongChange is 'yes' then MOC will execute the command every time +# a song starts playing regardless of whether or not it is just repeating. +# Otherwise the command will only be executed when a different song is +# started. +#RepeatSongChange = no + +# Run the OnStop command (full path, no arguments) when MOC changes state +# to stopped (i.e., when user stopped playing or changes a song). +#OnStop = "/home/jack/.moc/myscript_on_stop" + +# This option determines which song to play after finishing all the songs +# in the queue. Setting this to 'yes' causes MOC to play the song which +# follows the song being played before queue playing started. If set to +# 'no', MOC will play the song following the last song in the queue if it +# is in the playlist. The default is 'yes' because this is the way other +# players usually behave. (Note that this option previously took the +# values 1 and 0; these are now deprecated in favour of 'yes' and 'no'.) +#QueueNextSongReturn = yes diff --git a/roles/dots/files/home/.moc/equalizer b/roles/dots/files/home/.moc/equalizer new file mode 100644 index 0000000..7efeafd --- /dev/null +++ b/roles/dots/files/home/.moc/equalizer @@ -0,0 +1,2 @@ +Active: 1 +Mixin: 0.250000 diff --git a/roles/dots/files/home/.moc/keymap b/roles/dots/files/home/.moc/keymap new file mode 100644 index 0000000..4493cd8 --- /dev/null +++ b/roles/dots/files/home/.moc/keymap @@ -0,0 +1,188 @@ +# This is the example keymap file for MOC. You can define your own key +# bindings for MOC commands by creating your own keymap file and setting +# the 'Keymap' option in ~/.moc/config. +# +# The format of this file is: +# +# - Lines beginning with # are comments. +# - Blank lines are ignored. +# - Every other line is expected to be in one of the formats: +# +# COMMAND = [KEY ...] +# COMMAND += KEY ... +# +# The KEY can be: +# +# - Just a char, like i, L, ", * +# - CTRL-KEY sequence: ^k (CTRL-k), ^4 +# - ALT-KEY (meta) sequence: M-j (ALT-j), M-/ +# - Special keys: DOWN, UP +# LEFT, RIGHT +# HOME, END +# BACKSPACE +# INS, DEL +# ENTER +# PAGE_UP, PAGE_DOWN +# SPACE, TAB +# KEYPAD_CENTER +# ESCAPE +# F1 - F12 +# +# Note that the use of a digit as a KEY is deprecated. +# +# Maximum number of KEYs for one COMMAND is 5. +# +# Omitting the KEY for a COMMAND will unbind all its default keys. They +# will also be automatically unbound when you bind new KEYs to it. Individual +# default KEYs will be automatically unbound when they are explicitly bound +# to some other COMMAND. +# +# Using the '+=' form will cause the KEYs to be appended to any existing +# (default or explicit) bindings for the COMMAND. Appending an existing +# default binding for the same COMMAND will cause MOC to think of that KEY +# as then being explicitly bound. +# +# Only one binding for any given COMMAND can appear in the keymap file. One +# exception to this is that if the default keys for a COMMAND are explicitly +# unbound then a subsequent binding may appear for it. A second exception +# is that multiple appending bindings may appear. +# +# Meta-key detection is sensitive to the ESCDELAY environment variable (see +# the manpage for ncurses(3)). In its absence, MOC resets the default +# delay to 25ms. If you need to emulate meta-key sequences using the ESC +# key, then you may need to set the value of ESCDELAY back to its ncurses +# default of 1000ms (but doing so will make the response to the ESC key +# sluggish). +# +# If MOC's keypresses are being filtered through some other program (in a +# GUI environment, for example) which also does meta-key detection, then +# MOC is at the mercy of the timings with which that program presents them. +# +# Default key configuration for MOC (and a list of all available commands): + +# MOC control keys: +quit_client = q +quit = Q + +# Menu and interface control keys: +go = ENTER +menu_down = j +menu_up = k +menu_page_down = ^d +menu_page_up = ^u +menu_first_item = HOME +menu_last_item = END +search_menu = g / +toggle_read_tags = f +toggle_show_time = ^t +toggle_show_format = ^f +toggle_menu = TAB +toggle_layout = l +toggle_hidden_files = H +next_search = ^g ^n +show_lyrics = L +theme_menu = T +help = h ? +refresh = ^r +reload = r + +# Audio playing and positioning keys: +seek_forward = RIGHT +seek_backward = LEFT +seek_forward_fast = ] +seek_backward_fast = [ +pause = p SPACE +stop = s +next = n +previous = b +toggle_shuffle = S +toggle_repeat = R +toggle_auto_next = X +toggle_mixer = x +go_url = o + +# Volume control keys: +volume_down_1 = +volume_up_1 = +volume_down_5 = +volume_up_5 = +volume_10 = +volume_20 = +volume_30 = +volume_40 = +volume_50 = +volume_60 = +volume_70 = +volume_80 = +volume_90 = + +# Directory navigation keys: defaults are Shift-number +# (i.e., 'shift 1' -> '!' -> 'Fastdir1'). +go_to_a_directory = i +go_to_music_directory = m +go_to_fast_dir1 = ! +go_to_fast_dir2 = @ +go_to_fast_dir3 = # +go_to_fast_dir4 = $ +go_to_fast_dir5 = % +go_to_fast_dir6 = ^ +go_to_fast_dir7 = & +go_to_fast_dir8 = * +go_to_fast_dir9 = ( +go_to_fast_dir10 = ) +go_to_playing_file = G +go_up = U + +# Playlist specific keys: +add_file = a +add_directory = A +plist_add_stream = +delete_from_playlist = d +playlist_full_paths = +plist_move_up = +plist_move_down = +save_playlist = w +remove_dead_entries = +clear_playlist = D + +# Queue manipulation keys: +enqueue_file = z +clear_queue = Z + +# User interaction control: +history_up = +history_down = +delete_to_start = +delete_to_end = +cancel = +hide_message = + +# Softmixer specific keys: +toggle_softmixer = +toggle_make_mono = + +# Equalizer specific keys: +toggle_equalizer = +equalizer_refresh = +equalizer_prev = +equalizer_next = + +# External commands: +mark_start = ' +mark_end = " +exec_command1 = F1 +exec_command2 = F2 +exec_command3 = F3 +exec_command4 = F4 +exec_command5 = F5 +exec_command6 = F6 +exec_command7 = F7 +exec_command8 = F8 +exec_command9 = F9 +exec_command10 = F10 + +# The following commands are available but not assigned to any keys by +# default: +# +# toggle_percent Switch on/off play progress bar time percentage +# diff --git a/roles/dots/files/home/.moc/last_directory b/roles/dots/files/home/.moc/last_directory new file mode 100644 index 0000000..e85360e --- /dev/null +++ b/roles/dots/files/home/.moc/last_directory @@ -0,0 +1 @@ +/home/fs/Music/8/anime_music \ No newline at end of file diff --git a/roles/dots/files/home/.moc/pid b/roles/dots/files/home/.moc/pid new file mode 100644 index 0000000..49a3fab --- /dev/null +++ b/roles/dots/files/home/.moc/pid @@ -0,0 +1 @@ +16111 diff --git a/roles/dots/files/home/.moc/playlist.m3u b/roles/dots/files/home/.moc/playlist.m3u new file mode 100644 index 0000000..bf99469 --- /dev/null +++ b/roles/dots/files/home/.moc/playlist.m3u @@ -0,0 +1,40 @@ +#EXTM3U +#MOCSERIAL: 1280 +#EXTINF:90,Cleo-chan feat. Blaze - Rapture (Juuni Taisen RUS OP) +/home/fs/Music/8/anime_music/onsa_media+/Cleo-chan feat. Blaze - Rapture (Juuni Taisen RUS OP).mp3 +#EXTINF:318,/home/fs/Music/8/anime_music/onsa_media+/[Mobile Suit Gundam SEED на русском] Akatsuki no Kuruma [Onsa Media]-LmVyoxEbiZQ.m4a +/home/fs/Music/8/anime_music/onsa_media+/[Mobile Suit Gundam SEED на русском] Akatsuki no Kuruma [Onsa Media]-LmVyoxEbiZQ.m4a +#EXTINF:211,/home/fs/Music/8/anime_music/onsa_media+/[Natsuton на русском] Pre-Romance [Onsa Media] [Bqa3uj7IhuU].mp3 +/home/fs/Music/8/anime_music/onsa_media+/[Natsuton на русском] Pre-Romance [Onsa Media] [Bqa3uj7IhuU].mp3 +#EXTINF:297,/home/fs/Music/8/anime_music/onsa_media+/[Steins;Gate на русском] Yakusoku no Paradigm [Onsa Media]-HMrJ7mkgsM4.mp3.mp3 +/home/fs/Music/8/anime_music/onsa_media+/[Steins;Gate на русском] Yakusoku no Paradigm [Onsa Media]-HMrJ7mkgsM4.mp3.mp3 +#EXTINF:271,/home/fs/Music/8/anime_music/onsa_media+/[Summertime Render на русском] Natsuyume Noisy [Onsa Media]-Sl8GyTV49_M.m4a +/home/fs/Music/8/anime_music/onsa_media+/[Summertime Render на русском] Natsuyume Noisy [Onsa Media]-Sl8GyTV49_M.m4a +#EXTINF:314,/home/fs/Music/8/anime_music/onsa_media+/[Sword Art Online: Alicization на русском] unlasting [Onsa Media] [9jGCbtJlHxw].mp3 +/home/fs/Music/8/anime_music/onsa_media+/[Sword Art Online: Alicization на русском] unlasting [Onsa Media] [9jGCbtJlHxw].mp3 +#EXTINF:279,/home/fs/Music/8/anime_music/onsa_media+/[Оригинальная песня] Мой ангел [Onsa Media]-K70iJ3ep5kc.opus.mp3 +/home/fs/Music/8/anime_music/onsa_media+/[Оригинальная песня] Мой ангел [Onsa Media]-K70iJ3ep5kc.opus.mp3 +#EXTINF:208,/home/fs/Music/8/anime_music/Op-rus-cover/Arslan Senki Fuujin Ranbu OP Сказание об Арслане 2 опенинг 2 (Marie Bibika Russian Full-Version).mp3 +/home/fs/Music/8/anime_music/Op-rus-cover/Arslan Senki Fuujin Ranbu OP Сказание об Арслане 2 опенинг 2 (Marie Bibika Russian Full-Version).mp3 +#EXTINF:124,/home/fs/Music/8/anime_music/Op-rus-cover/D.Hray-man.mp3 +/home/fs/Music/8/anime_music/Op-rus-cover/D.Hray-man.mp3 +#EXTINF:388,/home/fs/Music/8/anime_music/sati/Harmony Team - [Cat] I'm glad you're evil too (RUS).mp3.mp3 +/home/fs/Music/8/anime_music/sati/Harmony Team - [Cat] I'm glad you're evil too (RUS).mp3.mp3 +#EXTINF:163,/home/fs/Music/8/anime_music/sati/[Shigatsu wa Kimi no Uso ED1 RUS] Kirameki (Cover by Sati Akura) [RoFNK2xl7z4].mp3.mp3 +/home/fs/Music/8/anime_music/sati/[Shigatsu wa Kimi no Uso ED1 RUS] Kirameki (Cover by Sati Akura) [RoFNK2xl7z4].mp3.mp3 +#EXTINF:352,/home/fs/Music/8/anime_music/sati/[Shigatsu wa Kimi no Uso ED2 FULL] orange (Cover by Sati Akura)-osXEe2F5dJw.mp3.mp3 +/home/fs/Music/8/anime_music/sati/[Shigatsu wa Kimi no Uso ED2 FULL] orange (Cover by Sati Akura)-osXEe2F5dJw.mp3.mp3 +#EXTINF:102,/home/fs/Music/8/anime_music/NEW/Another Infinity feat. Mayumi Morinaga - Glitter (Fairy Tail ED 11) rus cover by Sabi-tyan [YM24aDn5mcI].mp3 +/home/fs/Music/8/anime_music/NEW/Another Infinity feat. Mayumi Morinaga - Glitter (Fairy Tail ED 11) rus cover by Sabi-tyan [YM24aDn5mcI].mp3 +#EXTINF:304,/home/fs/Music/8/anime_music/NEW/[Gundam SEED на русском] Akatsuki no Kuruma [поет ElliMarshmallow] [rPeqxrrltBs].mp3 +/home/fs/Music/8/anime_music/NEW/[Gundam SEED на русском] Akatsuki no Kuruma [поет ElliMarshmallow] [rPeqxrrltBs].mp3 +#EXTINF:334,/home/fs/Music/8/anime_music/NEW/Gray and Blue - Soraru × Mafumafu [7y3DwuVxDq4].m4a +/home/fs/Music/8/anime_music/NEW/Gray and Blue - Soraru × Mafumafu [7y3DwuVxDq4].m4a +#EXTINF:95,/home/fs/Music/8/anime_music/NEW/[Hono] Hacking to the Gate {RUSSIAN cover by Radiant Records} ⧸ Steins;Gate [OhOCtITjUPs].mp3 +/home/fs/Music/8/anime_music/NEW/[Hono] Hacking to the Gate {RUSSIAN cover by Radiant Records} ⧸ Steins;Gate [OhOCtITjUPs].mp3 +#EXTINF:274,/home/fs/Music/8/anime_music/NEW/Rain · Fullmetal Alchemist Brotherhood на русском 【SleepingForest】 [9SoFpPtqrIE].mp3 +/home/fs/Music/8/anime_music/NEW/Rain · Fullmetal Alchemist Brotherhood на русском 【SleepingForest】 [9SoFpPtqrIE].mp3 +#EXTINF:218,/home/fs/Music/8/anime_music/Marie Bibika/Fairy Tail ED 18 [Don't let me down] русский кавер от Marie Bibika [8OOQzdztTXE].mp3 +/home/fs/Music/8/anime_music/Marie Bibika/Fairy Tail ED 18 [Don't let me down] русский кавер от Marie Bibika [8OOQzdztTXE].mp3 +#EXTINF:153,/home/fs/Music/8/anime_music/Marie Bibika/Kami no Tou ED [SLUMP] (Русский кавер от @MarieBibika ) [xqtA8FiXVK8].mp3 +/home/fs/Music/8/anime_music/Marie Bibika/Kami no Tou ED [SLUMP] (Русский кавер от @MarieBibika ) [xqtA8FiXVK8].mp3 diff --git a/roles/dots/files/home/.moc/softmixer b/roles/dots/files/home/.moc/softmixer new file mode 100644 index 0000000..ae858e1 --- /dev/null +++ b/roles/dots/files/home/.moc/softmixer @@ -0,0 +1,4 @@ +Active: 0 +Amplification: 100 +Value: 100 +Mono: 0 diff --git a/roles/dots/files/home/.moc/themes/30equals b/roles/dots/files/home/.moc/themes/30equals new file mode 100644 index 0000000..8b0b138 --- /dev/null +++ b/roles/dots/files/home/.moc/themes/30equals @@ -0,0 +1,41 @@ +############################################################################## +# +# 30equals +# +############################################################################## + +background = default default +frame = default default +window_title = default default +directory = cyan default +selected_directory = cyan default reverse +playlist = default default +selected_playlist = default default reverse +file = default default +selected_file = default default reverse +marked_file = cyan default bold +marked_selected_file = cyan default reverse +info = default default +selected_info = default default +marked_info = cyan default bold +marked_selected_info = cyan default bold +status = default default +title = cyan default bold +state = default default +current_time = default default +time_left = default default +total_time = default default +time_total_frames = default default +sound_parameters = default default +legend = default default +disabled = default default +enabled = cyan default bold +empty_mixer_bar = default default +filled_mixer_bar = default default reverse +empty_time_bar = default default +filled_time_bar = default default reverse +entry = default default +entry_title = default default +error = default default bold +message = default default bold +plist_time = default default diff --git a/roles/dots/files/home/.moc/themes/README.md b/roles/dots/files/home/.moc/themes/README.md new file mode 100644 index 0000000..ec85e43 --- /dev/null +++ b/roles/dots/files/home/.moc/themes/README.md @@ -0,0 +1,173 @@ +# mocp-themes +My collection of themes for the music on console player + +## 30equals + +``` +mocp -T 30equals +``` +

30equals

+ +## alldefault + +``` +mocp -T alldefault +``` +

alldefault

+ +## alpha_green + +``` +mocp -T alpha_green +``` +

alpha_green

+ +## black_orange + +``` +mocp -T black_orange +``` +

black_orange

+ +## black_red_white + +``` +mocp -T black_red_white +``` +

black_red_white

+ +## deephouse + +``` +mocp -T deephouse +``` +

deephouse

+ +## dylanwh + +``` +mocp -T dylanwh +``` +

dylanwh

+ +## hybrid + +``` +mocp -T hybrid +``` +

hybrid

+ +## hybrid-bright + +``` +mocp -T hybrid-bright +``` +

hybrid-bright

+ +## lcd + +``` +mocp -T lcd +``` +

lcd

+ +## mostly_green + +``` +mocp -T mostly_green +``` +

mostly_green

+ +## nes + +``` +mocp -T nes +``` +

nes

+ +## nightly_enhanced + +``` +mocp -T nightly_enhanced +``` +

nightly_enhanced

+ +## nightshade + +``` +mocp -T nightshade +``` +

nightshade

+ +## orange + +``` +mocp -T orange +``` +

orange

+ +## orpheus + +``` +mocp -T orpheus +``` +

orpheus

+ +## paper_blue + +``` +mocp -T paper_blue +``` +

paper_blue

+ +## paper_white + +``` +mocp -T paper_white +``` +

paper_white

+ +## rhowaldt + +``` +mocp -T rhowaldt +``` +

rhowaldt

+ +## rteff_theme + +``` +mocp -T rteff_theme +``` +

rteff_theme

+ +## solarized + +``` +mocp -T solarized +``` +

solarized

+ + +## transparent-light + +``` +mocp -T transparent-light +``` +

transparent-light

+ +## tty + +``` +mocp -T tty +``` +

tty

+ +## variant_red + +``` +mocp -T variant_red +``` +

variant_red

+ + diff --git a/roles/dots/files/home/.moc/themes/alldefault b/roles/dots/files/home/.moc/themes/alldefault new file mode 100644 index 0000000..bb2a2c3 --- /dev/null +++ b/roles/dots/files/home/.moc/themes/alldefault @@ -0,0 +1,43 @@ +############################################################################## +# +# alldefault theme by azhag +# this theme is modifiaction of +# Black theme by Arn +# +############################################################################## + +background = default default +frame = default default +window_title = default default +directory = default default +selected_directory = default default reverse +playlist = default default +selected_playlist = default default reverse +file = default default +selected_file = default default reverse +marked_file = default default bold +marked_selected_file = default default bold,reverse +info = default default +selected_info = default default bold +marked_info = default default bold +marked_selected_info = default default bold +status = default default +title = default default bold +state = default default +current_time = default default bold +time_left = default default bold +total_time = default default bold +time_total_frames = default default +sound_parameters = default default bold +legend = default default +disabled = default default +enabled = default default bold +empty_mixer_bar = default default +filled_mixer_bar = default default reverse +empty_time_bar = default default +filled_time_bar = default default reverse +entry = default default +entry_title = default default +error = default default bold +message = default default +plist_time = default default diff --git a/roles/dots/files/home/.moc/themes/alpha_green b/roles/dots/files/home/.moc/themes/alpha_green new file mode 100644 index 0000000..c75db4e --- /dev/null +++ b/roles/dots/files/home/.moc/themes/alpha_green @@ -0,0 +1,46 @@ +############################################################################## +# +# Alpha Green Theme +# by SrFreak +# Personal website http://juanjosalvador.github.io +# Email juanjosalvador@openmailbox.org +# +# Element Color 1 Color 2 +# +############################################################################## + +background = default default +frame = white default +window_title = white default +directory = white default bold +selected_directory = green black bold,reverse +playlist = white green bold +selected_playlist = white green bold +file = white default +selected_file = green default +marked_file = blue default bold +marked_selected_file = green default bold +info = green default bold +selected_info = green default bold +marked_info = red default bold +marked_selected_info = green default bold +status = white default +title = white default bold +state = white default bold +current_time = white default bold +time_left = white default bold +total_time = white default bold +time_total_frames = white default +sound_parameters = white default bold +legend = white default +disabled = green default bold +enabled = white default bold +empty_mixer_bar = white default +filled_mixer_bar = black white +empty_time_bar = white default +filled_time_bar = black white +entry = white default +entry_title = black default +error = red default bold +message = green default bold +plist_time = white default bold diff --git a/roles/dots/files/home/.moc/themes/black_orange b/roles/dots/files/home/.moc/themes/black_orange new file mode 100644 index 0000000..1ad1add --- /dev/null +++ b/roles/dots/files/home/.moc/themes/black_orange @@ -0,0 +1,42 @@ +############################################################################## +# +# here's my theme for the great moc. +# it's black/orange (on xterm it's black/yellow :-) +# +############################################################################## + +background = white black +frame = yellow black +window_title = white black +directory = white black bold +selected_directory = black yellow +playlist = white black +selected_playlist = black yellow +file = white black +selected_file = black yellow +marked_file = yellow black +marked_selected_file = yellow black bold,reverse +info = yellow black +selected_info = yellow black bold +marked_info = yellow black bold +marked_selected_info = yellow black bold,reverse +status = white black +title = yellow black +state = yellow black +current_time = white black bold +time_left = white black bold +total_time = white black bold +time_total_frames = white black +sound_parameters = white black bold +legend = white black +disabled = black black bold +enabled = white black bold +empty_mixer_bar = white black +filled_mixer_bar = black yellow +empty_time_bar = white black +filled_time_bar = white yellow +entry = white black +entry_title = yellow black bold +error = yellow black bold +message = yellow black bold +plist_time = white black diff --git a/roles/dots/files/home/.moc/themes/black_red_white b/roles/dots/files/home/.moc/themes/black_red_white new file mode 100644 index 0000000..5d263e3 --- /dev/null +++ b/roles/dots/files/home/.moc/themes/black_red_white @@ -0,0 +1,124 @@ +############################################################################## +# +# Theme in black|red|white by Stefan Wimmer +# +############################################################################## +# The format of this file is: +# Lines beginning with # are comments. +# Blank lines are ignored. +# Every other line is expected to be in format: +# +# ELEMENT = FOREGROUND_COLOR BACKGROUND_COLOR [ATTRIBUTE[,ATTRIBUTE,..]] +# +# or +# +# colordef COLOR = RED GREEN BLUE +# +# Where names are case insensitive. +# +# ELEMENT is an element of MOC interface. This can be: +# background - default background for regions when nothing is displayed +# frame - frames for windows +# window_title - the title of the window (eg name of the current +# directory) +# directory - a directory in the menu +# selected_directory - a directory that is selected using arrows +# playlist - playlist file +# selected_playlist - see selected directory +# file - an ordinary file in the menu (mp3, ogg, ...) +# selected_file - see selected directory +# marked_file - a file that is currently being played +# marked_selected_file - a file that is currently being played and is also +# selected using arrows +# info - information shown at the right side of files +# selected_info - see selected directory +# marked_info - a file (its time) that is currently being played +# marked_selected_info - a file (its time) that is currently being played +# and is also selected using arrows +# status - the status line with a message +# title - the title of the file that is currently being played +# state - the state: play, stop, or paused (>, [], ||) +# current_time - current time of playing +# time_left - the time left to the end of playing the current file +# total_time - the length of the currently played file +# time_total_frames - the brackets outside the total time of a file ([10:13]) +# sound_parameters - the frequency and bitrate numbers +# legend - "KHz" and "Kbps" +# disabled - disabled element ([STEREO]) +# enabled - enabled element +# empty_mixer_bar - "empty" part of the volume bar +# filled_mixer_bar - "filled" part of the volume bar +# empty_time_bar - "empty" part of the time bar +# filled_time_bar - "filled" part of the time bar +# entry - place wher user can type a search query or a file name +# entry_title - the title of an entry +# error - error message +# message - information message +# plist_time - total time of displayed items +# +# FOREGOUND_COLOR and BACKGROUND_COLOR can have one of the following values: +# black, red, green, yellow, blue, magenta, cyan, white, default (can be +# transparent), grey (not standard, but works) +# +# Optional ATTRIBUTE parameters can be (from ncurses manual): +# normal - default (no highlight) +# standout - best highlighting mode of the terminal +# underline - underlining +# reverse - reverse video +# blink - blinking +# dim - half bright +# bold - extra bright or bold +# protect - protected mode +# +# You can specify a list of attributes separated by commas: attr1,attr2,attr3. +# Don't use spaces anywhere in such a list. +# +# With colordef you can change the definition of a color. It works only if +# your terminal supports it, if not those lines will be silently ignored. +# COLOR must be a valid color name and the RED GREEN and BLUE are numbers +# from 0 to 1000. Example: +# +# colordef red = 1000 0 0 +# +# HINT: you have only 8 colors, but combined with attributes bold and/or +# reversed you actually get more colors. +# +# If you don't specify some elements, the default values will be used. +# +############################################################################## + +background = default default +frame = red default bold +window_title = default default reverse +directory = default default dim +selected_directory = default default dim,reverse +playlist = default default +selected_playlist = default default reverse +file = default default +selected_file = default default reverse +marked_file = default default bold +marked_selected_file = default default bold,reverse +info = default default +selected_info = default default bold +marked_info = red default bold +marked_selected_info = red default bold,reverse +status = default default +title = default default bold,dim +state = default default +current_time = default default bold +time_left = default default bold +total_time = default default bold +time_total_frames = default default +sound_parameters = default default bold +legend = default default +disabled = default default +enabled = red default bold +empty_mixer_bar = default default +filled_mixer_bar = default default reverse +empty_time_bar = default default +filled_time_bar = default default dim,reverse +entry = default default +entry_title = default default +error = red default +message = default default standout,reverse +plist_time = default default bold diff --git a/roles/dots/files/home/.moc/themes/deephouse b/roles/dots/files/home/.moc/themes/deephouse new file mode 100644 index 0000000..fae5b8d --- /dev/null +++ b/roles/dots/files/home/.moc/themes/deephouse @@ -0,0 +1,41 @@ +############################################################################## +# +# Deephouse theme for dark console By Leodelacruz +# +############################################################################## + +background = yellow default +frame = white default +window_title = white default underline,dim +directory = white default +selected_directory = cyan default underline +playlist = cyan default +selected_playlist = cyan default +file = cyan default +selected_file = grey default bold +marked_file = white default bold +marked_selected_file = white default bold,underline +info = white default +selected_info = blue default bold +marked_info = green default bold +marked_selected_info = green default bold +status = white default +title = white default +state = white default +current_time = white default +time_left = white default +total_time = white default +time_total_frames = white default +sound_parameters = white default +legend = white default +disabled = white default dim +enabled = white default bold +empty_mixer_bar = default default +filled_mixer_bar = black cyan +empty_time_bar = white default +filled_time_bar = default white +entry = white default +entry_title = white default bold +error = yellow default +message = white default +plist_time = white default diff --git a/roles/dots/files/home/.moc/themes/dylanwh b/roles/dots/files/home/.moc/themes/dylanwh new file mode 100644 index 0000000..055b501 --- /dev/null +++ b/roles/dots/files/home/.moc/themes/dylanwh @@ -0,0 +1,121 @@ +############################################################################## +# +# The format of this file is: +# Lines beginning with # are comments. +# Blank lines are ignored. +# Every other line is expected to be in format: +# +# ELEMENT = FOREGROUND_COLOR BACKGROUND_COLOR [ATTRIBUTE[,ATTRIBUTE,..]] +# +# or +# +# colordef COLOR = RED GREEN BLUE +# +# Where names are case insensitive. +# +# ELEMENT is an element of MOC interface. This can be: +# background - default background for regions when nothing is displayed +# frame - frames for windows +# window_title - the title of the window (eg name of the current +# directory) +# directory - a directory in the menu +# selected_directory - a directory that is selected using arrows +# playlist - playlist file +# selected_playlist - see selected directory +# file - an ordinary file in the menu (mp3, ogg, ...) +# selected_file - see selected directory +# marked_file - a file that is currently being played +# marked_selected_file - a file that is currently being played and is also +# selected using arrows +# info - information shown at the right side of files +# selected_info - see selected directory +# marked_info - a file (its time) that is currently being played +# marked_selected_info - a file (its time) that is currently being played +# and is also selected using arrows +# status - the status line with a message +# title - the title of the file that is currently being played +# state - the state: play, stop, or paused (>, [], ||) +# current_time - current time of playing +# time_left - the time left to the end of playing the current file +# total_time - the length of the currently played file +# time_total_frames - the brackets outside the total time of a file ([10:13]) +# sound_parameters - the frequency and bitrate numbers +# legend - "KHz" and "Kbps" +# disabled - disabled element ([STEREO]) +# enabled - enabled element +# empty_mixer_bar - "empty" part of the volume bar +# filled_mixer_bar - "filled" part of the volume bar +# empty_time_bar - "empty" part of the time bar +# filled_time_bar - "filled" part of the time bar +# entry - place wher user can type a search query or a file name +# entry_title - the title of an entry +# error - error message +# message - information message +# plist_time - total time of displayed items +# +# FOREGOUND_COLOR and BACKGROUND_COLOR can have one of the following values: +# black, red, green, yellow, blue, magenta, cyan, white, default (can be +# transparent), grey (not standard, but works) +# +# Optional ATTRIBUTE parameters can be (from ncurses manual): +# normal - default (no highlight) +# standout - best highlighting mode of the terminal +# underline - underlining +# reverse - reverse video +# blink - blinking +# dim - half bright +# bold - extra bright or bold +# protect - protected mode +# +# You can specify a list of attributes separated by commas: attr1,attr2,attr3. +# Don't use spaces anywhere in such a list. +# +# With colordef you can change the definition of a color. It works only if +# your terminal supports it, if not those lines will be silently ignored. +# COLOR must be a valid color name and the RED GREEN and BLUE are numbers +# from 0 to 1000. Example: +# +# colordef red = 1000 0 0 +# +# HINT: you have only 8 colors, but combined with attributes bold and/or +# reversed you actually get more colors. +# +# If you don't specify some elements, the default values will be used. +# +############################################################################## + +background = default default +frame = default default +window_title = default default +directory = blue default +selected_directory = magenta black bold +file = yellow default bold +selected_file = white black +marked_file = cyan default bold +marked_selected_file = white black +info = default default +selected_info = default black bold +marked_info = default default bold +marked_selected_info = default black bold +status = default default +title = default default +state = default default +current_time = white default bold +playlist = yellow default bold +selected_playlist = white black +time_left = white default bold +total_time = white default bold +time_total_frames = white default +sound_parameters = white default bold +legend = white default +disabled = default default bold +enabled = white default bold +empty_mixer_bar = white default +filled_mixer_bar = black yellow +empty_time_bar = white default +filled_time_bar = black yellow +entry = white default +entry_title = black cyan +error = red default +message = green default +plist_time = white default diff --git a/roles/dots/files/home/.moc/themes/hybrid b/roles/dots/files/home/.moc/themes/hybrid new file mode 100644 index 0000000..3784e9c --- /dev/null +++ b/roles/dots/files/home/.moc/themes/hybrid @@ -0,0 +1,42 @@ +############################################################################## +# +# based on hybrid +# best viewed on shaded or black terminal +# +############################################################################## + +background = white black +frame = blue default +window_title = green default +directory = red default +selected_directory = blue default +playlist = blue default +selected_playlist = magenta default +file = green default +selected_file = cyan default +marked_file = green default bold +marked_selected_file = cyan default bold +info = cyan default +selected_info = blue default bold +marked_info = green default bold +marked_selected_info = green default bold +status = magenta default +title = green default +state = magenta default +current_time = magenta default +time_left = cyan default +total_time = cyan default +time_total_frames = magenta default +sound_parameters = cyan default +legend = magenta default +disabled = black default +enabled = yellow default +empty_mixer_bar = green default +filled_mixer_bar = black green +empty_time_bar = green default +filled_time_bar = black green +entry = yellow default +entry_title = red default +error = red default +message = yellow default +plist_time = magenta default diff --git a/roles/dots/files/home/.moc/themes/hybrid-bright b/roles/dots/files/home/.moc/themes/hybrid-bright new file mode 100644 index 0000000..92aa1c7 --- /dev/null +++ b/roles/dots/files/home/.moc/themes/hybrid-bright @@ -0,0 +1,42 @@ +############################################################################## +# +# based on hybrid +# best viewed on shaded or black terminal +# +############################################################################## + +background = white black +frame = yellow black bold +window_title = yellow black bold +directory = white black +selected_directory = yellow black bold +playlist = white black bold +selected_playlist = green black bold +file = white black +selected_file = green black dim,underline +marked_file = yellow black bold +marked_selected_file = green black bold +info = blue black bold +selected_info = blue black bold +marked_info = green black bold +marked_selected_info = green black bold +status = white black +title = green black bold +state = yellow black bold +current_time = yellow black bold +time_left = yellow black bold +total_time = white black bold +time_total_frames = yellow black bold +sound_parameters = yellow black bold +legend = white black +disabled = blue black bold +enabled = white black bold +empty_mixer_bar = white black +filled_mixer_bar = black blue +empty_time_bar = white black +filled_time_bar = black blue +entry = white blue +entry_title = yellow black bold +error = red black bold +message = green black bold +plist_time = white black bold diff --git a/roles/dots/files/home/.moc/themes/lcd b/roles/dots/files/home/.moc/themes/lcd new file mode 100644 index 0000000..3d87c9a --- /dev/null +++ b/roles/dots/files/home/.moc/themes/lcd @@ -0,0 +1,42 @@ +############################################################################## +# +# LCD theme for MOC by orveldv (version 2) +# 06/May/2007 +# +############################################################################## + +background = white white normal +frame = white white bold +window_title = white white bold +directory = black white normal +selected_directory = white black bold +playlist = cyan default +selected_playlist = white black bold +file = black white normal +selected_file = white black bold +marked_file = white white bold +marked_selected_file = cyan black bold +info = cyan white bold +selected_info = blue black bold +marked_info = green white bold +marked_selected_info = green white bold +status = white cyan bold +title = white white bold +state = red white blink +current_time = blue white normal +time_left = cyan white bold +total_time = black white bold +time_total_frames = black white normal +sound_parameters = white white bold +legend = black white normal +disabled = cyan white normal +enabled = blue white bold +empty_mixer_bar = black white bold +filled_mixer_bar = black cyan bold +empty_time_bar = white white normal +filled_time_bar = black cyan bold +entry = black white normal +entry_title = black cyan normal +error = red white normal +message = magenta white normal +plist_time = blue default diff --git a/roles/dots/files/home/.moc/themes/mostly_green b/roles/dots/files/home/.moc/themes/mostly_green new file mode 100644 index 0000000..4ac056b --- /dev/null +++ b/roles/dots/files/home/.moc/themes/mostly_green @@ -0,0 +1,42 @@ +############################################################################## +# +# mostly green theme by Jiri Golembiovsky +# best viewed on shaded or black terminal +# +############################################################################## + +background = default default +frame = green default +window_title = green default +directory = green default +selected_directory = black green +playlist = green default +selected_playlist = magenta green +file = green default +selected_file = black green +marked_file = green default bold +marked_selected_file = green default reverse,underline +info = green default +selected_info = green default bold +marked_info = white default bold +marked_selected_info = white default bold +status = green default +title = green default +state = green default bold +current_time = green default bold +time_left = green default +total_time = green default +time_total_frames = green default +sound_parameters = green default bold +legend = green default +disabled = green default +enabled = black green +empty_mixer_bar = green default +filled_mixer_bar = black green +empty_time_bar = green default +filled_time_bar = black green +entry = green default +entry_title = green default bold +error = red default bold +message = yellow default bold +plist_time = green default diff --git a/roles/dots/files/home/.moc/themes/nes b/roles/dots/files/home/.moc/themes/nes new file mode 100644 index 0000000..4c495d8 --- /dev/null +++ b/roles/dots/files/home/.moc/themes/nes @@ -0,0 +1,41 @@ +############################################################################## +# +# Theme inspired by the NES +# +############################################################################## + +background = white black +frame = grey black bold +window_title = red black +directory = grey black bold +selected_directory = red black bold +playlist = grey black bold +selected_playlist = red black bold +file = white black +selected_file = red black +marked_file = red black bold +marked_selected_file = red black reverse +info = grey black bold +selected_info = white black bold +marked_info = blue black bold +marked_selected_info = white black bold +status = white black +title = red black bold +state = red black bold +current_time = white black bold +time_left = white black bold +total_time = white black bold +time_total_frames = white black +sound_parameters = white black bold +legend = white black +disabled = red black bold +enabled = white black bold +empty_mixer_bar = red black +filled_mixer_bar = black red +empty_time_bar = white black +filled_time_bar = black red +entry = white black +entry_title = grey black bold +error = red black bold +message = red black bold +plist_time = grey black bold diff --git a/roles/dots/files/home/.moc/themes/nightly_enhanced b/roles/dots/files/home/.moc/themes/nightly_enhanced new file mode 100644 index 0000000..34a71aa --- /dev/null +++ b/roles/dots/files/home/.moc/themes/nightly_enhanced @@ -0,0 +1,42 @@ +############################################################################## +# +# this is a modification of the +# nightly theme by Wim Speekenbrink +# +############################################################################## + +background = blue default +frame = blue default bold +window_title = blue default bold +directory = blue default bold +selected_directory = black magenta +playlist = blue default bold +selected_playlist = black magenta +file = blue default bold +selected_file = black magenta +marked_file = green default bold +marked_selected_file = magenta default bold +info = green default bold +selected_info = black magenta +marked_info = green default bold +marked_selected_info = green default bold +status = blue default bold +title = green default bold +state = blue default bold +current_time = magenta default bold +time_left = magenta default bold +total_time = magenta default bold +time_total_frames = blue default bold +sound_parameters = magenta default bold +legend = blue default bold +disabled = black default +enabled = blue default bold +empty_mixer_bar = blue default bold +filled_mixer_bar = black magenta +empty_time_bar = blue default bold +filled_time_bar = black magenta +entry = green default bold +entry_title = green default bold +error = red default bold +message = green default bold +plist_time = green default bold diff --git a/roles/dots/files/home/.moc/themes/nightshade b/roles/dots/files/home/.moc/themes/nightshade new file mode 100644 index 0000000..769b7a5 --- /dev/null +++ b/roles/dots/files/home/.moc/themes/nightshade @@ -0,0 +1,41 @@ +############################################################################## +# +# Nightshade theme (Version 6) by Dreyeth (dreyeth@openmailbox.org) +# +############################################################################## + +background = blue black normal +frame = magenta black normal +window_title = magenta black bold +directory = blue black normal +selected_directory = black magenta normal +playlist = magenta black normal +selected_playlist = black magenta normal +file = blue black normal +selected_file = black magenta normal +marked_file = magenta black bold +marked_selected_file = black magenta bold +info = magenta black normal +selected_info = black magenta normal +marked_info = magenta black normal +marked_selected_info = black magenta normal +status = magenta black bold +title = magenta black bold +state = magenta black bold +current_time = magenta black normal +time_left = magenta black normal +total_time = magenta black normal +time_total_frames = magenta black normal +sound_parameters = magenta black normal +legend = blue black normal +disabled = blue black normal +enabled = magenta black normal +empty_mixer_bar = black blue normal +filled_mixer_bar = black magenta normal +empty_time_bar = black blue normal +filled_time_bar = black magenta normal +entry = black blue normal +entry_title = black magenta normal +error = magenta black bold +message = blue black bold +plist_time = magenta black normal diff --git a/roles/dots/files/home/.moc/themes/orange b/roles/dots/files/home/.moc/themes/orange new file mode 100644 index 0000000..092a640 --- /dev/null +++ b/roles/dots/files/home/.moc/themes/orange @@ -0,0 +1,124 @@ +############################################################################## +# +# Theme in yellow|red by Stefan Wimmer +# +############################################################################## +# The format of this file is: +# Lines beginning with # are comments. +# Blank lines are ignored. +# Every other line is expected to be in format: +# +# ELEMENT = FOREGROUND_COLOR BACKGROUND_COLOR [ATTRIBUTE[,ATTRIBUTE,..]] +# +# or +# +# colordef COLOR = RED GREEN BLUE +# +# Where names are case insensitive. +# +# ELEMENT is an element of MOC interface. This can be: +# background - default background for regions when nothing is displayed +# frame - frames for windows +# window_title - the title of the window (eg name of the current +# directory) +# directory - a directory in the menu +# selected_directory - a directory that is selected using arrows +# playlist - playlist file +# selected_playlist - see selected directory +# file - an ordinary file in the menu (mp3, ogg, ...) +# selected_file - see selected directory +# marked_file - a file that is currently being played +# marked_selected_file - a file that is currently being played and is also +# selected using arrows +# info - information shown at the right side of files +# selected_info - see selected directory +# marked_info - a file (its time) that is currently being played +# marked_selected_info - a file (its time) that is currently being played +# and is also selected using arrows +# status - the status line with a message +# title - the title of the file that is currently being played +# state - the state: play, stop, or paused (>, [], ||) +# current_time - current time of playing +# time_left - the time left to the end of playing the current file +# total_time - the length of the currently played file +# time_total_frames - the brackets outside the total time of a file ([10:13]) +# sound_parameters - the frequency and bitrate numbers +# legend - "KHz" and "Kbps" +# disabled - disabled element ([STEREO]) +# enabled - enabled element +# empty_mixer_bar - "empty" part of the volume bar +# filled_mixer_bar - "filled" part of the volume bar +# empty_time_bar - "empty" part of the time bar +# filled_time_bar - "filled" part of the time bar +# entry - place wher user can type a search query or a file name +# entry_title - the title of an entry +# error - error message +# message - information message +# plist_time - total time of displayed items +# +# FOREGOUND_COLOR and BACKGROUND_COLOR can have one of the following values: +# black, red, green, yellow, blue, magenta, cyan, white, default (can be +# transparent), grey (not standard, but works) +# +# Optional ATTRIBUTE parameters can be (from ncurses manual): +# normal - default (no highlight) +# standout - best highlighting mode of the terminal +# underline - underlining +# reverse - reverse video +# blink - blinking +# dim - half bright +# bold - extra bright or bold +# protect - protected mode +# +# You can specify a list of attributes separated by commas: attr1,attr2,attr3. +# Don't use spaces anywhere in such a list. +# +# With colordef you can change the definition of a color. It works only if +# your terminal supports it, if not those lines will be silently ignored. +# COLOR must be a valid color name and the RED GREEN and BLUE are numbers +# from 0 to 1000. Example: +# +# colordef red = 1000 0 0 +# +# HINT: you have only 8 colors, but combined with attributes bold and/or +# reversed you actually get more colors. +# +# If you don't specify some elements, the default values will be used. +# +############################################################################## + +background = red default +frame = red default +window_title = red default +directory = yellow default +selected_directory = red default +playlist = yellow default +selected_playlist = yellow default +file = yellow default +selected_file = black yellow +marked_file = red default +marked_selected_file = red yellow +info = yellow default +selected_info = yellow default bold +marked_info = yellow default bold,reverse +marked_selected_info = red default bold +status = yellow default +title = yellow default +state = yellow default +current_time = yellow default +time_left = yellow default +total_time = yellow default +time_total_frames = yellow default +sound_parameters = yellow default +legend = yellow default +disabled = red default dim +enabled = yellow default bold +empty_mixer_bar = black red +filled_mixer_bar = black yellow +empty_time_bar = yellow default +filled_time_bar = default yellow +entry = yellow default +entry_title = yellow default +error = cyan default +message = yellow default +plist_time = yellow default diff --git a/roles/dots/files/home/.moc/themes/orpheus b/roles/dots/files/home/.moc/themes/orpheus new file mode 100644 index 0000000..3cd8bf3 --- /dev/null +++ b/roles/dots/files/home/.moc/themes/orpheus @@ -0,0 +1,46 @@ +############################################################################## +# +# Copy what's below and save it in ~/.moc/themes/moc-orpheus +# moc-orpheus is the name of the file; don't give it an extension. +# Also, create the themes folder if it doesn't exist. +# I found this theme at this address: +# http://nic-nac-project.org/~orveldv/wiki/doku.php?id=moc +# A couple ather themes are also available there. +# +############################################################################## + +background = black black normal +frame = blue black bold +window_title = black black bold +directory = cyan black normal +selected_directory = cyan black bold +playlist = white black normal +selected_playlist = cyan black bold +file = green black normal +selected_file = green black bold +marked_file = yellow black bold +marked_selected_file = white black bold +info = blue black bold +selected_info = blue black bold +marked_info = white black bold +marked_selected_info = white black bold +status = black white normal +title = yellow black bold +state = green black bold,blink +current_time = white black normal +time_left = black black bold +total_time = green black normal +time_total_frames = black black bold +sound_parameters = white black normal +legend = green black normal +disabled = black black bold +enabled = white black normal +empty_mixer_bar = white black normal +filled_mixer_bar = black white normal +empty_time_bar = black black normal +filled_time_bar = black white bold +entry = white black normal +entry_title = black white normal +error = yellow black bold +message = yellow black bold +plist_time = blue black normal diff --git a/roles/dots/files/home/.moc/themes/paper_blue b/roles/dots/files/home/.moc/themes/paper_blue new file mode 100644 index 0000000..14237c5 --- /dev/null +++ b/roles/dots/files/home/.moc/themes/paper_blue @@ -0,0 +1,42 @@ +############################################################################## +# +# paper_blue theme for MOC by orveldv (version 2) +# 06/May/2007 +# +############################################################################## + +background = white white normal +frame = white white bold +window_title = white white bold +directory = blue white normal +selected_directory = white black bold +playlist = cyan white bold +selected_playlist = white black bold +file = blue white normal +selected_file = white black bold +marked_file = white white bold +marked_selected_file = cyan black bold +info = cyan white bold +selected_info = blue black bold +marked_info = green black bold +marked_selected_info = green black bold +status = white cyan bold +title = white white bold +state = red white blink +current_time = black white normal +time_left = cyan white bold +total_time = black white bold +time_total_frames = black white normal +sound_parameters = white white bold +legend = blue white normal +disabled = cyan white normal +enabled = black white normal +empty_mixer_bar = black white bold +filled_mixer_bar = blue default bold +empty_time_bar = white white normal +filled_time_bar = white default bold +entry = black white normal +entry_title = black cyan normal +error = red white normal +message = magenta white normal +plist_time = white cyan bold diff --git a/roles/dots/files/home/.moc/themes/paper_white b/roles/dots/files/home/.moc/themes/paper_white new file mode 100644 index 0000000..5281566 --- /dev/null +++ b/roles/dots/files/home/.moc/themes/paper_white @@ -0,0 +1,42 @@ +############################################################################## +# +# paper_white theme for MOC by orveldv (version 2) +# 06/May/2007 +# +############################################################################## + +background = white white normal +frame = black white normal +window_title = black white normal +directory = white white bold +selected_directory = white black bold +playlist = cyan white bold +selected_playlist = white black bold +file = white white bold +selected_file = white black bold +marked_file = blue white normal +marked_selected_file = cyan black bold +info = cyan white bold +selected_info = blue black bold +marked_info = green black bold +marked_selected_info = green black bold +status = white cyan bold +title = blue white normal +state = red white blink +current_time = white white bold +time_left = cyan white bold +total_time = black white bold +time_total_frames = black white normal +sound_parameters = black white normal +legend = white white bold +disabled = cyan white normal +enabled = blue white bold +empty_mixer_bar = black white bold +filled_mixer_bar = cyan default bold +empty_time_bar = white white normal +filled_time_bar = white default bold +entry = black white normal +entry_title = black cyan normal +error = red white normal +message = magenta white normal +plist_time = white cyan bold diff --git a/roles/dots/files/home/.moc/themes/rhowaldt b/roles/dots/files/home/.moc/themes/rhowaldt new file mode 100644 index 0000000..e860403 --- /dev/null +++ b/roles/dots/files/home/.moc/themes/rhowaldt @@ -0,0 +1,123 @@ +############################################################################## +# +# Thank you Gutterslob & pvsage from #! forums! +# +# The format of this file is: +# Lines beginning with # are comments. +# Blank lines are ignored. +# Every other line is expected to be in format: +# +# ELEMENT = FOREGROUND_COLOR BACKGROUND_COLOR [ATTRIBUTE[,ATTRIBUTE,..]] +# +# or +# +# colordef COLOR = RED GREEN BLUE +# +# Where names are case insensitive. +# +# ELEMENT is an element of MOC interface. This can be: +# background - default background for regions when nothing is displayed +# frame - frames for windows +# window_title - the title of the window (eg name of the current +# directory) +# directory - a directory in the menu +# selected_directory - a directory that is selected using arrows +# playlist - playlist file +# selected_playlist - see selected directory +# file - an ordinary file in the menu (mp3, ogg, ...) +# selected_file - see selected directory +# marked_file - a file that is currently being played +# marked_selected_file - a file that is currently being played and is also +# selected using arrows +# info - information shown at the right side of files +# selected_info - see selected directory +# marked_info - a file (its time) that is currently being played +# marked_selected_info - a file (its time) that is currently being played +# and is also selected using arrows +# status - the status line with a message +# title - the title of the file that is currently being played +# state - the state: play, stop, or paused (>, [], ||) +# current_time - current time of playing +# time_left - the time left to the end of playing the current file +# total_time - the length of the currently played file +# time_total_frames - the brackets outside the total time of a file ([10:13]) +# sound_parameters - the frequency and bitrate numbers +# legend - "KHz" and "Kbps" +# disabled - disabled element ([STEREO]) +# enabled - enabled element +# empty_mixer_bar - "empty" part of the volume bar +# filled_mixer_bar - "filled" part of the volume bar +# empty_time_bar - "empty" part of the time bar +# filled_time_bar - "filled" part of the time bar +# entry - place wher user can type a search query or a file name +# entry_title - the title of an entry +# error - error message +# message - information message +# plist_time - total time of displayed items +# +# FOREGOUND_COLOR and BACKGROUND_COLOR can have one of the following values: +# black, red, green, yellow, blue, magenta, cyan, white, default (can be +# transparent), grey (not standard, but works) +# +# Optional ATTRIBUTE parameters can be (from ncurses manual): +# normal - default (no highlight) +# standout - best highlighting mode of the terminal +# underline - underlining +# reverse - reverse video +# blink - blinking +# dim - half bright +# bold - extra bright or bold +# protect - protected mode +# +# You can specify a list of attributes separated by commas: attr1,attr2,attr3. +# Don't use spaces anywhere in such a list. +# +# With colordef you can change the definition of a color. It works only if +# your terminal supports it, if not those lines will be silently ignored. +# COLOR must be a valid color name and the RED GREEN and BLUE are numbers +# from 0 to 1000. Example: +# +# colordef red = 1000 0 0 +# +# HINT: you have only 8 colors, but combined with attributes bold and/or +# reversed you actually get more colors. +# +# If you don't specify some elements, the default values will be used. +############################################################################## +# + +background = default default +frame = default default +window_title = default default +directory = blue default +selected_directory = blue default reverse +playlist = default default +selected_playlist = default default reverse +file = default default +selected_file = default default reverse +marked_file = blue default bold +marked_selected_file = blue default reverse +info = default default +selected_info = default default +marked_info = blue default bold +marked_selected_info = blue default bold +status = default default +title = blue default bold +state = default default +current_time = default default +time_left = default default +total_time = default default +time_total_frames = default default +sound_parameters = default default +legend = default default +disabled = default default +enabled = blue default bold +empty_mixer_bar = default default +filled_mixer_bar = default default reverse +empty_time_bar = default default +filled_time_bar = default default reverse +entry = default default +entry_title = default default +error = default default bold +message = default default bold +plist_time = default default diff --git a/roles/dots/files/home/.moc/themes/rteff_theme b/roles/dots/files/home/.moc/themes/rteff_theme new file mode 100644 index 0000000..c6933ff --- /dev/null +++ b/roles/dots/files/home/.moc/themes/rteff_theme @@ -0,0 +1,41 @@ +########################################################### +# +# Rteff Theme +# +# Email rtefforg@gmail.com +# GitHub https://github.com/rteff +# +########################################################## + +background = black black +frame = cyan black +window_title = cyan black bold,underline +directory = blue black bold +selected_directory = cyan black bold,underline +playlist = white black bold +selected_playlist = cyan black bold,underline +file = white black +selected_file = cyan black bold,underline +marked_file = grey black bold +marked_selected_file = grey black bold,underline +info = cyan black +status = blue black +title = blue black bold +state = cyan black +current_time = grey black +time_left = red black +total_time = white black +time_total_frames = white black +sound_parameters = grey black bold +legend = white black bold +disabled = red black +enabled = grey black bold +empty_mixer_bar = white black bold,underline +filled_mixer_bar = cyan black underline +empty_time_bar = white black underline +filled_time_bar = cyan black underline +entry = white black +entry_title = white black +error = red black bold,underline +message = blue black bold +plist_time = cyan black underline diff --git a/roles/dots/files/home/.moc/themes/solarized b/roles/dots/files/home/.moc/themes/solarized new file mode 100644 index 0000000..ee09a23 --- /dev/null +++ b/roles/dots/files/home/.moc/themes/solarized @@ -0,0 +1,42 @@ +############################################################################## +# +# based on solarized +# best viewed on shaded or black terminal +# +############################################################################## + +background = default default +frame = black default +window_title = green default +directory = red default +selected_directory = blue default +playlist = blue default +selected_playlist = magenta default +file = green default +selected_file = cyan default +marked_file = green default bold +marked_selected_file = cyan default bold +info = cyan default +selected_info = cyan default +marked_info = green default bold +marked_selected_info = cyan default bold +status = magenta default +title = green default +state = magenta default +current_time = magenta default +time_left = cyan default +total_time = cyan default +time_total_frames = magenta default +sound_parameters = cyan default +legend = magenta default +disabled = black default +enabled = yellow default +empty_mixer_bar = green default +filled_mixer_bar = black green +empty_time_bar = green default +filled_time_bar = black green +entry = yellow default +entry_title = red default +error = red default +message = yellow default +plist_time = magenta default diff --git a/roles/dots/files/home/.moc/themes/transparent-light b/roles/dots/files/home/.moc/themes/transparent-light new file mode 100644 index 0000000..3c80315 --- /dev/null +++ b/roles/dots/files/home/.moc/themes/transparent-light @@ -0,0 +1,42 @@ +############################################################################## +# +# transparent_forlightbg theme for MOC by orveldv (version 2) +# 06/May/2007 +# +############################################################################## + +background = default default normal +frame = blue default bold +window_title = blue default bold +directory = black default normal +selected_directory = white black bold +playlist = blue default normal +selected_playlist = white black bold +file = black default normal +selected_file = white black bold +marked_file = blue default bold +marked_selected_file = cyan black bold +info = cyan default normal +selected_info = white black bold +marked_info = blue default bold +marked_selected_info = cyan black bold +status = black cyan bold +title = blue default normal +state = red default bold,blink +current_time = blue default bold +time_left = cyan default normal +total_time = black default bold +time_total_frames = black default normal +sound_parameters = black default bold +legend = black default normal +disabled = cyan default bold +enabled = blue default bold +empty_mixer_bar = blue default bold +filled_mixer_bar = white cyan bold +empty_time_bar = white default normal +filled_time_bar = white cyan bold +entry = black default normal +entry_title = black cyan normal +error = red default normal +message = magenta default normal +plist_time = white cyan bold diff --git a/roles/dots/files/home/.moc/themes/tty b/roles/dots/files/home/.moc/themes/tty new file mode 100644 index 0000000..19a7b46 --- /dev/null +++ b/roles/dots/files/home/.moc/themes/tty @@ -0,0 +1,40 @@ +############################################################################## +# +# tty +# +############################################################################## +background = default default +frame = default default +window_title = default default +directory = default default +selected_directory = default default reverse +playlist = default default +selected_playlist = default default reverse +file = default default +selected_file = default default reverse +marked_file = green default bold +marked_selected_file = green default reverse,bold +info = default default +selected_info = default default bold,reverse +marked_info = green default bold +marked_selected_info = green default bold,reverse +status = default default +title = default default bold +state = default default +current_time = default default bold +time_left = default default bold +total_time = default default bold +time_total_frames = default default +sound_parameters = default default bold +legend = default default +disabled = red default +enabled = green default bold +empty_mixer_bar = default default +filled_mixer_bar = default default reverse +empty_time_bar = default default +filled_time_bar = default default reverse +entry = default default +entry_title = default default +error = red default +message = green default +plist_time = default default diff --git a/roles/dots/files/home/.moc/themes/variant_red b/roles/dots/files/home/.moc/themes/variant_red new file mode 100644 index 0000000..9caa118 --- /dev/null +++ b/roles/dots/files/home/.moc/themes/variant_red @@ -0,0 +1,41 @@ +############################################################################## +# +# Variant Red Theme by centralkidede +# +############################################################################## + +background = default default normal +frame = white default normal +window_title = white default normal +directory = white default bold +selected_directory = white red bold +playlist = white default bold +selected_playlist = white red bold +file = white default normal +selected_file = white red normal +marked_file = red default bold +marked_selected_file = white red bold +info = red default bold +selected_info = red default bold +marked_info = red default bold +marked_selected_info = white red bold +status = black default normal +title = black white bold +state = black white bold +current_time = black white bold +time_left = black white bold +total_time = black white bold +time_total_frames = black white normal +sound_parameters = black white bold +legend = black white normal +disabled = black default bold +enabled = white default bold +empty_mixer_bar = default red dim +filled_mixer_bar = red default normal +empty_time_bar = white default normal +filled_time_bar = black red normal +entry = white red normal +entry_title = black red normal +error = red default bold +message = red default bold +plist_time = default default bold diff --git a/roles/dots/files/home/.pylintrc b/roles/dots/files/home/.pylintrc new file mode 100644 index 0000000..ef6df2d --- /dev/null +++ b/roles/dots/files/home/.pylintrc @@ -0,0 +1,4 @@ +[MASTER] +init-hook="from pylint.config import find_pylintrc; import os, sys; sys.path.append(os.path.dirname(find_pylintrc()))" +disable=C0111 +max-line-length=120 diff --git a/roles/dots/files/home/.tmux.conf b/roles/dots/files/home/.tmux.conf new file mode 100644 index 0000000..2170852 --- /dev/null +++ b/roles/dots/files/home/.tmux.conf @@ -0,0 +1,53 @@ +set -g default-terminal "tmux-256color" +set -ag terminal-overrides ",xterm-256color:RGB" +set-option -g default-command bash +set-option -g prefix C-w + +bind-key -T copy-mode-vi 'C-c' send -X copy-pipe-and-cancel 'xclip -sel clip -i' + +bind v split-window -c "#{pane_current_path}" +bind w split-window -h -c "#{pane_current_path}" +bind c new-window -c "#{pane_current_path}" + +bind h select-pane -L +bind j select-pane -D +bind k select-pane -U +bind l select-pane -R + +bind -r H resize-pane -L 10 +bind -r J resize-pane -D 10 +bind -r K resize-pane -U 10 +bind -r L resize-pane -R 10 + +bind-key T swap-window -t -1 +bind-key t swap-window -t 1 + +bind-key -r f run-shell "tmux neww ~/bin/tmux-sessionizer.sh" +bind-key -r e run-shell "tmux neww sh ~/bin/tmux-sessionizer.sh -E" +# bind f send-keys -t.- 'sh ~/bin/tmux-sessionizer.sh' Enter + +set -g mode-keys vi + +set -g status-style bg=default +set -g status-fg white +set-option -g status-right "" + +## COLORSCHEME: gruvbox dark (medium) +set-option -g status "on" + +# default statusbar color +set-option -g status-style bg=black,fg=black # bg=bg1, fg=fg1 +set-window-option -g window-status-current-style bg=white,fg=black # fg=bg1 +set -g status-left-length 60 + +# set-option -g status-left "#[bg=colour241,fg=colour248] #S #[bg=black,fg=colour241,nobold,noitalics,nounderscore]" +# set-option -g status-right "#[bg=black,fg=colour239 nobold, nounderscore, noitalics]#[bg=colour239,fg=colour246] %Y-%m-%d  %H:%M #[bg=colour239,fg=colour248,nobold,noitalics,nounderscore]#[bg=colour248,fg=colour237] #h " +# +# set-window-option -g window-status-current-format "#[bg=green,fg=black,nobold,noitalics,nounderscore]#[bg=green,fg=black] #I #[bg=green,fg=black,bold] #W#{?window_zoomed_flag,*Z,} #[bg=black,fg=green,nobold,noitalics,nounderscore]" +# set-window-option -g window-status-format "#[bg=white,fg=black,noitalics]#[bg=white,fg=black] #I #[bg=white,fg=black,bold] #W #[bg=black,fg=white,noitalics]" + +# index +set -g base-index 1 +setw -g pane-base-index 1 +bind-key s choose-tree -ZsK '#{?#{e|<:#{line},9},#{e|+:1,#{line}},#{?#{e|<:#{line},35},M-#{a:#{e|+:97,#{e|-:#{line},9}}},}}' + diff --git a/roles/dots/files/home/.xinitrc b/roles/dots/files/home/.xinitrc new file mode 100644 index 0000000..05a559d --- /dev/null +++ b/roles/dots/files/home/.xinitrc @@ -0,0 +1,11 @@ +#!/bin/sh +xrandr --auto +xrandr -r 60.00 +xrdb ~/.Xresources +slstatus & +picom & +# emacs --daemon & +# flameshot & +# dunst & +# exec ~/bin/startdwm +exec dwm diff --git a/roles/dots/files/home/bin/betterkeymap.sh b/roles/dots/files/home/bin/betterkeymap.sh new file mode 100755 index 0000000..66308d8 --- /dev/null +++ b/roles/dots/files/home/bin/betterkeymap.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +# Проверяем, есть ли уже установленная опция +current_options=$(setxkbmap -query | grep "options:") + +# Если опции уже установлены, просто меняем раскладку +if [[ -n "$current_options" ]]; then + setxkbmap -layout us -option +# Иначе, устанавливаем опцию ctrl:swapcaps +else + setxkbmap -layout us -option ctrl:swapcaps +fi + diff --git a/roles/dots/files/home/bin/change_layout.sh b/roles/dots/files/home/bin/change_layout.sh new file mode 100755 index 0000000..48b6770 --- /dev/null +++ b/roles/dots/files/home/bin/change_layout.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +current_layout=$(setxkbmap -query | grep layout | awk '{print $2}') + +if [[ "$current_layout" == "us" ]]; then + setxkbmap ru +else + setxkbmap us +fi diff --git a/roles/dots/files/home/bin/dpms b/roles/dots/files/home/bin/dpms new file mode 100755 index 0000000..97010d6 --- /dev/null +++ b/roles/dots/files/home/bin/dpms @@ -0,0 +1,2 @@ +#!/bin/sh +xset dpms force off; sleep 1; xset dpms force on diff --git a/roles/dots/files/home/bin/easy_http.py b/roles/dots/files/home/bin/easy_http.py new file mode 100644 index 0000000..62d02dc --- /dev/null +++ b/roles/dots/files/home/bin/easy_http.py @@ -0,0 +1,144 @@ +import uuid +import random +import os +import sys +import requests +import json +import pickle + +methods = { + 'POST': requests.post, + 'GET': requests.get, + 'PUT': requests.put, + 'PATCH': requests.patch +} + +headers = {} + +def string_to_header(s): + key, value = s.split(": ") + headers[key] = value.strip() + +def read_default_headers(default_headers_file): + if os.path.isfile(default_headers_file): + with open(default_headers_file, 'r') as file: + headers.update(json.load(file)) + +def save_cookies(requests_cookiejar, filename): + if os.path.exists(filename): + with open(filename, 'rb') as f: + try: + existing_cookies = pickle.load(f) + except EOFError: + existing_cookies = requests_cookiejar + else: + existing_cookies = requests_cookiejar + + for cookie in requests_cookiejar: + existing_cookies.set_cookie(cookie) + + with open(filename, 'wb') as f: + pickle.dump(existing_cookies, f) + +def load_cookies(filename): + try: + with open(filename, 'rb') as f: + return pickle.load(f) + except FileNotFoundError: + return None + +def set_vars(_body): + def set_to_dict(body): + for key, value in body.items(): + if isinstance(value, str): + value = value.replace('{{hex}}', uuid.uuid4().hex) + value = value.replace('{{uuid}}', str(uuid.uuid4())) + if ':code:' in value: + value = value.replace(':code:', '') + value = eval(f"{value}") + print(value) + + body[key] = str(value) + + if isinstance(value, dict): + set_vars(value) + + if type(_body) is dict: + set_to_dict(_body) + elif type(_body) is list: + for i in _body: + set_to_dict(i) + return _body + +def send_req(method, url, body_txt): + func = methods[method] + cookie = load_cookies(session_path) + + body = json.loads(body_txt) if '{' in body_txt else {} + body = set_vars(body) + + if method == 'GET': + resp = func(url, headers=headers, params=body, cookies=cookie) + else: + resp = func(url, headers=headers, json=body, cookies=cookie) + + print(f"// status_code {'':<18} {resp.status_code}") + + for header_name, header_value in resp.headers.items(): + print(f"// {header_name:<30} {header_value}") + try: + resp_content = resp.json() + print(json.dumps(resp_content, indent=2)) + except ValueError: + print(resp.content) + + save_cookies(resp.cookies, session_path) + + +if len(sys.argv) != 3: + print("Usage: python script.py ") + sys.exit(1) + +file_path = sys.argv[1] +project_path = sys.argv[2] + +session_path = os.path.join(project_path, 'pysession') +default_headers = os.path.join(project_path, 'headers.json') + +url = '' +body_txt = "" +_body_start = False + +try: + with open(file_path) as file: + lines = file.readlines() + url = lines[0] + + for line in lines[1:]: + line = line.strip() + if not line: + continue + if (_body_start or ('{' in line or '[' in line)) and not line.startswith('#'): + _body_start = True + body_txt += line + elif line.startswith('#'): + break + elif line: + string_to_header(line.strip()) + + method, url = url.strip('\n').split(' ') +except Exception as e: + print('got error when read body/headrs') + print(e) + +try: + read_default_headers(default_headers) +except Exception as e: + print('got error when read default headrs') + print(e) + +try: + send_req(method, url, body_txt) +except Exception as e: + print('got error when send request') + print(e) diff --git a/roles/dots/files/home/bin/easy_http_bak.py b/roles/dots/files/home/bin/easy_http_bak.py new file mode 100644 index 0000000..d2c8d00 --- /dev/null +++ b/roles/dots/files/home/bin/easy_http_bak.py @@ -0,0 +1,139 @@ +import uuid +import random +import os +import sys +import requests +import json +import pickle + +methods = { + 'POST': requests.post, + 'GET': requests.get, + 'PUT': requests.put, + 'PATCH': requests.patch +} + +headers = {} + +def string_to_header(s): + key, value = s.split(": ") + headers[key] = value.strip() + +def read_default_headers(default_headers_file): + if os.path.isfile(default_headers_file): + with open(default_headers_file, 'r') as file: + headers.update(json.load(file)) + +def save_cookies(requests_cookiejar, filename): + if os.path.exists(filename): + with open(filename, 'rb') as f: + try: + existing_cookies = pickle.load(f) + except EOFError: + existing_cookies = requests_cookiejar + else: + existing_cookies = requests_cookiejar + + for cookie in requests_cookiejar: + existing_cookies.set_cookie(cookie) + + with open(filename, 'wb') as f: + pickle.dump(existing_cookies, f) + +def load_cookies(filename): + try: + with open(filename, 'rb') as f: + return pickle.load(f) + except FileNotFoundError: + return None + +def set_vars(body): + for key, value in body.items(): + if isinstance(value, str): + value = value.replace('{{hex}}', uuid.uuid4().hex) + value = value.replace('{{uuid}}', str(uuid.uuid4())) + if ':code:' in value: + value = value.replace(':code:', '') + value = eval(f"{value}") + print(value) + + body[key] = str(value) + + if isinstance(value, dict): + set_vars(value) + + return body + +def send_req(method, url, body_txt): + func = methods[method] + cookie = load_cookies(session_path) + + body = json.loads(body_txt) if '{' in body_txt else {} + body = set_vars(body) + + if method == 'GET': + resp = func(url, headers=headers, params=body, cookies=cookie) + else: + resp = func(url, headers=headers, json=body, cookies=cookie) + + print(f"status_code {'':<18} {resp.status_code}") + + for header_name, header_value in resp.headers.items(): + print(f"{header_name:<30} {header_value}") + try: + resp_content = resp.json() + print(json.dumps(resp_content, indent=2)) + except ValueError: + print(resp.content) + + save_cookies(resp.cookies, session_path) + + +if len(sys.argv) != 3: + print("Usage: python script.py ") + sys.exit(1) + +file_path = sys.argv[1] +project_path = sys.argv[2] + +session_path = os.path.join(project_path, 'pysession') +default_headers = os.path.join(project_path, 'headers.json') + +url = '' +body_txt = "" +_body_start = False + +try: + with open(file_path) as file: + lines = file.readlines() + url = lines[0] + + for line in lines[1:]: + line = line.strip() + if not line: + continue + if (_body_start or '{' in line) and not line.startswith('#'): + _body_start = True + body_txt += line + elif line.startswith('#'): + break + elif line: + string_to_header(line.strip()) + + method, url = url.strip('\n').split(' ') +except Exception as e: + print('got error when read body/headrs') + print(e) + +try: + read_default_headers(default_headers) +except Exception as e: + print('got error when read default headrs') + print(e) + +try: + send_req(method, url, body_txt) +except Exception as e: + print('got error when send request') + print(e) + diff --git a/roles/dots/files/home/bin/firefox_profiles.sh b/roles/dots/files/home/bin/firefox_profiles.sh new file mode 100755 index 0000000..ba28af5 --- /dev/null +++ b/roles/dots/files/home/bin/firefox_profiles.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +# Путь к файлу profiles.ini +PROFILES_INI="$HOME/.mozilla/firefox/profiles.ini" + +if [ "$XDG_SESSION_TYPE" == "wayland" ]; then + profiles_ini="$HOME/.mozilla/firefox/profiles.ini" + profiles=$(grep '\[Profile' -A 2 "$profiles_ini" | grep 'Name=' | cut -d '=' -f 2) + selected_profile=$(echo "$profiles" | wofi --dmenu --prompt "Choose Firefox Profile:") + if [ ! "$selected_profile" = "" ]; then + firefox -P "$selected_profile"; + fi +else + # Получение списка профилей + # while read -r line; do export "$line"; done < /home/fs/scale_vars + dpi="100" + profile=$(grep '\[Profile' -A 2 "$PROFILES_INI" | grep "Name=" | sed 's/Name=//' | rofi -dmenu) + if [ ! "$profile" = "" ]; then + firefox -P "$profile"; + fi +fi + + + diff --git a/roles/dots/files/home/bin/get_current_layout.sh b/roles/dots/files/home/bin/get_current_layout.sh new file mode 100755 index 0000000..c694824 --- /dev/null +++ b/roles/dots/files/home/bin/get_current_layout.sh @@ -0,0 +1 @@ +setxkbmap -query | grep layout | awk '{print $2}' diff --git a/roles/dots/files/home/bin/gifwall.sh b/roles/dots/files/home/bin/gifwall.sh new file mode 100755 index 0000000..f0643c6 --- /dev/null +++ b/roles/dots/files/home/bin/gifwall.sh @@ -0,0 +1,3 @@ +#!/bin/sh +# xwinwrap -ni -b -fs -nf -ov -debug -- gifview -w WID -a $1 +xwinwrap -g 3840x2160 -ni -s -nf -b -un -ov -fdt -argb -- mpv --mute=yes --no-audio --no-osc --no-osd-bar --quiet --screen=0 -wid WID --loop $1 diff --git a/roles/dots/files/home/bin/laptop.sh b/roles/dots/files/home/bin/laptop.sh new file mode 100755 index 0000000..ec1cd07 --- /dev/null +++ b/roles/dots/files/home/bin/laptop.sh @@ -0,0 +1,2 @@ +#!/bin/bash +xrandr --output HDMI1 --off --output eDP1 --mode 1920x1080 --rate 60 diff --git a/roles/dots/files/home/bin/main_monitor.sh b/roles/dots/files/home/bin/main_monitor.sh new file mode 100755 index 0000000..e426dff --- /dev/null +++ b/roles/dots/files/home/bin/main_monitor.sh @@ -0,0 +1,2 @@ +#!/bin/bash +xrandr --output HDMI1 --mode 3840x2160 --panning 3840x2160 --rate 60 --output eDP1 --off diff --git a/roles/dots/files/home/bin/multi_monitors b/roles/dots/files/home/bin/multi_monitors new file mode 100755 index 0000000..317068f --- /dev/null +++ b/roles/dots/files/home/bin/multi_monitors @@ -0,0 +1,8 @@ +#!/bin/bash +if [ $1 == '-r' ]; then + xrandr --output HDMI1 --mode 3840x2160 --output eDP1 --mode 1920x1080 --rate 60 --right-of HDMI1 +else + xrandr --output HDMI1 --mode 3840x2160 --output eDP1 --mode 1920x1080 --rate 60 --below HDMI1 +fi +# xrandr --output HDMI1 --scale 1.5x1.5 --mode 3840x2160 --output eDP1 --scale 1x1 --mode 1920x1080 --rate 60 --below HDMI1 +# xrandr --output HDMI1 --scale 2x2 --mode 3840x2160 --output eDP1 --scale 1x1 --mode 1920x1080 --rate 60 --below HDMI1 diff --git a/roles/dots/files/home/bin/pywall.py b/roles/dots/files/home/bin/pywall.py new file mode 100755 index 0000000..df801e6 --- /dev/null +++ b/roles/dots/files/home/bin/pywall.py @@ -0,0 +1,38 @@ +#!/bin/python3 + +import os +import random +import time +import sys + +path = '/home/fs/Pictures/pic/new_hidpi_wallpaper' +server = os.getenv('XDG_SESSION_TYPE') + + +if server == 'wayland': + command = 'killall swaybg; swaybg -i "{}" -m fill &' +else: + command = 'feh --randomize --bg-fill {}' + +minute = 10 + +if len(sys.argv) > 1: + + if sys.argv[1] == '-w': + while True: + files = [os.path.join(path, f) for f in os.listdir(path) if os.path.isfile(os.path.join(path, f))] + random_file = random.choice(files) + os.system(command.format(random_file)) + time.sleep(minute * 60) + + elif sys.argv[1] == 'black': + p = '/home/fs/Pictures/blank.png' + os.system(command.format(p)) + + if sys.argv[1] == '-r': + files = [os.path.join(path, f) for f in os.listdir(path) if os.path.isfile(os.path.join(path, f))] + random_file = random.choice(files) + os.system(command.format(random_file)) + + else: + os.system(command.format(sys.argv[1])) diff --git a/roles/dots/files/home/bin/rofi b/roles/dots/files/home/bin/rofi new file mode 100755 index 0000000..d2f38ab --- /dev/null +++ b/roles/dots/files/home/bin/rofi @@ -0,0 +1,5 @@ +#!/bin/sh +# while read -r line; do export "$line"; done < /home/fs/scale_vars +dpi="100" +rofi -modi drun -show drun Papirus -dpi $dpi -sorting-method fzf -sort -matching fuzzy +# rofi -modi drun -show drun -show-icons -icon-theme Papirus -dpi $dpi -sorting-method fzf -sort -matching fuzzy diff --git a/roles/dots/files/home/bin/scale.py b/roles/dots/files/home/bin/scale.py new file mode 100755 index 0000000..cb9c323 --- /dev/null +++ b/roles/dots/files/home/bin/scale.py @@ -0,0 +1,32 @@ +#!/bin/python +import sys + +def replace_line_in_file(filename, old_line, new_line): + with open(filename, 'r') as file: + data = file.readlines() + + # Замена строки + for index, line in enumerate(data): + if line.strip() == old_line: + data[index] = new_line + '\n' + break + + # Запись измененного содержимого обратно в файл + with open(filename, 'w') as file: + file.writelines(data) + +if sys.argv[1] == '-s': + replace_line_in_file('/home/fs/.config/kitty/kitty.conf', 'font_size 13', 'font_size 16') + replace_line_in_file('/home/fs/bin/rofi', 'dpi="100"', 'dpi="150"') + replace_line_in_file('/home/fs/.config/chromium-flags.conf', '--force-device-scale-factor=1', '--force-device-scale-factor=1.5') + replace_line_in_file('/home/fs/bin/rofi', '# while read -r line; do export "$line"; done < /home/fs/scale_vars', 'while read -r line; do export "$line"; done < /home/fs/scale_vars') + replace_line_in_file('/home/fs/bin/firefox_profiles.sh', '# while read -r line; do export "$line"; done < /home/fs/scale_vars', 'while read -r line; do export "$line"; done < /home/fs/scale_vars') + replace_line_in_file('/home/fs/bin/firefox_profiles.sh', 'dpi="100"', 'dpi="150"') + +elif sys.argv[1] == '-d': + replace_line_in_file('/home/fs/.config/kitty/kitty.conf', 'font_size 16', 'font_size 13') + replace_line_in_file('/home/fs/bin/rofi', 'dpi="150"', 'dpi="100"') + replace_line_in_file('/home/fs/.config/chromium-flags.conf', '--force-device-scale-factor=1.5', '--force-device-scale-factor=1') + replace_line_in_file('/home/fs/bin/rofi', 'while read -r line; do export "$line"; done < /home/fs/scale_vars', '# while read -r line; do export "$line"; done < /home/fs/scale_vars') + replace_line_in_file('/home/fs/bin/firefox_profiles.sh', 'while read -r line; do export "$line"; done < /home/fs/scale_vars', '# while read -r line; do export "$line"; done < /home/fs/scale_vars') + replace_line_in_file('/home/fs/bin/firefox_profiles.sh', 'dpi="150"', 'dpi="100"') diff --git a/roles/dots/files/home/bin/screen.sh b/roles/dots/files/home/bin/screen.sh new file mode 100755 index 0000000..846f86c --- /dev/null +++ b/roles/dots/files/home/bin/screen.sh @@ -0,0 +1,2 @@ +#!/bin/bash +grim -g "$(slurp)" - | swappy -f - diff --git a/roles/dots/files/home/bin/single_monitor.sh b/roles/dots/files/home/bin/single_monitor.sh new file mode 100755 index 0000000..66c9086 --- /dev/null +++ b/roles/dots/files/home/bin/single_monitor.sh @@ -0,0 +1,2 @@ +#!/bin/bash + xrandr --output eDP1 --mode 1920x1080 --rate 60 diff --git a/roles/dots/files/home/bin/startdwm b/roles/dots/files/home/bin/startdwm new file mode 100755 index 0000000..69bd104 --- /dev/null +++ b/roles/dots/files/home/bin/startdwm @@ -0,0 +1,7 @@ +#!/bin/sh +while true; do + # Log stderror to a file + dwm 2> ~/.dwm.log + # No error logging + #dwm >/dev/null 2>&1 +done diff --git a/roles/dots/files/home/bin/temp.sh b/roles/dots/files/home/bin/temp.sh new file mode 100755 index 0000000..13f7610 --- /dev/null +++ b/roles/dots/files/home/bin/temp.sh @@ -0,0 +1 @@ +echo "$(sensors | grep Core | awk '{s+=$3} END {printf "%.2f\n", s / 6}' | sed s/+// | sed s/°C//)󰔄 $(asusctl profile -p | grep Active | awk '{ print $4 }')" diff --git a/roles/dots/files/home/bin/tmux-sessionizer.sh b/roles/dots/files/home/bin/tmux-sessionizer.sh new file mode 100755 index 0000000..35f36bc --- /dev/null +++ b/roles/dots/files/home/bin/tmux-sessionizer.sh @@ -0,0 +1,36 @@ +#!/usr/bin/env bash + +function fzf_project() { + # tmux new session + DIR=$(find /home/fs/Desktop/work -maxdepth 2 -type d ! -readable -prune -o -print | fzf) + + if [ -z "$DIR" ]; then + return + fi + + DIR_NAME=$(basename "$DIR") + CURRENT_DIR=$(echo "${DIR}" | awk -F'/' '{print $(NF-1)}') + + SESSION_NAME="${CURRENT_DIR}/${DIR_NAME}" + + if ! tmux has-session -t "$SESSION_NAME" 2>/dev/null; then + tmux new-session -ds "$SESSION_NAME" -c "$DIR" + fi + tmux switch-client -t "$SESSION_NAME" +} + +function fzf_session() { + # tmux open exist session + SESSION_NAME=$(tmux ls | awk '{print $1}' | sed s/:// | fzf) + if [ -z "$SESSION_NAME" ]; then + return + fi + + tmux switch-client -t "$SESSION_NAME" +} + +if [[ "$1" == "-E" ]]; then + fzf_session +else + fzf_project +fi diff --git a/roles/dots/files/home/bin/turbo_boost.sh b/roles/dots/files/home/bin/turbo_boost.sh new file mode 100755 index 0000000..65238de --- /dev/null +++ b/roles/dots/files/home/bin/turbo_boost.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +if [[ -z $(which rdmsr) ]]; then + echo "msr-tools is not installed. Run 'sudo apt-get install msr-tools' to install it." >&2 + exit 1 +fi + +if [[ ! -z $1 && $1 != "enable" && $1 != "disable" ]]; then + echo "Invalid argument: $1" >&2 + echo "" + echo "Usage: $(basename $0) [disable|enable]" + exit 1 +fi + +cores=$(cat /proc/cpuinfo | grep processor | awk '{print $3}') +for core in $cores; do + if [[ $1 == "disable" ]]; then + sudo wrmsr -p${core} 0x1a0 0x4000850089 + fi + if [[ $1 == "enable" ]]; then + sudo wrmsr -p${core} 0x1a0 0x850089 + fi + state=$(sudo rdmsr -p${core} 0x1a0 -f 38:38) + if [[ $state -eq 1 ]]; then + echo "core ${core}: disabled" + else + echo "core ${core}: enabled" + fi +done diff --git a/roles/dots/files/home/bin/volinfo b/roles/dots/files/home/bin/volinfo new file mode 100755 index 0000000..7a55245 --- /dev/null +++ b/roles/dots/files/home/bin/volinfo @@ -0,0 +1,11 @@ +#!/bin/sh + +status=$(pactl list sinks | grep "Mute:" | awk '{print $2}') +volume=$(pactl list sinks | grep "Volume: front" | awk {'print $5'}) + +if [ "$status" = "no" ]; then + echo "󰋋 $volume" +else + echo "󰟎 $volume" +fi + diff --git a/roles/dots/files/home/bin/wifi.py b/roles/dots/files/home/bin/wifi.py new file mode 100755 index 0000000..ddce5a5 --- /dev/null +++ b/roles/dots/files/home/bin/wifi.py @@ -0,0 +1,69 @@ +#!/bin/python3 +import subprocess +import sqlite3 + + +def initialize_database(): + connection = sqlite3.connect('wifi_passwords.db') + cursor = connection.cursor() + cursor.execute('''CREATE TABLE IF NOT EXISTS wifi_passwords + (wifi_name TEXT PRIMARY KEY, password TEXT)''') + connection.commit() + connection.close() + + +def save_password(wifi_name, password): + connection = sqlite3.connect('wifi_passwords.db') + cursor = connection.cursor() + cursor.execute("INSERT OR REPLACE INTO wifi_passwords (wifi_name, password) VALUES (?, ?)", (wifi_name, password)) + connection.commit() + connection.close() + + +def get_password(wifi_name): + connection = sqlite3.connect('wifi_passwords.db') + cursor = connection.cursor() + cursor.execute("SELECT password FROM wifi_passwords WHERE wifi_name=?", (wifi_name,)) + result = cursor.fetchone() + connection.close() + if result: + return result[0] + return None + + +def get_available_wifi_list(): + result = subprocess.run("nmcli device wifi list", shell=True, capture_output=True, text=True) + wifi_list = result.stdout.strip().split('\n')[1:] + for i, wifi in enumerate(wifi_list, start=1): + print(f"{i}. {wifi}") + return wifi_list + + +def connect_to_wifi_by_number(wifi_list, wifi_number, password): + command = f"nmcli device wifi connect '{selected_wifi}' password '{password}'" + subprocess.run(command, shell=True, check=True) + print(f"Successfully connected to WiFi: {selected_wifi}") + + +# Initialize the database +initialize_database() + +wifi_list = get_available_wifi_list() + +if wifi_list: + try: + wifi_number = int(input("wifi number:")) + selected_wifi = wifi_list[wifi_number - 1].strip().split()[1] + saved_password = get_password(selected_wifi) + + if not saved_password: + password = input("password:") + else: + password = saved_password + + connect_to_wifi_by_number(wifi_list, wifi_number, password) + # Save the password if the connection is successful + selected_wifi = wifi_list[wifi_number - 1].strip().split()[1] + save_password(selected_wifi, password) + except ValueError: + print("invalid WiFi number") diff --git a/roles/dots/files/home/bin/yt-dlp b/roles/dots/files/home/bin/yt-dlp new file mode 100755 index 0000000..e7032ef Binary files /dev/null and b/roles/dots/files/home/bin/yt-dlp differ diff --git a/roles/dots/files/home/bin/yt_download.sh b/roles/dots/files/home/bin/yt_download.sh new file mode 100755 index 0000000..c8bd3e9 --- /dev/null +++ b/roles/dots/files/home/bin/yt_download.sh @@ -0,0 +1,49 @@ +#!/bin/bash + +# Путь к файлу со ссылками +input_file="$1" + +# Путь к файлу для логов +log_file="$2" + +# Проверка наличия youtube-dl +if ! command -v ~/bin/yt-dlp &> /dev/null; then + echo "Ошибка: youtube-dl не установлен. Установите его перед использованием этого скрипта." + exit 1 +fi + +# Проверка наличия файла со ссылками +if [ ! -f "$input_file" ]; then + echo "Ошибка: Файл со ссылками не найден." + exit 1 +fi + +# Создание или очистка файла логов +echo "Логи:" > "$log_file" + +# Чтение ссылок из файла и применение youtube-dl +while IFS= read -r url; do + echo "Обработка: $url" + + # Запись в лог перед обработкой + echo "Обработка: $url" >> "$log_file" + + # Выполнение youtube-dl с определенными параметрами + ~/bin/yt-dlp -x --audio-format mp3 "$url" + + # Проверка успешности выполнения и запись в лог + if [ $? -eq 0 ]; then + echo "Успешно: $url" + echo "Успешно: $url" >> "$log_file" + else + echo "Ошибка: $url" + echo "Ошибка: $url" >> "$log_file" + fi + + # Разделитель между записями + echo "-----------------------" + +done < "$input_file" + +echo "Готово. Логи записаны в $log_file" +# https://img.youtube.com/vi/Bqa3uj7IhuU/maxresdefault.jpg diff --git a/roles/dots/files/home/create_backup.sh b/roles/dots/files/home/create_backup.sh new file mode 100755 index 0000000..8ce555d --- /dev/null +++ b/roles/dots/files/home/create_backup.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +if [ $1 = "backup" ] +then + backup_name=$(date +"%m-%d")"_backup.tar.gz" + tar cf - \ + /home/fs/Desktop/work \ + /home/fs/Desktop/a79 \ + /home/fs/Desktop/pet \ + /home/fs/Pictures \ + /home/fs/Documents \ + /home/fs/.pass \ + /home/fs/tt \ + /home/fs/.mozilla/ \ + /home/fs/.local/nvim \ + /home/fs/.cache/nvim \ + /home/fs/.local/DBeaverData | pigz > "/home/fs/backups/$backup_name" +fi + +if [ $1 = "restore" ] +then + tar --use-compress-program=pigz -xf $2 -C / +fi + + +# restore +# tar --use-compress-program=pigz -xf archive.tar.gz -C / diff --git a/roles/dots/files/home/create_hot_backup.sh b/roles/dots/files/home/create_hot_backup.sh new file mode 100755 index 0000000..79f68f2 --- /dev/null +++ b/roles/dots/files/home/create_hot_backup.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +if [ $1 = "backup" ] +then + backup_name=$(date +"%m-%d")"_hot.tar.gz" + tar cf - \ + /home/fs/Desktop/work \ + /home/fs/Desktop/a79 \ + /home/fs/.pass \ + /home/fs/.mozilla/ \ + /home/fs/.local/nvim \ + /home/fs/.cache/nvim \ + /home/fs/.cache/nvim \ + /home/fs/.emacs.d \ + /home/fs/.local/DBeaverData | pigz > "/home/fs/backups/$backup_name" +fi + +if [ $1 = "restore" ] +then + tar --use-compress-program=pigz -xf $2 -C / +fi diff --git a/roles/dots/files/home/scale_vars b/roles/dots/files/home/scale_vars new file mode 100644 index 0000000..03d61d3 --- /dev/null +++ b/roles/dots/files/home/scale_vars @@ -0,0 +1,6 @@ +QT_AUTO_SCREEN_SET_FACTOR=1 +QT_AUTO_SCREEN_SCALE_FACTOR=1 +QT_SCALE_FACTOR=1.5 +QT_FONT_DPI=96 +GDK_SCALE=1 +GDK_DPI_SCALE=2 diff --git a/roles/dots/files/system/pacman.conf b/roles/dots/files/system/pacman.conf new file mode 100644 index 0000000..9c0f211 --- /dev/null +++ b/roles/dots/files/system/pacman.conf @@ -0,0 +1,25 @@ +[options] + +HoldPkg = pacman glibc +Architecture = auto + +#UseSyslog +Color +#NoProgressBar +CheckSpace +#VerbosePkgLists +ILoveCandy +ParallelDownloads = 5 + +SigLevel = Required DatabaseOptional +LocalFileSigLevel = Optional + + +[core] +Include = /etc/pacman.d/mirrorlist + +[extra] +Include = /etc/pacman.d/mirrorlist + +[multilib] +Include = /etc/pacman.d/mirrorlist diff --git a/roles/dots/files/xorg/30-touchpad.conf b/roles/dots/files/xorg/30-touchpad.conf new file mode 100644 index 0000000..0020ab1 --- /dev/null +++ b/roles/dots/files/xorg/30-touchpad.conf @@ -0,0 +1,9 @@ +Section "InputClass" + Identifier "touchpad" + Driver "libinput" + MatchIsTouchpad "on" + Option "Tapping" "on" + Option "TapButton1" "1" + Option "TapButton2" "2" + Option "TapButton3" "3" +EndSection diff --git a/roles/dots/tasks/common_files.yml b/roles/dots/tasks/common_files.yml new file mode 100644 index 0000000..60f321c --- /dev/null +++ b/roles/dots/tasks/common_files.yml @@ -0,0 +1,51 @@ +- name: Setup home config files + copy: + src: "{{ item.src }}" + dest: "/home/{{ main_user.name }}/" + owner: "{{ main_user.name }}" + group: users + loop: + - { src: "files/home/.moc" } + - { src: "files/home/.bashrc" } + - { src: "files/home/.tmux.conf" } + - { src: "files/home/create_backup.sh" } + - { src: "files/home/create_hot_backup.sh" } + - { src: "files/home/.gitconfig" } + - { src: "files/home/.alacritty.toml" } + - { src: "files/home/bin" } + +- name: Setup .config dir + copy: + src: "{{ item.src }}" + dest: "/home/{{ main_user.name }}/.config/" + owner: "{{ main_user.name }}" + group: users + loop: + - { src: "files/config/kitty" } + - { src: "files/config/nvim" } + +- name: Copy pacman.conf + copy: + src: files/system/pacman.conf + dest: /etc/pacman.conf + owner: root + group: root + +- name: Setup home config files + when: display_server == 'xorg' + copy: + src: "{{ item.src }}" + dest: "/home/{{ main_user.name }}/" + owner: "{{ main_user.name }}" + group: users + loop: + - { src: "home/.xinitrc" } + - { src: "home/.Xresources" } + +- name: Setup rofi theme + when: display_server == 'xorg' + copy: + src: "files/config/rofi/themes/" + dest: "/home/{{ main_user.name }}/.local/share/rofi/themes/" + owner: "{{ main_user.name }}" + group: users diff --git a/roles/dots/tasks/main.yml b/roles/dots/tasks/main.yml new file mode 100644 index 0000000..ef1249b --- /dev/null +++ b/roles/dots/tasks/main.yml @@ -0,0 +1,12 @@ + - name: Configure dots files + ansible.builtin.include_tasks: + file: "common_files.yml" + + - name: Configure ssh keys + ansible.builtin.include_tasks: + file: "ssh.yml" + + - name: Configure xorg + when: display_server == 'xorg' + ansible.builtin.include_tasks: + file: "xorg_files.yml" diff --git a/roles/dots/tasks/ssh.yml b/roles/dots/tasks/ssh.yml new file mode 100644 index 0000000..a4b39cc --- /dev/null +++ b/roles/dots/tasks/ssh.yml @@ -0,0 +1,39 @@ +- name: Create .ssh directory + file: + path: "/home/{{ main_user.name }}/.ssh" + state: directory + mode: '0700' + owner: "{{ main_user.name }}" + group: users + +- name: setup publc ssh key + copy: + dest: "/home/{{ main_user.name }}/.ssh/id_rsa.pub" + content: "{{ ssh_pub }}" + mode: "0644" + owner: "{{ main_user.name }}" + group: users + +- name: setup private ssh key + copy: + dest: "/home/{{ main_user.name }}/.ssh/id_rsa" + content: "{{ ssh_private }}" + mode: "0600" + owner: "{{ main_user.name }}" + group: users + +- name: setup publc VPN ssh key + copy: + dest: "/home/{{ main_user.name }}/.ssh/vpn.pub" + content: "{{ ssh_vpn_pub }}" + mode: "0644" + owner: "{{ main_user.name }}" + group: users + +- name: setup private VPN ssh key + copy: + dest: "/home/{{ main_user.name }}/.ssh/vpn" + content: "{{ ssh_vpn_private }}" + mode: "0600" + owner: "{{ main_user.name }}" + group: users diff --git a/roles/dots/tasks/xorg_files.yml b/roles/dots/tasks/xorg_files.yml new file mode 100644 index 0000000..d5b3e86 --- /dev/null +++ b/roles/dots/tasks/xorg_files.yml @@ -0,0 +1,16 @@ +- name: Setup home config files + copy: + src: "{{ item.src }}" + dest: "/home/{{ main_user.name }}/" + owner: "{{ main_user.name }}" + group: users + loop: + - { src: "home/.xinitrc" } + - { src: "home/.Xresources" } + +- name: touchpad + copy: + src: files/xorg/30-touchpad.conf + dest: /etc/X11/xorg.conf.d/30-touchpad.conf + owner: root + group: root diff --git a/roles/packages/tasks/apps.yml b/roles/packages/tasks/apps.yml new file mode 100644 index 0000000..1609ee9 --- /dev/null +++ b/roles/packages/tasks/apps.yml @@ -0,0 +1,89 @@ +- name: utils (command line) + pacman: + name: + - fzf + - rsync + - jq + - ffmpeg + - eza + - htop + - cryptsetup + - wireguard-tools + - net-tools + - wget + - ripgrep + +- name: drivers & demons & low level tools + pacman: + name: + - openresolv # resolv.conf management framework (resolvconf) Optional For: dhcpcd networkmanager wireguard-tools + - android-file-transfer + - openssh + - ntfs-3g + - make + - msr-tools + - ctags + +- name: gui apps + pacman: + name: + - transmission-gtk + - atril # reader + - pcmanfm # file manager + - mpv + - telegram-desktop + - drawing + - gnome-sound-recorder + - cherrytree + - chromium + - firefox + - libreoffice-still + - virt-manager + - steam + +- name: for archiver + pacman: + name: + - p7zip + - unzip + - pigz + +- name: for programming + pacman: + name: + - go + - vim + - alacritty + - kitty + - tmux + - git + - git-delta + - emacs + - dbeaver + - docker + - docker-compose + - python-virtualenv + +- name: install system packages + package: + name: + - ntfs-3g + - make + - msr-tools + - ctags + +- name: install fonts & icons + package: + name: + - papirus-icon-theme + - noto-fonts # for all language + - noto-fonts-cjk # for all language + - ttf-fira-code + - ttf-firacode-nerd + - ttf-font-awesome + - ttf-hanazono + - ttf-iosevka-nerd + - ttf-jetbrains-mono-nerd + - ttf-liberation + - ttf-opensans + - ttf-ubuntu-mono-nerd diff --git a/roles/packages/tasks/aur.yml b/roles/packages/tasks/aur.yml new file mode 100644 index 0000000..d830c0b --- /dev/null +++ b/roles/packages/tasks/aur.yml @@ -0,0 +1,9 @@ +- name: Install AUR packages + aur: + name: "{{ item }}" + user: "{{ main_user.name }}" + loop: + - moc-pulse + - vimiv-qt + - ttf-devicons + - snapd diff --git a/roles/packages/tasks/docker.yml b/roles/packages/tasks/docker.yml new file mode 100644 index 0000000..7aed148 --- /dev/null +++ b/roles/packages/tasks/docker.yml @@ -0,0 +1,22 @@ +- name: install docker + pacman: + name: + - docker + - docker-compose + +- name: Ensure docker group exists + group: + name: docker + state: present + +- name: Add user to docker group + user: + name: "{{ main_user.name }}" + groups: docker + append: yes + +- name: Enable Docker service + systemd: + name: docker + enabled: yes + state: started diff --git a/roles/packages/tasks/main.yml b/roles/packages/tasks/main.yml new file mode 100644 index 0000000..17d9dc6 --- /dev/null +++ b/roles/packages/tasks/main.yml @@ -0,0 +1,16 @@ + - name: install packages from main repository + ansible.builtin.include_tasks: + file: "apps.yml" + + - name: install aur packages + ansible.builtin.include_tasks: + file: "aur.yml" + + - name: include tasks install docker file + ansible.builtin.include_tasks: + file: "docker.yml" + + - name: include tasks install xorg + when: display_server == 'xorg' + ansible.builtin.include_tasks: + file: "xorg.yml" diff --git a/roles/packages/tasks/xorg.yml b/roles/packages/tasks/xorg.yml new file mode 100644 index 0000000..690ca70 --- /dev/null +++ b/roles/packages/tasks/xorg.yml @@ -0,0 +1,18 @@ +- name: xorg apps + package: + name: + - xclip + - xarchiver + - libxinerama + - lxappearance + - picom + +- name: xrog dependent apps + pacman: + name: + - rofi + - dunst + - slock + - flameshot + - nitrogen + - feh diff --git a/roles/window_managers/files/sway/config b/roles/window_managers/files/sway/config new file mode 100644 index 0000000..d6427fe --- /dev/null +++ b/roles/window_managers/files/sway/config @@ -0,0 +1,295 @@ +# Default config for sway +# +# Copy this to ~/.config/sway/config and edit it to your liking. +# +# Read `man 5 sway` for a complete reference. + +#default_border none +# default_floating_border none +# titlebar_padding 1 +# titlebar_border_thickness 0 + +set $menu wofi --show run + +### Variables +# +# Logo key. Use Mod1 for Alt. +set $mod Mod1 +# Home row direction keys, like vim +set $left h +set $down j +set $up k +set $right l +# Your preferred terminal emulator +set $term kitty + +### Output configuration +# +# Default wallpaper (more resolutions are available in /usr/share/backgrounds/sway/) +# output * bg /usr/share/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png fill +output * bg /home/fs/Pictures/nord.png fill +# +# Example configuration: +# +# output HDMI-A-1 resolution 1920x1080 position 1920,0 +# +# You can get the names of your outputs by running: swaymsg -t get_outputs + +### Idle configuration +# +# Example configuration: +# +# exec swayidle -w \ +# timeout 300 'swaylock -f -c 000000' \ +# timeout 600 'swaymsg "output * power off"' resume 'swaymsg "output * power on"' \ +# before-sleep 'swaylock -f -c 000000' +# +# This will lock your screen after 300 seconds of inactivity, then turn off +# your displays after another 300 seconds, and turn your screens back on when +# resumed. It will also lock your screen before your computer goes to sleep. + +### Input configuration +# +# Example configuration: +# +# input "2:14:SynPS/2_Synaptics_TouchPad" { +# dwt enabled +# tap enabled +# natural_scroll enabled +# middle_emulation enabled +# } +# +# You can get the names of your inputs by running: swaymsg -t get_inputs +# Read `man 5 sway-input` for more information about this section. + +### Key bindings +# +# Basics: +# + # Start a terminal + bindsym $mod+Return exec $term + + # Kill focused window + bindsym $mod+q kill + + # Start your launcher + bindsym $mod+r mode $main_map + mode "$main_map" { + bindsym i exec $menu; mode "default" + bindsym u exec ~/bin/firefox_profiles.sh; mode "default" + } + + # Drag floating windows by holding down $mod and left mouse button. + # Resize them with right mouse button + $mod. + # Despite the name, also works for non-floating windows. + # Change normal to inverse to use left mouse button for resizing and right + # mouse button for dragging. + floating_modifier $mod normal + + # Reload the configuration file + bindsym $mod+Shift+c reload + + # Exit sway (logs you out of your Wayland session) + bindsym $mod+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -B 'Yes, exit sway' 'swaymsg exit' +# +# Moving around: +# + # Move your focus around + bindsym $mod+$left focus left + bindsym $mod+$down focus down + bindsym $mod+$up focus up + bindsym $mod+$right focus right + # Or use $mod+[up|down|left|right] + bindsym $mod+Left focus left + bindsym $mod+Down focus down + bindsym $mod+Up focus up + bindsym $mod+Right focus right + + # Move the focused window with the same, but add Shift + bindsym $mod+Shift+$left move left + bindsym $mod+Shift+$down move down + bindsym $mod+Shift+$up move up + bindsym $mod+Shift+$right move right + # Ditto, with arrow 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 +# +# Workspaces: +# + # Switch to workspace + bindsym $mod+1 workspace number 1 + bindsym $mod+2 workspace number 2 + bindsym $mod+3 workspace number 3 + bindsym $mod+4 workspace number 4 + bindsym $mod+5 workspace number 5 + bindsym $mod+6 workspace number 6 + bindsym $mod+7 workspace number 7 + bindsym $mod+8 workspace number 8 + bindsym $mod+9 workspace number 9 + bindsym $mod+0 workspace number 10 + # Move focused container to workspace + bindsym $mod+Shift+1 move container to workspace number 1 + bindsym $mod+Shift+2 move container to workspace number 2 + bindsym $mod+Shift+3 move container to workspace number 3 + bindsym $mod+Shift+4 move container to workspace number 4 + bindsym $mod+Shift+5 move container to workspace number 5 + bindsym $mod+Shift+6 move container to workspace number 6 + bindsym $mod+Shift+7 move container to workspace number 7 + bindsym $mod+Shift+8 move container to workspace number 8 + bindsym $mod+Shift+9 move container to workspace number 9 + bindsym $mod+Shift+0 move container to workspace number 10 + # Note: workspaces can have any name you want, not just numbers. + # We just use 1-10 as the default. +# +# Layout stuff: +# + # You can "split" the current object of your focus with + # $mod+b or $mod+v, for horizontal and vertical splits + # respectively. + bindsym $mod+b splith + bindsym $mod+v splitv + + # Switch the current container between different layout styles + bindsym $mod+s layout stacking + bindsym $mod+w layout tabbed + bindsym $mod+e layout toggle split + + # Make the current focus fullscreen + bindsym $mod+f fullscreen + + # Toggle the current focus between tiling and floating mode + bindsym $mod+Shift+f floating toggle + + # Swap focus between the tiling area and the floating area + bindsym $mod+space focus mode_toggle + + # Move focus to the parent container + bindsym $mod+a focus parent + +# +# Scratchpad: +# + # Sway has a "scratchpad", which is a bag of holding for windows. + # You can send windows there and get them back later. + + # Move the currently focused window to the scratchpad + bindsym $mod+Shift+minus move scratchpad + + # Show the next scratchpad window or hide the focused scratchpad window. + # If there are multiple scratchpad windows, this command cycles through them. + bindsym $mod+minus scratchpad show +# +# Resizing containers: +# +mode "resize" { + # left will shrink the containers width + # right will grow the containers width + # up will shrink the containers height + # down will grow the containers height + bindsym $left resize shrink width 10px + bindsym $down resize grow height 10px + bindsym $up resize shrink height 10px + bindsym $right resize grow width 10px + + # Ditto, with arrow keys + bindsym Left resize shrink width 10px + bindsym Down resize grow height 10px + bindsym Up resize shrink height 10px + bindsym Right resize grow width 10px + + # Return to default mode + bindsym Return mode "default" + bindsym Escape mode "default" +} +# bindsym $mod+r mode "resize" + +# +# Status Bar: +# +# Read `man 5 sway-bar` for more information about this section. +#bar { +# position top +# +# # When the status_command prints a new line to stdout, swaybar updates. +# # The default just shows the current date and time. +# status_command while date +'%Y-%m-%d %X'; do sleep 1; done +# +# colors { +# statusline #ffffff +# background #323232 +# inactive_workspace #32323200 #32323200 #5c5c5c +# } +#} + +include /etc/sway/config.d/* + + +# --- autostart --- +exec swaymsg "workspace 1; exec emacs --daemon;" + +} +input type:keyboard { + xkb_layout us,ru + xkb_options grp:ctrl_alt_toggle,caps:ctrl_modifier +} + +# --- bar --- +bar { + swaybar_command waybar +} + +# --- custom bind --- + +# Volume up +bindsym XF86AudioRaiseVolume exec "pactl set-sink-volume 0 +5%" + +# Volume down +bindsym XF86AudioLowerVolume exec "pactl set-sink-volume 0 -5%" + +# Mute/unmute +bindsym XF86AudioMute exec "pactl set-sink-mute 0 toggle" + + +# waybar,wofi,sway,grim,brightnessctl + +bindsym $mod+p exec ~/bin/screen.sh +bindsym $mod+i exec "emacsclient -c" +bindsym Mod4+u exec "mocp --seek -5" +bindsym Mod4+i exec "mocp --seek +5" +bindsym Mod4+j exec "mocp --previous" +bindsym Mod4+k exec "mocp --next" +bindsym Mod4+space exec "mocp --toggle-pause" +bindsym Mod4+r exec "swaymsg reload" + +# -- display -- +bindsym XF86MonBrightnessUp exec brightnessctl set +5% +bindsym XF86MonBrightnessDown exec brightnessctl set 5%- + + +# --- touchpad +# get identifier "swaymsg -t get_inputs" +input "1267:12410:ELAN1203:00_04F3:307A_Touchpad" { + dwt enabled + tap enabled + middle_emulation enabled +} + +# --- theme --- +default_border pixel 2 +default_floating_border none +titlebar_padding 1 +titlebar_border_thickness 0 +gaps inner 10 + +set { + $accent #ebdbb2 + $red #cc241d + $darkgray #3c3836 +} + +client.focused $accent $accent $darkgray $accent $accent +client.focused_inactive $darkgray $darkgray $accent $darkgray $darkgray +client.unfocused $darkgray $darkgray $accent $darkgray $darkgray +client.urgent $red $red $accent $red $red diff --git a/roles/window_managers/files/sway/outputs b/roles/window_managers/files/sway/outputs new file mode 100644 index 0000000..316ccaf --- /dev/null +++ b/roles/window_managers/files/sway/outputs @@ -0,0 +1,12 @@ +# Generated by nwg-displays on 2024-09-02 at 13:06:54. Do not edit manually. + +output "HDMI-A-1" { + mode 3840x2160@60.0Hz + pos 0 0 + transform normal + scale 1.5 + scale_filter smart + adaptive_sync off + dpms on +} +output "eDP-1" disable diff --git a/roles/window_managers/files/sway/workspaces b/roles/window_managers/files/sway/workspaces new file mode 100644 index 0000000..d8d973d --- /dev/null +++ b/roles/window_managers/files/sway/workspaces @@ -0,0 +1,3 @@ +# Generated by nwg-displays on 2024-07-18 at 21:21:27. Do not edit manually. + +workspace 1 output HDMI-A-1 diff --git a/roles/window_managers/files/waybar/config b/roles/window_managers/files/waybar/config new file mode 100644 index 0000000..2bc2e36 --- /dev/null +++ b/roles/window_managers/files/waybar/config @@ -0,0 +1,212 @@ +{ + "layer": "top", + "position": "top", + + "modules-left": [ + "sway/mode", + "sway/workspaces", + "custom/arrow10", + "sway/window" + ], + + "modules-right": [ + "custom/arrow9", + "pulseaudio", + "custom/arrow8", + "network", + "custom/arrow7", + "memory", + "custom/arrow6", + "cpu", + "custom/arrow5", + "temperature", + "custom/arrow4", + "battery", + "custom/arrow3", + "sway/language", + "custom/arrow2", + "tray", + "clock#date", + "custom/arrow1", + "clock#time" + ], + + // Modules + + "battery": { + "interval": 10, + "states": { + "warning": 30, + "critical": 15 + }, + "format-time": "{H}:{M:02}", + "format": "{icon} {capacity}% ({time})", + "format-charging": " {capacity}% ({time})", + "format-charging-full": " {capacity}%", + "format-full": "{icon} {capacity}%", + "format-alt": "{icon} {power}W", + "format-icons": [ + " ", + " ", + " ", + " ", + " " + ], + "tooltip": false + }, + + "clock#time": { + "interval": 10, + "format": "{:%H:%M}", + "tooltip": false + }, + + "clock#date": { + "interval": 20, + "format": "{:%e %b %Y}", + "tooltip": false + //"tooltip-format": "{:%e %B %Y}" + }, + + "sway/language": { + "format": " {short}", + "min-length": 5, + "on-click": "swaymsg 'input * xkb_switch_layout next'", + "tooltip": false + }, + + "cpu": { + "interval": 5, + "tooltip": false, + "format": " {usage}%", + "format-alt": " {load}", + "states": { + "warning": 70, + "critical": 90 + } + }, + + "memory": { + "interval": 5, + "format": "RAM {used:0.1f}G/{total:0.1f}G", + "states": { + "warning": 70, + "critical": 90 + }, + "tooltip": false + }, + + "network": { + "interval": 5, + "format-wifi": " {essid} ({signalStrength}%)", + "format-ethernet": " {ifname}", + "format-disconnected": "No connection", + "format-alt": " {ipaddr}/{cidr}", + "tooltip": false + }, + + "sway/mode": { + "format": "{}", + "tooltip": false + }, + + "sway/window": { + "format": "{}", + "max-length": 30, + "tooltip": false + }, + + "sway/workspaces": { + "disable-scroll-wraparound": true, + "smooth-scrolling-threshold": 4, + "enable-bar-scroll": true, + "format": "{name}" + }, + + "pulseaudio": { + "format": "{icon} {volume}%", + "format-bluetooth": "{icon} {volume}%", + "format-muted": "", + "format-icons": { + "headphone": " ", + "hands-free": "", + "headset": "", + "phone": "", + "portable": "", + "car": "", + "default": [" ", " "] + }, + "scroll-step": 1, + "on-click": "pactl set-sink-mute @DEFAULT_SINK@ toggle", + "tooltip": false + }, + + "temperature": { + "critical-threshold": 90, + "interval": 5, + "format": "{icon} {temperatureC}°", + "format-icons": [ + "", + "", + "", + "", + "" + ], + "tooltip": false + }, + + "tray": { + "icon-size": 18 + //"spacing": 10 + }, + + "custom/arrow1": { + "format": "", + "tooltip": false + }, + + "custom/arrow2": { + "format": "", + "tooltip": false + }, + + "custom/arrow3": { + "format": "", + "tooltip": false + }, + + "custom/arrow4": { + "format": "", + "tooltip": false + }, + + "custom/arrow5": { + "format": "", + "tooltip": false + }, + + "custom/arrow6": { + "format": "", + "tooltip": false + }, + + "custom/arrow7": { + "format": "", + "tooltip": false + }, + + "custom/arrow8": { + "format": "", + "tooltip": false + }, + + "custom/arrow9": { + "format": "", + "tooltip": false + }, + + "custom/arrow10": { + "format": "", + "tooltip": false + } +} diff --git a/roles/window_managers/files/waybar/style.css b/roles/window_managers/files/waybar/style.css new file mode 100644 index 0000000..305789e --- /dev/null +++ b/roles/window_managers/files/waybar/style.css @@ -0,0 +1,265 @@ + + +@keyframes blink-critical { + to { + /*color: @white;*/ + background-color: @critical; + } +} + + +/* Styles */ + +/* Colors (gruvbox) */ +@define-color black #282828; +@define-color red #cc241d; +@define-color green #98971a; +@define-color yellow #d79921; +@define-color blue #458588; +@define-color purple #b16286; +@define-color aqua #689d6a; +@define-color gray #a89984; +@define-color brgray #928374; +@define-color brred #fb4934; +@define-color brgreen #b8bb26; +@define-color bryellow #fabd2f; +@define-color brblue #83a598; +@define-color brpurple #d3869b; +@define-color braqua #8ec07c; +@define-color white #ebdbb2; +@define-color bg2 #504945; + + +@define-color warning @bryellow; +@define-color critical @red; +@define-color mode @black; +@define-color unfocused @bg2; +@define-color focused @braqua; +@define-color inactive @purple; +@define-color sound @brpurple; +@define-color network @purple; +@define-color memory @braqua; +@define-color cpu @green; +@define-color temp @brgreen; +@define-color layout @bryellow; +@define-color battery @aqua; +@define-color date @black; +@define-color time @white; + +/* Reset all styles */ +* { + border: none; + border-radius: 0; + min-height: 0; + margin: 0; + padding: 0; + box-shadow: none; + text-shadow: none; + icon-shadow: none; +} + +/* The whole bar */ +#waybar { + background: rgba(40, 40, 40, 0.8784313725); /* #282828e0 */ + color: @white; + font-family: JetBrains Mono, Siji; + font-size: 10pt; + /*font-weight: bold;*/ +} + +/* Each module */ +#battery, +#clock, +#cpu, +#language, +#memory, +#mode, +#network, +#pulseaudio, +#temperature, +#tray, +#backlight, +#idle_inhibitor, +#disk, +#user, +#mpris { + padding-left: 8pt; + padding-right: 8pt; +} + +/* Each critical module */ +#mode, +#memory.critical, +#cpu.critical, +#temperature.critical, +#battery.critical.discharging { + animation-timing-function: linear; + animation-iteration-count: infinite; + animation-direction: alternate; + animation-name: blink-critical; + animation-duration: 1s; +} + +/* Each warning */ +#network.disconnected, +#memory.warning, +#cpu.warning, +#temperature.warning, +#battery.warning.discharging { + color: @warning; +} + +/* And now modules themselves in their respective order */ + +/* Current sway mode (resize etc) */ +#mode { + color: @white; + background: @mode; +} + +/* Workspaces stuff */ +#workspaces button { + /*font-weight: bold;*/ + padding-left: 2pt; + padding-right: 2pt; + color: @white; + background: @unfocused; +} + +/* Inactive (on unfocused output) */ +#workspaces button.visible { + color: @white; + background: @inactive; +} + +/* Active (on focused output) */ +#workspaces button.focused { + color: @black; + background: @focused; +} + +/* Contains an urgent window */ +#workspaces button.urgent { + color: @black; + background: @warning; +} + +/* Style when cursor is on the button */ +#workspaces button:hover { + background: @black; + color: @white; +} + +#window { + margin-right: 35pt; + margin-left: 35pt; +} + +#pulseaudio { + background: @sound; + color: @black; +} + +#network { + background: @network; + color: @white; +} + +#memory { + background: @memory; + color: @black; +} + +#cpu { + background: @cpu; + color: @white; +} + +#temperature { + background: @temp; + color: @black; +} + +#language { + background: @layout; + color: @black; +} + +#battery { + background: @battery; + color: @white; +} + +#tray { + background: @date; +} + +#clock.date { + background: @date; + color: @white; +} + +#clock.time { + background: @time; + color: @black; +} + +#custom-arrow1 { + font-size: 11pt; + color: @time; + background: @date; +} + +#custom-arrow2 { + font-size: 11pt; + color: @date; + background: @layout; +} + +#custom-arrow3 { + font-size: 11pt; + color: @layout; + background: @battery; +} + +#custom-arrow4 { + font-size: 11pt; + color: @battery; + background: @temp; +} + +#custom-arrow5 { + font-size: 11pt; + color: @temp; + background: @cpu; +} + +#custom-arrow6 { + font-size: 11pt; + color: @cpu; + background: @memory; +} + +#custom-arrow7 { + font-size: 11pt; + color: @memory; + background: @network; +} + +#custom-arrow8 { + font-size: 11pt; + color: @network; + background: @sound; +} + +#custom-arrow9 { + font-size: 11pt; + color: @sound; + background: transparent; +} + +#custom-arrow10 { + font-size: 11pt; + color: @unfocused; + background: transparent; +} diff --git a/roles/window_managers/files/wofi/style.css b/roles/window_managers/files/wofi/style.css new file mode 100644 index 0000000..8cb23cc --- /dev/null +++ b/roles/window_managers/files/wofi/style.css @@ -0,0 +1,39 @@ +window { +margin: 0px; +border: 1px solid #928374; +background-color: #282828; +} + +#input { +margin: 5px; +border: none; +color: #ebdbb2; +background-color: #1d2021; +} + +#inner-box { +margin: 5px; +border: none; +background-color: #282828; +} + +#outer-box { +margin: 5px; +border: none; +background-color: #282828; +} + +#scroll { +margin: 0px; +border: none; +} + +#text { +margin: 5px; +border: none; +color: #ebdbb2; +} + +#entry:selected { +background-color: #1d2021; +} diff --git a/roles/window_managers/tasks/main.yml b/roles/window_managers/tasks/main.yml new file mode 100644 index 0000000..8e6d847 --- /dev/null +++ b/roles/window_managers/tasks/main.yml @@ -0,0 +1,4 @@ +- name: Configure sway files + when: display_server == 'wayland' + ansible.builtin.include_tasks: + file: "sway.yml" \ No newline at end of file diff --git a/roles/window_managers/tasks/sway.yml b/roles/window_managers/tasks/sway.yml new file mode 100644 index 0000000..34f4048 --- /dev/null +++ b/roles/window_managers/tasks/sway.yml @@ -0,0 +1,22 @@ +- name: install sway + pacman: + name: + - sway + - swaybg + - polkit + - waybar + - wofi + - grim + - brightnessctl + - wl-clipboard + +- name: Setup .config dir + copy: + src: "{{ item.src }}" + dest: "/home/{{ main_user.name }}/.config/" + owner: "{{ main_user.name }}" + group: users + loop: + - { src: "files/sway" } + - { src: "files/waybar" } + - { src: "files/wofi" } diff --git a/save_new_config.sh b/save_new_config.sh new file mode 100755 index 0000000..2794125 --- /dev/null +++ b/save_new_config.sh @@ -0,0 +1,21 @@ +#!/bin/bash +rsync -av /home/fs/.config/nvim/ roles/dots/files/config/nvim --exclude packer +rsync -av /home/fs/.config/kitty/ roles/dots/files/config/kitty + +# emacs +cp /home/fs/.emacs.d/config.org roles/dots/files/home/.emacs.d/ +cp -r /home/fs/.emacs.d/lan roles/dots/files/home/.emacs.d/ + +# wayland wm +rsync -av /home/fs/.config/sway roles/window_managers/files/ +rsync -av /home/fs/.config/waybar roles/window_managers/files/ +rsync -av /home/fs/.config/wofi roles/window_managers/files/ + +cp /home/fs/.bashrc roles/dots/files/home/ +cp /home/fs/.gitconfig roles/dots/files/home/ +cp /home/fs/.tmux.conf roles/dots/files/home/ +cp /home/fs/.xinitrc roles/dots/files/home/ +cp /home/fs/scale_vars roles/dots/files/home/ + +rsync -av /home/fs/.moc roles/dots/files/home/ +rsync -av /home/fs/bin roles/dots/files/home/