dmenu, dwm, youtube-watch-selector, vimrc for html
This commit is contained in:
parent
42b4f424a3
commit
fa51627050
|
@ -1,200 +0,0 @@
|
|||
set aaa_mode=all
|
||||
set altformat_current= %F
|
||||
set altformat_playlist= %f%= %d
|
||||
set altformat_title=%f
|
||||
set altformat_trackwin= %f%= %d
|
||||
set auto_expand_albums_follow=true
|
||||
set auto_expand_albums_search=true
|
||||
set auto_expand_albums_selcur=true
|
||||
set auto_reshuffle=true
|
||||
set buffer_seconds=10
|
||||
set color_cmdline_attr=default
|
||||
set color_cmdline_bg=default
|
||||
set color_cmdline_fg=default
|
||||
set color_cur_sel_attr=default
|
||||
set color_error=lightred
|
||||
set color_info=lightyellow
|
||||
set color_separator=blue
|
||||
set color_statusline_attr=default
|
||||
set color_statusline_bg=gray
|
||||
set color_statusline_fg=black
|
||||
set color_titleline_attr=default
|
||||
set color_titleline_bg=blue
|
||||
set color_titleline_fg=white
|
||||
set color_trackwin_album_attr=bold
|
||||
set color_trackwin_album_bg=default
|
||||
set color_trackwin_album_fg=default
|
||||
set color_win_attr=default
|
||||
set color_win_bg=default
|
||||
set color_win_cur=lightyellow
|
||||
set color_win_cur_attr=default
|
||||
set color_win_cur_sel_attr=default
|
||||
set color_win_cur_sel_bg=blue
|
||||
set color_win_cur_sel_fg=lightyellow
|
||||
set color_win_dir=lightblue
|
||||
set color_win_fg=default
|
||||
set color_win_inactive_cur_sel_attr=default
|
||||
set color_win_inactive_cur_sel_bg=gray
|
||||
set color_win_inactive_cur_sel_fg=lightyellow
|
||||
set color_win_inactive_sel_attr=default
|
||||
set color_win_inactive_sel_bg=gray
|
||||
set color_win_inactive_sel_fg=black
|
||||
set color_win_sel_attr=default
|
||||
set color_win_sel_bg=blue
|
||||
set color_win_sel_fg=white
|
||||
set color_win_title_attr=default
|
||||
set color_win_title_bg=blue
|
||||
set color_win_title_fg=white
|
||||
set confirm_run=true
|
||||
set continue=true
|
||||
set device=/dev/cdrom
|
||||
set display_artist_sort_name=false
|
||||
set dsp.alsa.device=
|
||||
set dsp.jack.server_name=
|
||||
set follow=false
|
||||
set format_current= %a - %l -%3n. %t%= %y
|
||||
set format_playlist= %-21%a %3n. %t%= %y %d %{?X!=0?%3X ? }
|
||||
set format_playlist_va= %-21%A %3n. %t (%a)%= %y %d %{?X!=0?%3X ? }
|
||||
set format_statusline= %{status} %{?show_playback_position?%{position} %{?duration?/ %{duration} }?%{?duration?%{duration} }}- %{total} %{?bpm>0?at %{bpm} BPM }%{?volume>=0?vol: %{?lvolume!=rvolume?%{lvolume},%{rvolume} ?%{volume} }}%{?stream?buf: %{buffer} }%{?show_current_bitrate & bitrate>=0? %{bitrate} kbps }%=%{?repeat_current?repeat current?%{?play_library?%{playlist_mode} from %{?play_sorted?sorted }library?playlist}} | %1{continue}%1{follow}%1{repeat}%1{shuffle}
|
||||
set format_title=%a - %l - %t (%y)
|
||||
set format_trackwin=%3n. %t%= %y %d
|
||||
set format_trackwin_album= %l %= %{albumduration}
|
||||
set format_trackwin_va=%3n. %t (%a)%= %y %d
|
||||
set format_treewin= %l
|
||||
set format_treewin_artist=%a
|
||||
set icecast_default_charset=ISO-8859-1
|
||||
set id3_default_charset=ISO-8859-1
|
||||
set input.aac.priority=50
|
||||
set input.ffmpeg.priority=30
|
||||
set input.flac.priority=50
|
||||
set input.mad.priority=55
|
||||
set input.mp4.priority=50
|
||||
set input.opus.priority=50
|
||||
set input.vorbis.priority=50
|
||||
set input.wav.priority=50
|
||||
set input.wavpack.priority=50
|
||||
set lib_add_filter=
|
||||
set lib_sort=albumartist date album discnumber tracknumber title filename play_count
|
||||
set mixer.alsa.channel=
|
||||
set mixer.alsa.device=
|
||||
set mixer.pulse.restore_volume=1
|
||||
set mouse=false
|
||||
set mpris=true
|
||||
set output_plugin=pulse
|
||||
set passwd=venirapormi
|
||||
set pl_sort=
|
||||
set play_library=true
|
||||
set play_sorted=true
|
||||
set repeat=false
|
||||
set repeat_current=false
|
||||
set replaygain=disabled
|
||||
set replaygain_limit=true
|
||||
set replaygain_preamp=0.000000
|
||||
set resume=false
|
||||
set rewind_offset=5
|
||||
set scroll_offset=2
|
||||
set set_term_title=true
|
||||
set show_all_tracks=true
|
||||
set show_current_bitrate=false
|
||||
set show_hidden=false
|
||||
set show_playback_position=true
|
||||
set show_remaining_time=true
|
||||
set shuffle=true
|
||||
set skip_track_info=false
|
||||
set smart_artist_sort=true
|
||||
set softvol=false
|
||||
set softvol_state=0 0
|
||||
set start_view=tree
|
||||
set status_display_program=
|
||||
set time_show_leading_zero=true
|
||||
set wrap_search=true
|
||||
bind browser backspace browser-up
|
||||
bind browser i toggle show_hidden
|
||||
bind browser space win-activate
|
||||
bind browser u win-update
|
||||
bind common ! push shell
|
||||
bind common + vol +10%
|
||||
bind common , seek -1m
|
||||
bind common - vol -10%
|
||||
bind common . seek +1m
|
||||
bind common / search-start
|
||||
bind common 1 view tree
|
||||
bind common 2 view sorted
|
||||
bind common 3 view playlist
|
||||
bind common 4 view queue
|
||||
bind common 5 view browser
|
||||
bind common 6 view filters
|
||||
bind common 7 view settings
|
||||
bind common = vol +10%
|
||||
bind common ? search-b-start
|
||||
bind common C toggle continue
|
||||
bind common D win-remove
|
||||
bind common E win-add-Q
|
||||
bind common F push filter
|
||||
bind common G win-bottom
|
||||
bind common I echo {}
|
||||
bind common L push live-filter
|
||||
bind common M toggle play_library
|
||||
bind common N search-prev
|
||||
bind common P win-mv-before
|
||||
bind common U win-update-cache
|
||||
bind common [ vol +1% +0
|
||||
bind common ] vol +0 +1%
|
||||
bind common ^B win-page-up
|
||||
bind common ^C echo Type :quit<enter> to exit cmus.
|
||||
bind common ^D win-half-page-down
|
||||
bind common ^E win-scroll-down
|
||||
bind common ^F win-page-down
|
||||
bind common ^L refresh
|
||||
bind common ^R toggle repeat_current
|
||||
bind common ^U win-half-page-up
|
||||
bind common ^Y win-scroll-up
|
||||
bind common a win-add-l
|
||||
bind common b player-next
|
||||
bind common c player-pause
|
||||
bind common delete win-remove
|
||||
bind common down win-down
|
||||
bind common e win-add-q
|
||||
bind common end win-bottom
|
||||
bind common enter win-activate
|
||||
bind common f toggle follow
|
||||
bind common g win-top
|
||||
bind common h seek -5
|
||||
bind common home win-top
|
||||
bind common i win-sel-cur
|
||||
bind common j win-down
|
||||
bind common k win-up
|
||||
bind common l seek +5
|
||||
bind common left seek -5
|
||||
bind common m toggle aaa_mode
|
||||
bind common mlb_click_selected win-activate
|
||||
bind common mouse_scroll_down win-down
|
||||
bind common mouse_scroll_up win-up
|
||||
bind common n search-next
|
||||
bind common o toggle play_sorted
|
||||
bind common p win-mv-after
|
||||
bind common page_down win-page-down
|
||||
bind common page_up win-page-up
|
||||
bind common q quit -i
|
||||
bind common r toggle repeat
|
||||
bind common right seek +5
|
||||
bind common s toggle shuffle
|
||||
bind common space win-toggle
|
||||
bind common t toggle show_remaining_time
|
||||
bind common tab win-next
|
||||
bind common u update-cache
|
||||
bind common up win-up
|
||||
bind common v player-stop
|
||||
bind common x player-play
|
||||
bind common y win-add-p
|
||||
bind common z player-prev
|
||||
bind common { vol -1% -0
|
||||
bind common } vol -0 -1%
|
||||
fset 90s=date>=1990&date<2000
|
||||
fset classical=genre="Classical"
|
||||
fset missing-tag=!stream&(artist=""|album=""|title=""|tracknumber=-1|date=-1)
|
||||
fset mp3=filename="*.mp3"
|
||||
fset ogg=filename="*.ogg"
|
||||
fset ogg-or-mp3=ogg|mp3
|
||||
fset unheard=play_count=0
|
||||
factivate
|
Binary file not shown.
|
@ -1,35 +0,0 @@
|
|||
q
|
||||
view
|
||||
clear
|
||||
player-next
|
||||
pl
|
||||
filter
|
||||
toggle shuffle
|
||||
shuffle
|
||||
add ~/Music/music/
|
||||
player-pause-playback
|
||||
bind common <key> player-pause-playback
|
||||
clear
|
||||
player-stop
|
||||
player-next
|
||||
player-stop
|
||||
player-play
|
||||
bind common <key> add
|
||||
bind common <key> bindk
|
||||
player-play
|
||||
add The Best of Beethoven (152kbit_Opus).ogg
|
||||
filter The
|
||||
win-add-Q
|
||||
win-add-Q
|
||||
help
|
||||
source The Best of Beethoven (152kbit_Opus).ogg
|
||||
clean
|
||||
live-filter L
|
||||
live-filter L
|
||||
live-filter
|
||||
delete
|
||||
refr
|
||||
start
|
||||
set passwd=venirapormi
|
||||
set passwd=@
|
||||
set passwd=1234
|
|
@ -1,531 +0,0 @@
|
|||
/home/initega/Music/music/26 - Gioacchino Rossini - Guillaume Tell (1829) - Galop (Chailly).mp3
|
||||
/home/initega/Music/music/Abba - Dancing Queen.mp3
|
||||
/home/initega/Music/music/ACDC - Back In Black.mp3
|
||||
/home/initega/Music/music/ACDC - Highway to Hell.mp3
|
||||
/home/initega/Music/music/ACDC - Thunderstruck.mp3
|
||||
/home/initega/Music/music/A Fearsome Foe (HQ) - Dragon Ball Super _ Norihito Sumitomo-aOajeHAZpQg.opus
|
||||
/home/initega/Music/music/A Ha - Take On Me REMO Radio Edit Music Official.mp3
|
||||
/home/initega/Music/music/Alessia Cara - How Far Ill Go (Official Video).mp3
|
||||
/home/initega/Music/music/[AMV] Tribute To Dagon Ball Z_GT (Goku's Story) Dan Dan Kokoro Hikareteku - Soundtrack【HD 720p】-UNas6o7CdX8.opus
|
||||
/home/initega/Music/music/A Secret Plan with Ones Life on the Line - Dragon Ball Super _ Norihito Sumitomo-RcM7h8peXYU.opus
|
||||
/home/initega/Music/music/Athletic Theme - New Super Mario Bros. (160kbit_Opus).ogg
|
||||
/home/initega/Music/music/Avengers Suite (Theme)-FOabQZHT4qY.ogg
|
||||
/home/initega/Music/music/Ay ho cavar, cavar - Profesores OT.mp3
|
||||
/home/initega/Music/music/Beverly Hills cop.mp3
|
||||
/home/initega/Music/music/BGM M1216-IeBElS3jz-0.ogg
|
||||
/home/initega/Music/music/Biggie Smalls feat. Thomas the Tank Engine.mp3
|
||||
/home/initega/Music/music/Bill Haley & His Comets- Rock Around The Clock (152kbit_Opus).ogg
|
||||
/home/initega/Music/music/Billy Joel - Uptown Girl.mp3
|
||||
/home/initega/Music/music/Bobby McFerrin - Don't Worry Be Happy.mp3
|
||||
/home/initega/Music/music/Boney M - Rasputin (Bassflow 4.0 Mix) - Fast.mp3
|
||||
/home/initega/Music/music/BSO Tiburon.mp3
|
||||
/home/initega/Music/music/cancion La banda del patio.mp3
|
||||
/home/initega/Music/music/Castle Theme - New Super Mario Bros. (152kbit_Opus).ogg
|
||||
/home/initega/Music/music/Celine Dion- My Heart Will Go On (Banda sonora de la pelicula Titanic).mp3
|
||||
/home/initega/Music/music/Chicco - Modjadji.mp3
|
||||
/home/initega/Music/music/Chicken Techno by Oli Chang.mp3
|
||||
/home/initega/Music/music/Christmas Carols - The Nutcracker.mp3
|
||||
/home/initega/Music/music/Coldplay - Viva La Vida.mp3
|
||||
/home/initega/Music/music/Colonna Sonora Mission Impossible.mp3
|
||||
/home/initega/Music/music/Community Collab - DeLUX Jam (LuxMix).mp3
|
||||
/home/initega/Music/music/Cyndi Lauper - Girls Just Want To Have Fun.mp3
|
||||
/home/initega/Music/music/David Guetta - Dangerous (Lyric Video) ft Sam Martin.mp3
|
||||
/home/initega/Music/music/David Guetta - Hey Mama (Official Video) ft Nicki Minaj, Bebe Rexha & Afrojack.mp3
|
||||
/home/initega/Music/music/[DBZ full OST] Ma ni Ae!! Nanatsu No Doragon Bōru (reach the seven dragon balls in time!!)-VatdUmXsrBw.ogg
|
||||
/home/initega/Music/music/Denzel Curry - ULTIMATE.mp3
|
||||
/home/initega/Music/music/Depeche Mode - Just Can't Get Enough (Remastered Video).mp3
|
||||
/home/initega/Music/music/Desert Overworld - New Super Mario Bros. (160kbit_Opus).ogg
|
||||
/home/initega/Music/music/Die Woodys - Fichtls Lied.mp3
|
||||
/home/initega/Music/music/♪ Diggy Diggy Hole-ytWz0qVvBZ0.ogg
|
||||
/home/initega/Music/music/Dragon Ball GT _ BGM #11-XNIBIwNDYu4.ogg
|
||||
/home/initega/Music/music/Dragon Ball GT _ BGM #38-9-161mMSFg0.ogg
|
||||
/home/initega/Music/music/Dragon Ball GT Genkidama Soundtrack-xkcUFEfbrQc.opus
|
||||
/home/initega/Music/music/Dragon Ball GT - Soundtrack Baby 2-B6nYFWI0FeY.opus
|
||||
/home/initega/Music/music/Dragon Ball GT - Soundtrack Baby-m5m6FSpRRHQ.ogg
|
||||
/home/initega/Music/music/Dragon Ball OST CD5 Gekitotsu!! 100 Oku Powaa No-3FiRVax2XNU.ogg
|
||||
/home/initega/Music/music/Dragon ball sondtrack 19-fR9u1EcB3Dk.ogg
|
||||
/home/initega/Music/music/Dragon ball soundtrack 10-O3YtxNvQdJ4.ogg
|
||||
/home/initega/Music/music/Dragon ball soundtrack 11-w4eCI2_imso.ogg
|
||||
/home/initega/Music/music/Dragon ball soundtrack 12-Apf249LjPg8.ogg
|
||||
/home/initega/Music/music/Dragon ball soundtrack 13-Ke8-rChRvec.ogg
|
||||
/home/initega/Music/music/Dragon ball soundtrack 14-7x5PfS3PyQI.ogg
|
||||
/home/initega/Music/music/Dragon ball soundtrack 1-4mjzugW81i0.opus
|
||||
/home/initega/Music/music/Dragon ball soundtrack 15-F8wOe1W2PQU.ogg
|
||||
/home/initega/Music/music/Dragon ball soundtrack 16-ulVTfdbIoLY.ogg
|
||||
/home/initega/Music/music/Dragon ball soundtrack 17-dxNCa7e3BIE.ogg
|
||||
/home/initega/Music/music/Dragon ball soundtrack 20-YX5jNg88B8U.opus
|
||||
/home/initega/Music/music/Dragon ball soundtrack 21-LN4Td8npjRI.ogg
|
||||
/home/initega/Music/music/Dragon ball soundtrack 22-GJwNiRAhZTo.ogg
|
||||
/home/initega/Music/music/Dragon ball soundtrack 23.-2ipws67QbXs.ogg
|
||||
/home/initega/Music/music/Dragon ball soundtrack 24-WjGqbx6R9s8.opus
|
||||
/home/initega/Music/music/Dragon ball soundtrack 25-4Sn0LMdjXgU.ogg
|
||||
/home/initega/Music/music/Dragon ball soundtrack 26-LAyR30MRL3c.ogg
|
||||
/home/initega/Music/music/Dragon ball soundtrack 27-HH1d_1JvF-4.ogg
|
||||
/home/initega/Music/music/Dragon ball soundtrack 2-AMgzYLOGOX4.opus
|
||||
/home/initega/Music/music/Dragon ball soundtrack 3-ZeaD71fISVs.opus
|
||||
/home/initega/Music/music/Dragon ball soundtrack 4-6995upmiavg.opus
|
||||
/home/initega/Music/music/Dragon ball soundtrack 5-MzNeFUMQZ5E.opus
|
||||
/home/initega/Music/music/dragon ball soundtrack 6-nLtKocLdLDQ.opus
|
||||
/home/initega/Music/music/Dragon ball soundtrack 7-3_hFpr3FvuI.opus
|
||||
/home/initega/Music/music/Dragon ball soundtrack 8-QOXefULKY-4.ogg
|
||||
/home/initega/Music/music/Dragon ball soundtrack 9-2oEf6kkvBaU.ogg
|
||||
/home/initega/Music/music/Dragon ball sountrack 18-RIEpJp5oPFw.ogg
|
||||
/home/initega/Music/music/Dragon Ball Super - Limit Break x Survivor (Instrumental Type B) Original Soundtrack-bfxU3uPhdxE.opus
|
||||
/home/initega/Music/music/Dragon Ball Super OST 2- Limit-Break x Survivor (Instrumental Type A)-Y7G6Wf_AAbg.ogg
|
||||
/home/initega/Music/music/Dragon Ball Super OST - Dream Tag Match (Original CD) [HD]-aFee61209rk.ogg
|
||||
/home/initega/Music/music/Dragon Ball Super OST - Jiren's Tremendous Power (Original CD)-vlOsP4N8iso.opus
|
||||
/home/initega/Music/music/Dragon Ball Super OST - Limit-Break x Survivor (Instrumental Type C)-5mqT164tdg4.ogg
|
||||
/home/initega/Music/music/Dragon Ball Super OST - Official Clash Of Gods_The Final Death-Match-kfIl70TPX28.ogg
|
||||
/home/initega/Music/music/Dragon Ball Super OST - Our Hero, Son Goku-xprx15VfzO4.ogg
|
||||
/home/initega/Music/music/Dragon Ball Z BGM - M1311 'Goku Moves In To Tear Off Coola's Arm'-3dFJz7kmNK8.ogg
|
||||
/home/initega/Music/music/Dragon Ball Z BGM - M711 'Piccolo's Bell Theme'-5IDz1plBfoQ.ogg
|
||||
/home/initega/Music/music/DRAGON BALL Z OST 1 SHI WO YOBU CELL GAMES-o86oEGyNqpA.opus
|
||||
/home/initega/Music/music/DRAGON BALL Z OST 5 KYOUFU NO GINYU TOKUSENTAI-O95Tx_6wMjQ.ogg
|
||||
/home/initega/Music/music/Dragon Ball Z OST BGM M-1405-889loGD1ThA.opus
|
||||
/home/initega/Music/music/Dragon Ball Z - Seigi wo aisuru mono! - Theme-V8E3howh4tk.opus
|
||||
/home/initega/Music/music/Dragon Ball Z Soundtrack - M1308-gPVbyykGZBw.ogg
|
||||
/home/initega/Music/music/Dragon Ball Z Soundtrack - M1522-2MWlrcsimt4.ogg
|
||||
/home/initega/Music/music/Dragon Ball Z Soundtrack - M1711-DhKOLm5l47k.ogg
|
||||
/home/initega/Music/music/Dragon Ball Z Soundtrack - M710-gYLtsuamk_E.ogg
|
||||
/home/initega/Music/music/Dragon Ball Z Soundtrack - M727-TCkYe5ZZSFM.ogg
|
||||
/home/initega/Music/music/Dragon Ball Z Soundtrack - M737-1ss6n0fnZSg.ogg
|
||||
/home/initega/Music/music/Dragon Ball Z Soundtrack - M740-KQkJ7iAZHZ8.ogg
|
||||
/home/initega/Music/music/Dragon Ball Z Soundtrack - M741-yfxcy2lXYiM.ogg
|
||||
/home/initega/Music/music/Dragon Ball Z Soundtrack - M811-QY1h1ZLUlBI.ogg
|
||||
/home/initega/Music/music/Dr_Dre_-_Still_DRE_ft_Snoop_Dogg[www.MP3Fiber.com].mp3
|
||||
/home/initega/Music/music/Dr_Dre_-_The_Next_Episode_ft_Snoop_Dogg_Kurupt_Nate_Dogg[www.MP3Fiber.com].mp3
|
||||
/home/initega/Music/music/Dwayne Johnson - Youre Welcome (From Moana).mp3
|
||||
/home/initega/Music/music/Edith Piaf - Non Je ne regrette rien.mp3
|
||||
/home/initega/Music/music/Eiffel 65 - Blue (Da Ba Dee) [Gabry Ponte Ice Pop Mix] (Original Video with subtitles) (152kbit_Opus).ogg
|
||||
/home/initega/Music/music/El libro de la selva- Busca lo más vital.mp3
|
||||
/home/initega/Music/music/El Rey León 3 - Elogiemos al gran Timón.mp3
|
||||
/home/initega/Music/music/el rey leon 3 suricatos cava un tunel.mp3
|
||||
/home/initega/Music/music/El Rey León - Hakuna Matata [ES-España] [HD].mp3
|
||||
/home/initega/Music/music/El vuelo del moscardón - NICOLÁS RIMSKY-KÓRSAKOV - Piano.mp3
|
||||
/home/initega/Music/music/Eminem - Rap God (Explicit).mp3
|
||||
/home/initega/Music/music/Eminem - Till I Collapse [HD].mp3
|
||||
/home/initega/Music/music/Entry Of The Gladiators - Julius Fucik (152kbit_Opus).ogg
|
||||
/home/initega/Music/music/Epic Sax Guy [Original] HD.mp3
|
||||
/home/initega/Music/music/Eskutitza. HEMENDIK AT!.mp3
|
||||
/home/initega/Music/music/E.T. Soundtrack.mp3
|
||||
/home/initega/Music/music/Eurythmics - Sweet Dreams (Are Made Of This).mp3
|
||||
/home/initega/Music/music/Fernando Esteso - La Ramona (128kbit_Opus).ogg
|
||||
/home/initega/Music/music/Fierce Battle Against A Mighty Foe (HQ) - Dragon Ball Super _ Norihito Sumitomo-vH65j2kwR2U.opus
|
||||
/home/initega/Music/music/Fleur East - Sax (Official Video).mp3
|
||||
/home/initega/Music/music/Franzl Lang - Einen Jodler hör i gern.mp3
|
||||
/home/initega/Music/music/George Michael - Careless Whisper (Lyrics).mp3
|
||||
/home/initega/Music/music/George Michael - Careless Whisper.mp3
|
||||
/home/initega/Music/music/Georges Bizet - Carmen Suite # 1- Les Toreadors.mp3
|
||||
/home/initega/Music/music/George Thorogood & The Destroyers - Bad to the Bone (With Lyrics).mp3
|
||||
/home/initega/Music/music/Greatest Battle Music Of All Times - Luffy Moukou (Extended version)-xUeaLmNDpG8.ogg
|
||||
/home/initega/Music/music/드래곤볼 GT 마지막 엔딩(OST Edit) - Dan Dan Kokoro Hikareteku(Last Ending)-o6Mt4DKX8fI.ogg
|
||||
/home/initega/Music/music/드래곤볼 GT 마지막 엔딩(OST Edit) - Dan Dan Kokoro Hikareteku(Last Ending)-o6Mt4DKX8fI.opus
|
||||
/home/initega/Music/music/Guns N' Roses - Sweet Child O' Mine.mp3
|
||||
/home/initega/Music/music/Gunther - Ding Dong Song Gunther Video (You Touch My Tralala).mp3
|
||||
/home/initega/Music/music/Hatsune Miku - Ievan Polkka (HD).mp3
|
||||
/home/initega/Music/music/Hawaii Five-O - Theme Song [Full Version] (152kbit_Vorbis).ogg
|
||||
/home/initega/Music/music/[HD] Passionate Duelist Theme - Yu-Gi-Oh! [Extended]-b7t6rZUZmfE.ogg
|
||||
/home/initega/Music/music/He's a pirate - orchestra.mp3
|
||||
/home/initega/Music/music/HEYYEYAAEYAAAEYAEYAA.mp3
|
||||
/home/initega/Music/music/ikusi mendizaleak - OSKORRI.mp3
|
||||
/home/initega/Music/music/Imagine Dragons - On Top Of The World.mp3
|
||||
/home/initega/Music/music/Im Shipping Up To Boston - Dropkick Murphys.mp3
|
||||
/home/initega/Music/music/incredibles theme song (152kbit_Opus).ogg
|
||||
/home/initega/Music/music/In the Hall of the Mountain King (Peer Gynt) by Edvard Grieg.mp3
|
||||
/home/initega/Music/music/Itsasontzi baten (Kaxiano) Gaurkotua.mp3
|
||||
/home/initega/Music/music/I Will Survive.mp3
|
||||
/home/initega/Music/music/Jason Derulo - Get Ugly (Official Music Video).mp3
|
||||
/home/initega/Music/music/Jason Derulo - Talk Dirty feat. 2 Chainz (Official HD Music Video).mp3
|
||||
/home/initega/Music/music/Jason Derulo - Want To Want Me (Official Video).mp3
|
||||
/home/initega/Music/music/Jason Derulo - Whatcha Say (Video).mp3
|
||||
/home/initega/Music/music/Jason Derulo - Wiggle feat. Snoop Dogg (Official HD Music Video).mp3
|
||||
/home/initega/Music/music/John Lennon - Imagine HD.mp3
|
||||
/home/initega/Music/music/Jurassic Park theme song..mp3
|
||||
/home/initega/Music/music/K-391 - Everybody [NCS Release].mp3
|
||||
/home/initega/Music/music/Katrina & The Waves - Walking On Sunshine.mp3
|
||||
/home/initega/Music/music/Kill Bill soundtrack Twisted Nerve.mp3
|
||||
/home/initega/Music/music/Konosuba_2_-_Red_Battle_Megumin_vs_Yunyun_RAP_BATTLE_ENG_SUB_improved_ver[www.MP3Fiber.com].mp3
|
||||
/home/initega/Music/music/Kool The Gang - Celebration.mp3
|
||||
/home/initega/Music/music/Kyodai Yôsai, Hasshin One Piece OST-6PJH71GjBcc.opus
|
||||
/home/initega/Music/music/La sirenita - Bajo el mar (español de españa).mp3
|
||||
/home/initega/Music/music/Lau teilatu (Itoiz).mp3
|
||||
/home/initega/Music/music/Lazy Town We are Number One Music Video.mp3
|
||||
/home/initega/Music/music/Lipps Inc_ - Funky Town [HD] 1979.mp3
|
||||
/home/initega/Music/music/Mark Ronson - Uptown Funk ft. Bruno Mars.mp3
|
||||
/home/initega/Music/music/Martin Garrix & Bebe Rexha - In The Name Of Love.mp3
|
||||
/home/initega/Music/music/Martin Solveig & GTA - Intoxicated [Offical].mp3
|
||||
/home/initega/Music/music/MC Hammer - U Can-'t Touch This.mp3
|
||||
/home/initega/Music/music/Meme Song (The March of the Troll Face).mp3
|
||||
/home/initega/Music/music/Michael Jackson - Smooth Criminal (Michael Jackson's Vision).mp3
|
||||
/home/initega/Music/music/Michael Myers Theme Song (152kbit_Opus).ogg
|
||||
/home/initega/Music/music/Mission Impossible Theme(full theme).mp3
|
||||
/home/initega/Music/music/Mitch Miller - The River Kwai March - Colonel Bogey March.mp3
|
||||
/home/initega/Music/music/Monsters Inc theme (full) (152kbit_Opus).ogg
|
||||
/home/initega/Music/music/Mugiwara Kaizokudan, Hangeki Kaishi One Piece OST-KuZwthMXadM.ogg
|
||||
/home/initega/Music/music/Mugiwara Kaizokudan, Hangeki Kaishi One Piece OST-KuZwthMXadM.opus
|
||||
/home/initega/Music/music/Naruto OST 1 - Bad Situation (152kbit_Opus).ogg
|
||||
/home/initega/Music/music/Naruto OST 1 - Glued State (152kbit_Opus).ogg
|
||||
/home/initega/Music/music/Naruto OST - Grief And Sorrow (152kbit_Opus).ogg
|
||||
/home/initega/Music/music/Naruto Shippuden OST Original Soundtrack 03 - Homecoming (152kbit_Vorbis).ogg
|
||||
/home/initega/Music/music/Naruto Shippuden OST Original Soundtrack 04 - Experienced Many Battles (152kbit_Vorbis).ogg
|
||||
/home/initega/Music/music/Naruto Shippuuden Sountrack (Man of the world) (152kbit_Opus).ogg
|
||||
/home/initega/Music/music/Naruto Soundtrack - Heavy Violence. (152kbit_Opus).ogg
|
||||
/home/initega/Music/music/Nere herriko neskatxa maite karaokean.mp3
|
||||
/home/initega/Music/music/Nightcore - Mi Mi Mi.mp3
|
||||
/home/initega/Music/music/NOMA - Brain Power.mp3
|
||||
/home/initega/Music/music/Nyan Cat [original].mp3
|
||||
/home/initega/Music/music/Oasis - Wonderwall.mp3
|
||||
/home/initega/Music/music/OFFICIAL Somewhere over the Rainbow - Israel IZ Kamakawiwo-ole.mp3
|
||||
/home/initega/Music/music/Oliver y Benji (Campeones) Canción Completa [Español].mp3
|
||||
/home/initega/Music/music/One Piece - Karakuri Defense System, Deploy [Long Edit]-Gn5idEi7gtc.opus
|
||||
/home/initega/Music/music/One Piece - Lets Battle [Extended Version]-UBiAA6BMxbU.ogg
|
||||
/home/initega/Music/music/One Piece Luffy Vs Ratchet Round 1 Extended-3P7Ee85Z32Y.ogg
|
||||
/home/initega/Music/music/One Piece Original SoundTrack - After Eating,Grand Line!--n5f9jLqfGg.opus
|
||||
/home/initega/Music/music/One Piece Original SoundTrack - Difficult-nMbTTpcvEcw.opus
|
||||
/home/initega/Music/music/One Piece Original Soundtrack Three Towers Movie 5 Extended [HQ]-vas_vlDjkMk.ogg
|
||||
/home/initega/Music/music/One Piece OST (21) - Sakusenkaishi ~ Osowareru mura ~-4ANaEsE5bdI.opus
|
||||
/home/initega/Music/music/One Piece Ost - Desperate Situation-6s-Icke6F8M.ogg
|
||||
/home/initega/Music/music/One Piece OST - Pirate 2-ZwIY5i_T2es.opus
|
||||
/home/initega/Music/music/One Piece OST - The Fight Continues-F30A4RrNgDs.ogg
|
||||
/home/initega/Music/music/One Piece OST - The Very Very Very Strongest [extended]-4J7K3yacig4.opus
|
||||
/home/initega/Music/music/One Piece - Overtaken 720p HD-8A-q3TM8kPk.opus
|
||||
/home/initega/Music/music/One Piece Soundtrack - Giant Stronghold, Takeoff!-0Y3tmKzNDks.opus
|
||||
/home/initega/Music/music/One Piece Soundtrack - I'm becoming the Pirate King!-4f6fqLOzjnw.opus
|
||||
/home/initega/Music/music/One Piece Soundtrack - Karakuri Castle, Transform-5DOrDKVolfI.opus
|
||||
/home/initega/Music/music/One Piece Soundtrack - To The Grand Line HD-6vsoCQ9j2kg.ogg
|
||||
/home/initega/Music/music/Orchestral Manoeuvres In The Dark - Enola Gay.mp3
|
||||
/home/initega/Music/music/Original GhostBusters Theme Song.mp3
|
||||
/home/initega/Music/music/O.T. Genasis - CoCo [Music Video].mp3
|
||||
/home/initega/Music/music/Overworld Theme - New Super Mario Bros. (152kbit_Vorbis).ogg
|
||||
/home/initega/Music/music/Overworld Theme - Super Mario World (152kbit_Vorbis).ogg
|
||||
/home/initega/Music/music/Panjabi MC - Mundian To Bach Ke (The Dictator Soundtrack).mp3
|
||||
/home/initega/Music/music/PINK GUY - STFU.mp3
|
||||
/home/initega/Music/music/Pitbull - Feel This Moment ft. Christina Aguilera.mp3
|
||||
/home/initega/Music/music/PPAP Pen Pineapple Apple Pen.mp3
|
||||
/home/initega/Music/music/PSY - DADDY(feat. CL of 2NE1) M-V.mp3
|
||||
/home/initega/Music/music/PSY - 나팔바지(NAPAL BAJI) M-V.mp3
|
||||
/home/initega/Music/music/puntaren puntan.mp3
|
||||
/home/initega/Music/music/Queen - -'Another One Bites the Dust-'.mp3
|
||||
/home/initega/Music/music/Queen - 'Bohemian Rhapsody'.mp3
|
||||
/home/initega/Music/music/Queen - 'We Will Rock You'.mp3
|
||||
/home/initega/Music/music/Quiero ser como tú - Academia OT.mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(104).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(112).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(114).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(119).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(121).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(127).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(128).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(159).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(225).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(226).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(227).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(228).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(229).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(232).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(237).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(239).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(240).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(242).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(243).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(244).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(245).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(246).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(247).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(249).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(24).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(250).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(251).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(25).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(270).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(27).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(288).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(289).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(291).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(299).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(307).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(321).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(350).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(35).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(364).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(366).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(367).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(368).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(369).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(36).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(371).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(373).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(374).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(43).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(44).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(452).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(45).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(534).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(535).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(55).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(572).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(576).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(57).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(590).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(592).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(593).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(604).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(605).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(609).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(612).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(616).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(617).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(618).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(626).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(628).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(634).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(635).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(636).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(63).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(643).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(647).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(651).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(655).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(676).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(677).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(68).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(690).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(701).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(705).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(70).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(712).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(717).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(718).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(719).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(72).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(730).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(73).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(749).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(75).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(76).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(774).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(77).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(780).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(78).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(79).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(801).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(804).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(80).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(826).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(827).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(829).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(82).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(84).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(851).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(853).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(856).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(863).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(86).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(872).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(876).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(884).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(897).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(913).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(923).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(926).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(934).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(942).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(96).mp3
|
||||
/home/initega/Music/music/Rick Astley - Never Gonna Give You Up.mp3
|
||||
/home/initega/Music/music/RISE (ft. The Glitch Mob, Mako, and The Word Alive) _ Worlds 2018 - League of Legends (128kbit_Vorbis).ogg
|
||||
/home/initega/Music/music/Running_in_the_90s[www.MP3Fiber.com].mp3
|
||||
/home/initega/Music/music/Sabre Dance - Aram Khachaturian.mp3
|
||||
/home/initega/Music/music/Shikamaru Theme Song (152kbit_Opus).ogg
|
||||
/home/initega/Music/music/Shi o Yobu Seru Gêmu The Cell Game Which Calls Forth Death part 3-mpwYsRsw5vI.ogg
|
||||
/home/initega/Music/music/Shunsuke Kikuchi - M1525 (Dragon Ball Z OST)-w0ZTP0AB768.opus
|
||||
/home/initega/Music/music/Smash Mouth - All Star.mp3
|
||||
/home/initega/Music/music/Smash Mouth - I'm A Believer.mp3
|
||||
/home/initega/Music/music/Snoop Dogg Smoke weed every day (dubstep remix).mp3
|
||||
/home/initega/Music/music/SOUNDTRACK DE LA VIDA ES BELLA.mp3
|
||||
/home/initega/Music/music/Stand By Me, Ben E King, 1961 (152kbit_Opus).ogg
|
||||
/home/initega/Music/music/Stereo Sayan 3D.mp3
|
||||
/home/initega/Music/music/Stranger_Things_Theme_Song_C418_REMIX[www.MP3Fiber.com].mp3
|
||||
/home/initega/Music/music/Superman Theme.mp3
|
||||
/home/initega/Music/music/Takeo Ischi - New Bibi Hendl (Chicken Yodeling) 2011.mp3
|
||||
/home/initega/Music/music/The_Addams_Family_1991_Suite[www.MP3Fiber.com].mp3
|
||||
/home/initega/Music/music/The A-Team Full Theme Tune.mp3
|
||||
/home/initega/Music/music/The Batman Theme Song.mp3
|
||||
/home/initega/Music/music/The Beatles - Hello, Goodbye.mp3
|
||||
/home/initega/Music/music/The Beatles - Here Comes The Sun (Lyrics).mp3
|
||||
/home/initega/Music/music/TheFatRat - Infinite Power!.mp3
|
||||
/home/initega/Music/music/The Great Escape - Elmer Bernstein.mp3
|
||||
/home/initega/Music/music/The Ninja Troll (theme song) ft. KYR SP33DY-A648Tn0pvSk.ogg
|
||||
/home/initega/Music/music/The_Pink_Panther_Theme_Song_Original_Version[www.MP3Fiber.com].mp3
|
||||
/home/initega/Music/music/The Power to Resist - Dragon Ball Super _ Norihito Sumitomo-DSpPFG7RKF4.ogg
|
||||
/home/initega/Music/music/The Power to Resist - Dragon Ball Super _ Norihito Sumitomo-DSpPFG7RKF4.opus
|
||||
/home/initega/Music/music/The_Sound_of_Silence_Original_Version_from_1964[www.MP3Fiber.com].mp3
|
||||
/home/initega/Music/music/The Turtles - Happy Together - 1967.mp3
|
||||
/home/initega/Music/music/The Verve - Bitter Sweet Symphony.mp3
|
||||
/home/initega/Music/music/The_White_Stripes_-_Seven_Nation_Army[www.MP3Fiber.com].mp3
|
||||
/home/initega/Music/music/Those Who Inherit The Will of Fire - Naruto OST 3 (152kbit_Opus).ogg
|
||||
/home/initega/Music/music/Title Theme - New Super Mario Bros. (192kbit_Opus).ogg
|
||||
/home/initega/Music/music/TOY STORY HAY UN AMIGO EN MÍ (CANCIÓN ORIGINAL ESPAÑOL) CON LETRA.mp3
|
||||
/home/initega/Music/music/TROLL SONG TROLL CANCION NO COPYRIGHT.mp3
|
||||
/home/initega/Music/music/Trololo Sing Along!.mp3
|
||||
/home/initega/Music/music/Tunak Tunak Tun Remix - ToDieFor feat. Daler Mehndi - Best of 2016 ft. Daler Mehndi.mp3
|
||||
/home/initega/Music/music/twenty one pilots- Heathens (from Suicide Squad- The Album) [OFFICIAL VIDEO].mp3
|
||||
/home/initega/Music/music/twenty one pilots- Stressed Out [OFFICIAL VIDEO].mp3
|
||||
/home/initega/Music/music/Txoria txori (Mikel Laboa)-.mp3
|
||||
/home/initega/Music/music/Undertale - Megalovania-ZcoqR9Bwx1Y.opus
|
||||
/home/initega/Music/music/Vaiana Videoclip “Qué hay más allá” con María Parrado HD.mp3
|
||||
/home/initega/Music/music/Vince The II - Gates (Trick2g).mp3
|
||||
/home/initega/Music/music/Warriors - 2014 World Championship.mp3
|
||||
/home/initega/Music/music/Weird russian singer - Chum Drum Bedrum.mp3
|
||||
/home/initega/Music/music/Wham! - Wake Me Up Before You Go-Go.mp3
|
||||
/home/initega/Music/music/Worlds 2016- Zedd - Ignite.mp3
|
||||
/home/initega/Music/music/Worlds Collide - 2015 World Championship (ft. Nicki Taylor).mp3
|
||||
/home/initega/Music/music/YMCA - The Village People - Full AD Jhin Edition.mp3
|
||||
/home/initega/Music/music/Yodelling - Franzl Lang.mp3
|
||||
/home/initega/Music/music/You Are a Pirate!.mp3
|
||||
/home/initega/Music/music/zarena zarelako -SUGAN- (remix).mp3
|
||||
/home/initega/Music/music/ТРИ_ПОЛОСКИ_KOLM_TRIIPU_THREE_STRIPES[www.MP3Fiber.com].mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(293).mp3
|
||||
/home/initega/Music/music/Ra Ra RasPutin animation 720 1080 HD Version slocband paceaudio.mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(38).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(39).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(40).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(41).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(48).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(49).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(50).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(51).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(52).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(54).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(56).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(58).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(59).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(60).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(61).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(62).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(286).mp3
|
||||
/home/initega/Music/music/Legends Never Die (ft. Against The Current) [OFFICIAL AUDIO] - Worlds 2017 - League of Legends.mp3
|
||||
/home/initega/Music/music/Naruto OST 1 - Naruto Main Theme.mp3
|
||||
/home/initega/Music/music/Naruto Shippuden OST - Departure To The Front Lines.mp3
|
||||
/home/initega/Music/music/Naruto-Shippuden-Theme.mp3
|
||||
/home/initega/Music/music/Naruto Theme - The Raising Fighting Spirit.mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(91).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(64).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(955).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(162).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(348).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(71).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(292).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(302).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(236).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(304).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(657).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(42).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(46).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(47).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(53).mp3
|
||||
/home/initega/Music/music/Naruto Shippuden OST II - Hyouhaku + Kokuten (128kbit_AAC).ogg
|
||||
/home/initega/Music/music/Naruto - Sadness And Sorrow (Original) (152kbit_AAC).ogg
|
||||
/home/initega/Music/music/TombstoneSpookyScarySkeletonsRemix-Final-Extended.mp3
|
||||
/home/initega/Music/music/Naruto Shippuden Opening 16 (192kbit_AAC).ogg
|
||||
/home/initega/Music/music/Naruto Shippuden Opening 17 (192kbit_AAC).ogg
|
||||
/home/initega/Music/music/Naruto Shippuden Opening 19 V3 (English Sub) (192kbit_AAC).ogg
|
||||
/home/initega/Music/music/Aqua Barbie girl.mp3
|
||||
/home/initega/Music/music/Pokémon Theme Song (128kbit_AAC).ogg
|
||||
/home/initega/Music/music/Naruto Shippuden Emergence Of Talents_Hyakkaryouran Extended (128kbit_AAC).ogg
|
||||
/home/initega/Music/music/They're Taking The Hobbits To Isengard - High Definition Remake (192kbit_AAC).ogg
|
||||
/home/initega/Music/music/Intro Johnny Test Disney Channel España (128kbit_AAC).ogg
|
||||
/home/initega/Music/music/Naruto Shippuden Blood Prison OST - 12 - Gold-Brocaded Damask (128kbit_AAC).ogg
|
||||
/home/initega/Music/music/Naruto Shippuden OST 1 - Track 02 - Douten ( Heaven Shaking Event ) (128kbit_AAC).ogg
|
||||
/home/initega/Music/music/Naruto Shippuden OST 1 - Track 05 - Denkousekka ( Lightning Speed ) (128kbit_AAC).ogg
|
||||
/home/initega/Music/music/Naruto Shippuden OST 2 - Track 01 - Shouryuu ( Rising Dragon ) (128kbit_AAC).ogg
|
||||
/home/initega/Music/music/Naruto Shippuden OST 2 - Track 02 - Rinkai ( Critical state ) (128kbit_AAC).ogg
|
||||
/home/initega/Music/music/Naruto Shippuden OST 2 - Track 03 - Gekiha ( Crushing ) (128kbit_AAC).ogg
|
||||
/home/initega/Music/music/Naruto Shippuden OST 2 - Track 13 - Nankou Furaku ( Impregnable ) (128kbit_AAC).ogg
|
||||
/home/initega/Music/music/Naruto Shippuden OST 2 - Track 19 - Himoji ( The Scarlet Letter ) (128kbit_AAC).ogg
|
||||
/home/initega/Music/music/Recoverd_mp3_file(650).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(1087).mp3
|
||||
/home/initega/Music/music/Mulan _ I'll Make A Man Out Of You _ Disney Sing-Along (192kbit_AAC).ogg
|
||||
/home/initega/Music/music/Recoverd_mp3_file(262).mp3
|
||||
/home/initega/Music/music/Naruto OST - Kakuzu Theme (128kbit_AAC).ogg
|
||||
/home/initega/Music/music/Enya - Only Time (Official Music Video).mp3
|
||||
/home/initega/Music/music/ERA-Ameno.mp3
|
||||
/home/initega/Music/music/AUTOBUS MAGIKOA Openinga EUSKARAZ (128kbit_AAC).ogg
|
||||
/home/initega/Music/music/Super Mario Remix (128kbit_AAC).ogg
|
||||
/home/initega/Music/music/Sonic Lost World OST[Without Boundaries] - Honeycomb Highway[HQ] (192kbit_AAC).ogg
|
||||
/home/initega/Music/music/Txanogorritxo (Hemendik at) (128kbit_AAC).ogg
|
||||
/home/initega/Music/music/Gatibu - Bixotza suten (192kbit_AAC).ogg
|
||||
/home/initega/Music/music/Pokemon Go (Goblins from Mars Trap Remix) [Launchpad Cover] (192kbit_AAC).ogg
|
||||
/home/initega/Music/music/Naruto Shippuden - Opening 3 (Sub-español) (192kbit_AAC).ogg
|
||||
/home/initega/Music/music/Recoverd_mp3_file(231).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(66).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(583).mp3
|
||||
/home/initega/Music/music/Hawaiian Roller Coaster Ride - Nightcore (192kbit_AAC).ogg
|
||||
/home/initega/Music/music/The Coconut Song - (Da Coconut Nut) (128kbit_AAC).ogg
|
||||
/home/initega/Music/music/Recoverd_mp3_file(354).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(160).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(161).mp3
|
||||
/home/initega/Music/music/Naruto shikamaru theme (128kbit_AAC).ogg
|
||||
/home/initega/Music/music/Status Quo_ Whatever you want (128kbit_AAC).ogg
|
||||
/home/initega/Music/music/Naruto Opening 2 (192kbit_AAC).ogg
|
||||
/home/initega/Music/music/Pokemon GO - Map Theme Remix - _Walkin'_ (KyleAB5000) (192kbit_AAC).ogg
|
||||
/home/initega/Music/music/Danny McCarthy - Silver Scrapes (Dubstep).mp3
|
||||
/home/initega/Music/music/Naruto Shippuden opening 1 - Hero's Come Back - Nobodyknows (128kbit_AAC).ogg
|
||||
/home/initega/Music/music/Mark Van Dale with Enrico - Water Wave (DJ Quicksilver Radio Mix) (152kbit_AAC).ogg
|
||||
/home/initega/Music/music/LFZ-Echoes_NCS_Release.mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(94).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(23).mp3
|
||||
/home/initega/Music/music/Beautiful Green Wild Beast - Naruto OST 3 (128kbit_AAC).ogg
|
||||
/home/initega/Music/music/Hero - Naruto OST 3 (128kbit_AAC).ogg
|
||||
/home/initega/Music/music/Naruto Shippuden OST Original Soundtrack 13 - Loneliness (128kbit_AAC).ogg
|
||||
/home/initega/Music/music/When U Remix Pokemon Go (LIVE MASHUP) Mashd N Kutcher (192kbit_AAC).ogg
|
||||
/home/initega/Music/music/Recoverd_mp3_file(358).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(359).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(163).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(92).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(95).mp3
|
||||
/home/initega/Music/music/Manuel - Gas Gas Gas (192kbit_AAC).ogg
|
||||
/home/initega/Music/music/Naruto Shippuuden OST 2 - Narukami - Screaming god [Full HD] (192kbit_AAC).ogg
|
||||
/home/initega/Music/music/Naruto Unreleased - Break down _ MINATO vs Tobi [HD] (192kbit_AAC).ogg
|
||||
/home/initega/Music/music/Recoverd_mp3_file(37).mp3
|
||||
/home/initega/Music/music/Naruto Shippuden OP10 NC (192kbit_AAC).ogg
|
||||
/home/initega/Music/music/Naruto Shippuden OP4v2 NC (192kbit_AAC).ogg
|
||||
/home/initega/Music/music/Naruto Shippuden OP6 NC (192kbit_AAC).ogg
|
||||
/home/initega/Music/music/Naruto Shippuden OST - Reverse situation (128kbit_AAC).ogg
|
||||
/home/initega/Music/music/Naruto OST 1 - Go Go Naruto! (128kbit_AAC).ogg
|
||||
/home/initega/Music/music/Naruto OST 1 - I Said Im Naruto (128kbit_AAC).ogg
|
||||
/home/initega/Music/music/Naruto OST 1 - Need To Be Strong (128kbit_AAC).ogg
|
||||
/home/initega/Music/music/Naruto OST 1 - Strong and Strike (128kbit_AAC).ogg
|
||||
/home/initega/Music/music/Naruto OST 1 - Turn Over (128kbit_AAC).ogg
|
||||
/home/initega/Music/music/Naruto OST 1 - Victory (128kbit_AAC).ogg
|
||||
/home/initega/Music/music/Recoverd_mp3_file(888).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(656).mp3
|
||||
/home/initega/Music/music/Initial D - Deja Vu (192kbit_AAC).ogg
|
||||
/home/initega/Music/music/Recoverd_mp3_file(360).mp3
|
||||
/home/initega/Music/music/Naruto Shippuden OST - The Guts To Never Give Up (152kbit_AAC).ogg
|
||||
/home/initega/Music/music/The Fresh Prince Of Bel Air Theme Song (Full) (128kbit_AAC).ogg
|
||||
/home/initega/Music/music/Recoverd_mp3_file(88).mp3
|
||||
/home/initega/Music/music/Naruto Shippuden OST - Jinchuuriki (128kbit_AAC).ogg
|
||||
/home/initega/Music/music/Naruto Shippuden OST- My Name (192kbit_AAC).ogg
|
||||
/home/initega/Music/music/D1ofaquavibe Monkeybiz (128kbit_AAC).ogg
|
||||
/home/initega/Music/music/Naruto Shippuden Madara Uchiha Theme Six Paths (192kbit_AAC).ogg
|
||||
/home/initega/Music/music/[Naruto Shippuuden OST 2] 21 - Beni Soubi (128kbit_AAC).ogg
|
||||
/home/initega/Music/music/Recoverd_mp3_file(102).mp3
|
||||
/home/initega/Music/music/Naruto-The 5th's Fight Theme (192kbit_AAC).ogg
|
||||
/home/initega/Music/music/Recoverd_mp3_file(562).mp3
|
||||
/home/initega/Music/music/Prokofiev - Peter and the Wolf (128kbit_AAC).ogg
|
||||
/home/initega/Music/music/Naruto Shippuden-Sage Of The Six Paths Death Theme (192kbit_AAC).ogg
|
||||
/home/initega/Music/music/Recoverd_mp3_file(919).mp3
|
||||
/home/initega/Music/music/Naruto Shippuden - Girei (Pain's Theme Song) (192kbit_AAC).ogg
|
||||
/home/initega/Music/music/Recoverd_mp3_file(349).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(353).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(134).mp3
|
||||
/home/initega/Music/music/Super Mario Bros 2_ Overworld Theme (ThisNameIsAFail Remix) (192kbit_AAC).ogg
|
||||
/home/initega/Music/music/Naruto OST - Rock Lee's theme_ Beautiful Green Wild Beast [HD] (192kbit_AAC).ogg
|
||||
/home/initega/Music/music/Recoverd_mp3_file(108).mp3
|
||||
/home/initega/Music/music/Van Halen - Jump (128kbit_AAC).ogg
|
||||
/home/initega/Music/music/Recoverd_mp3_file(103).mp3
|
||||
/home/initega/Music/music/Jiraya Theme Song (128kbit_AAC).ogg
|
||||
/home/initega/Music/music/1aaAlfred Hitchcock Presents TV intro.wmv (96kbit_AAC).ogg
|
||||
/home/initega/Music/music/Italobrothers - Stamp On The Ground (Official HD Video) (128kbit_AAC).ogg
|
||||
/home/initega/Music/music/Recoverd_mp3_file(361).mp3
|
||||
/home/initega/Music/music/Recoverd_mp3_file(351).mp3
|
|
@ -1,5 +0,0 @@
|
|||
/home/initega/The Best of Beethoven (152kbit_Opus).ogg
|
||||
/home/initega/The Best of Beethoven (152kbit_Opus).ogg
|
||||
/home/initega/The Best of Beethoven (152kbit_Opus).ogg
|
||||
/home/initega/The Best of Beethoven (152kbit_Opus).ogg
|
||||
/home/initega/The Best of Beethoven (152kbit_Opus).ogg
|
|
@ -1,12 +0,0 @@
|
|||
home/initega/Music/music
|
||||
c
|
||||
shuffle
|
||||
pause
|
||||
toggle
|
||||
player
|
||||
prev
|
||||
play
|
||||
add
|
||||
view4
|
||||
The
|
||||
win-add-q
|
|
@ -34,11 +34,11 @@ XF86Suspend
|
|||
XF86ScreenSaver
|
||||
xscreensaver-command -lock
|
||||
|
||||
ctrl + j
|
||||
mksh $TSCRIPTS/brightness-software.sh -dec 0.1
|
||||
/* ctrl + j */
|
||||
/* mksh $TSCRIPTS/brightness-software.sh -dec 0.1 */
|
||||
|
||||
ctrl + k
|
||||
mksh $TSCRIPTS/brightness-software.sh -inc 0.1
|
||||
/* ctrl + k */
|
||||
/* mksh $TSCRIPTS/brightness-software.sh -inc 0.1 */
|
||||
|
||||
Print
|
||||
mksh $SCRIPTS/screenshot-screen.sh
|
||||
|
|
10
.vimrc
10
.vimrc
|
@ -20,6 +20,7 @@ Plug 'tiagofumo/vim-nerdtree-syntax-highlight'
|
|||
Plug 'scrooloose/nerdtree'
|
||||
Plug 'hdima/python-syntax'
|
||||
Plug 'mileszs/ack.vim'
|
||||
Plug 'gregsexton/MatchTag'
|
||||
Plug 'xolox/vim-misc'
|
||||
Plug 'xolox/vim-easytags'
|
||||
Plug 'jceb/vim-orgmode'
|
||||
|
@ -112,6 +113,15 @@ command! MakeTags !ctags -R .
|
|||
set t_Co=256
|
||||
let mapleader=","
|
||||
|
||||
|
||||
" Folds
|
||||
set foldlevelstart=1
|
||||
|
||||
" XML/HTML
|
||||
imap <silent> <C-c> </<C-X><C-O><C-X><Esc>xa
|
||||
nmap <silent> <leader>c a</<C-X><C-O><C-X><Esc>x
|
||||
|
||||
|
||||
""Use 24-bit (true-color) mode in Vim/Neovim when outside tmux.
|
||||
""If you're using tmux version 2.2 or later, you can remove the outermost
|
||||
""$TMUX check and use tmux's 24-bit color support
|
||||
|
|
Binary file not shown.
|
@ -0,0 +1,30 @@
|
|||
MIT/X Consortium License
|
||||
|
||||
© 2006-2019 Anselm R Garbe <anselm@garbe.ca>
|
||||
© 2006-2008 Sander van Dijk <a.h.vandijk@gmail.com>
|
||||
© 2006-2007 Michał Janeczek <janeczek@gmail.com>
|
||||
© 2007 Kris Maglione <jg@suckless.org>
|
||||
© 2009 Gottox <gottox@s01.de>
|
||||
© 2009 Markus Schnalke <meillo@marmaro.de>
|
||||
© 2009 Evan Gates <evan.gates@gmail.com>
|
||||
© 2010-2012 Connor Lane Smith <cls@lubutu.com>
|
||||
© 2014-2019 Hiltjo Posthuma <hiltjo@codemadness.org>
|
||||
© 2015-2018 Quentin Rameau <quinq@fifth.space>
|
||||
|
||||
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.
|
|
@ -0,0 +1,64 @@
|
|||
# dmenu - dynamic menu
|
||||
# See LICENSE file for copyright and license details.
|
||||
|
||||
include config.mk
|
||||
|
||||
SRC = drw.c dmenu.c stest.c util.c
|
||||
OBJ = $(SRC:.c=.o)
|
||||
|
||||
all: options dmenu stest
|
||||
|
||||
options:
|
||||
@echo dmenu build options:
|
||||
@echo "CFLAGS = $(CFLAGS)"
|
||||
@echo "LDFLAGS = $(LDFLAGS)"
|
||||
@echo "CC = $(CC)"
|
||||
|
||||
.c.o:
|
||||
$(CC) -c $(CFLAGS) $<
|
||||
|
||||
config.h:
|
||||
cp config.def.h $@
|
||||
|
||||
$(OBJ): arg.h config.h config.mk drw.h
|
||||
|
||||
dmenu: dmenu.o drw.o util.o
|
||||
$(CC) -o $@ dmenu.o drw.o util.o $(LDFLAGS)
|
||||
|
||||
stest: stest.o
|
||||
$(CC) -o $@ stest.o $(LDFLAGS)
|
||||
|
||||
clean:
|
||||
rm -f dmenu stest $(OBJ) dmenu-$(VERSION).tar.gz
|
||||
|
||||
dist: clean
|
||||
mkdir -p dmenu-$(VERSION)
|
||||
cp LICENSE Makefile README arg.h config.def.h config.mk dmenu.1\
|
||||
drw.h util.h dmenu_path dmenu_run stest.1 $(SRC)\
|
||||
dmenu-$(VERSION)
|
||||
tar -cf dmenu-$(VERSION).tar dmenu-$(VERSION)
|
||||
gzip dmenu-$(VERSION).tar
|
||||
rm -rf dmenu-$(VERSION)
|
||||
|
||||
install: all
|
||||
mkdir -p $(DESTDIR)$(PREFIX)/bin
|
||||
cp -f dmenu dmenu_path dmenu_run stest $(DESTDIR)$(PREFIX)/bin
|
||||
chmod 755 $(DESTDIR)$(PREFIX)/bin/dmenu
|
||||
chmod 755 $(DESTDIR)$(PREFIX)/bin/dmenu_path
|
||||
chmod 755 $(DESTDIR)$(PREFIX)/bin/dmenu_run
|
||||
chmod 755 $(DESTDIR)$(PREFIX)/bin/stest
|
||||
mkdir -p $(DESTDIR)$(MANPREFIX)/man1
|
||||
sed "s/VERSION/$(VERSION)/g" < dmenu.1 > $(DESTDIR)$(MANPREFIX)/man1/dmenu.1
|
||||
sed "s/VERSION/$(VERSION)/g" < stest.1 > $(DESTDIR)$(MANPREFIX)/man1/stest.1
|
||||
chmod 644 $(DESTDIR)$(MANPREFIX)/man1/dmenu.1
|
||||
chmod 644 $(DESTDIR)$(MANPREFIX)/man1/stest.1
|
||||
|
||||
uninstall:
|
||||
rm -f $(DESTDIR)$(PREFIX)/bin/dmenu\
|
||||
$(DESTDIR)$(PREFIX)/bin/dmenu_path\
|
||||
$(DESTDIR)$(PREFIX)/bin/dmenu_run\
|
||||
$(DESTDIR)$(PREFIX)/bin/stest\
|
||||
$(DESTDIR)$(MANPREFIX)/man1/dmenu.1\
|
||||
$(DESTDIR)$(MANPREFIX)/man1/stest.1
|
||||
|
||||
.PHONY: all options clean dist install uninstall
|
|
@ -0,0 +1,24 @@
|
|||
dmenu - dynamic menu
|
||||
====================
|
||||
dmenu is an efficient dynamic menu for X.
|
||||
|
||||
|
||||
Requirements
|
||||
------------
|
||||
In order to build dmenu you need the Xlib header files.
|
||||
|
||||
|
||||
Installation
|
||||
------------
|
||||
Edit config.mk to match your local setup (dmenu is installed into
|
||||
the /usr/local namespace by default).
|
||||
|
||||
Afterwards enter the following command to build and install dmenu
|
||||
(if necessary as root):
|
||||
|
||||
make clean install
|
||||
|
||||
|
||||
Running dmenu
|
||||
-------------
|
||||
See the man page for details.
|
|
@ -0,0 +1,49 @@
|
|||
/*
|
||||
* Copy me if you can.
|
||||
* by 20h
|
||||
*/
|
||||
|
||||
#ifndef ARG_H__
|
||||
#define ARG_H__
|
||||
|
||||
extern char *argv0;
|
||||
|
||||
/* use main(int argc, char *argv[]) */
|
||||
#define ARGBEGIN for (argv0 = *argv, argv++, argc--;\
|
||||
argv[0] && argv[0][0] == '-'\
|
||||
&& argv[0][1];\
|
||||
argc--, argv++) {\
|
||||
char argc_;\
|
||||
char **argv_;\
|
||||
int brk_;\
|
||||
if (argv[0][1] == '-' && argv[0][2] == '\0') {\
|
||||
argv++;\
|
||||
argc--;\
|
||||
break;\
|
||||
}\
|
||||
for (brk_ = 0, argv[0]++, argv_ = argv;\
|
||||
argv[0][0] && !brk_;\
|
||||
argv[0]++) {\
|
||||
if (argv_ != argv)\
|
||||
break;\
|
||||
argc_ = argv[0][0];\
|
||||
switch (argc_)
|
||||
|
||||
#define ARGEND }\
|
||||
}
|
||||
|
||||
#define ARGC() argc_
|
||||
|
||||
#define EARGF(x) ((argv[0][1] == '\0' && argv[1] == NULL)?\
|
||||
((x), abort(), (char *)0) :\
|
||||
(brk_ = 1, (argv[0][1] != '\0')?\
|
||||
(&argv[0][1]) :\
|
||||
(argc--, argv++, argv[0])))
|
||||
|
||||
#define ARGF() ((argv[0][1] == '\0' && argv[1] == NULL)?\
|
||||
(char *)0 :\
|
||||
(brk_ = 1, (argv[0][1] != '\0')?\
|
||||
(&argv[0][1]) :\
|
||||
(argc--, argv++, argv[0])))
|
||||
|
||||
#endif
|
|
@ -0,0 +1,24 @@
|
|||
/* See LICENSE file for copyright and license details. */
|
||||
/* Default settings; can be overriden by command line. */
|
||||
|
||||
static int topbar = 1; /* -b option; if 0, dmenu appears at bottom */
|
||||
static int fuzzy = 1; /* -F option; if 0, dmenu doesn't use fuzzy matching */
|
||||
/* -fn option overrides fonts[0]; default X11 font or font set */
|
||||
static const char *fonts[] = {
|
||||
"monospace:size=10"
|
||||
};
|
||||
static const char *prompt = NULL; /* -p option; prompt to the left of input field */
|
||||
static const char *colors[SchemeLast][2] = {
|
||||
/* fg bg */
|
||||
[SchemeNorm] = { "#bbbbbb", "#222222" },
|
||||
[SchemeSel] = { "#eeeeee", "#005577" },
|
||||
[SchemeOut] = { "#000000", "#00ffff" },
|
||||
};
|
||||
/* -l option; if nonzero, dmenu uses vertical list with given number of lines */
|
||||
static unsigned int lines = 0;
|
||||
|
||||
/*
|
||||
* Characters not considered part of a word while deleting words
|
||||
* for example: " /?\"&[]"
|
||||
*/
|
||||
static const char worddelimiters[] = " ";
|
|
@ -0,0 +1,24 @@
|
|||
/* See LICENSE file for copyright and license details. */
|
||||
/* Default settings; can be overriden by command line. */
|
||||
|
||||
static int topbar = 1; /* -b option; if 0, dmenu appears at bottom */
|
||||
static int fuzzy = 1; /* -F option; if 0, dmenu doesn't use fuzzy matching */
|
||||
/* -fn option overrides fonts[0]; default X11 font or font set */
|
||||
static const char *fonts[] = {
|
||||
"monospace:size=10"
|
||||
};
|
||||
static const char *prompt = NULL; /* -p option; prompt to the left of input field */
|
||||
static const char *colors[SchemeLast][2] = {
|
||||
/* fg bg */
|
||||
[SchemeNorm] = { "#bbbbbb", "#222222" },
|
||||
[SchemeSel] = { "#eeeeee", "#005577" },
|
||||
[SchemeOut] = { "#000000", "#00ffff" },
|
||||
};
|
||||
/* -l option; if nonzero, dmenu uses vertical list with given number of lines */
|
||||
static unsigned int lines = 0;
|
||||
|
||||
/*
|
||||
* Characters not considered part of a word while deleting words
|
||||
* for example: " /?\"&[]"
|
||||
*/
|
||||
static const char worddelimiters[] = " ";
|
|
@ -0,0 +1,31 @@
|
|||
# dmenu version
|
||||
VERSION = 4.9
|
||||
|
||||
# paths
|
||||
PREFIX = /usr/local
|
||||
MANPREFIX = $(PREFIX)/share/man
|
||||
|
||||
X11INC = /usr/X11R6/include
|
||||
X11LIB = /usr/X11R6/lib
|
||||
|
||||
# Xinerama, comment if you don't want it
|
||||
XINERAMALIBS = -lXinerama
|
||||
XINERAMAFLAGS = -DXINERAMA
|
||||
|
||||
# freetype
|
||||
FREETYPELIBS = -lfontconfig -lXft
|
||||
FREETYPEINC = /usr/include/freetype2
|
||||
# OpenBSD (uncomment)
|
||||
#FREETYPEINC = $(X11INC)/freetype2
|
||||
|
||||
# includes and libs
|
||||
INCS = -I$(X11INC) -I$(FREETYPEINC)
|
||||
LIBS = -L$(X11LIB) -lX11 $(XINERAMALIBS) $(FREETYPELIBS) -lm
|
||||
|
||||
# flags
|
||||
CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700 -D_POSIX_C_SOURCE=200809L -DVERSION=\"$(VERSION)\" $(XINERAMAFLAGS)
|
||||
CFLAGS = -std=c99 -pedantic -Wall -Os $(INCS) $(CPPFLAGS)
|
||||
LDFLAGS = $(LIBS)
|
||||
|
||||
# compiler and linker
|
||||
CC = cc
|
Binary file not shown.
|
@ -0,0 +1,163 @@
|
|||
From 94353eb52055927d9079f3d9e33da1c954abf386 Mon Sep 17 00:00:00 2001
|
||||
From: aleks <aleks.stier@icloud.com>
|
||||
Date: Wed, 26 Jun 2019 13:25:10 +0200
|
||||
Subject: [PATCH] Add support for fuzzy-matching
|
||||
|
||||
---
|
||||
config.def.h | 1 +
|
||||
config.mk | 2 +-
|
||||
dmenu.c | 89 ++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
3 files changed, 91 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/config.def.h b/config.def.h
|
||||
index 1edb647..51612b9 100644
|
||||
--- a/config.def.h
|
||||
+++ b/config.def.h
|
||||
@@ -2,6 +2,7 @@
|
||||
/* Default settings; can be overriden by command line. */
|
||||
|
||||
static int topbar = 1; /* -b option; if 0, dmenu appears at bottom */
|
||||
+static int fuzzy = 1; /* -F option; if 0, dmenu doesn't use fuzzy matching */
|
||||
/* -fn option overrides fonts[0]; default X11 font or font set */
|
||||
static const char *fonts[] = {
|
||||
"monospace:size=10"
|
||||
diff --git a/config.mk b/config.mk
|
||||
index 0929b4a..d14309a 100644
|
||||
--- a/config.mk
|
||||
+++ b/config.mk
|
||||
@@ -20,7 +20,7 @@ FREETYPEINC = /usr/include/freetype2
|
||||
|
||||
# includes and libs
|
||||
INCS = -I$(X11INC) -I$(FREETYPEINC)
|
||||
-LIBS = -L$(X11LIB) -lX11 $(XINERAMALIBS) $(FREETYPELIBS)
|
||||
+LIBS = -L$(X11LIB) -lX11 $(XINERAMALIBS) $(FREETYPELIBS) -lm
|
||||
|
||||
# flags
|
||||
CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700 -D_POSIX_C_SOURCE=200809L -DVERSION=\"$(VERSION)\" $(XINERAMAFLAGS)
|
||||
diff --git a/dmenu.c b/dmenu.c
|
||||
index 6b8f51b..96ddc98 100644
|
||||
--- a/dmenu.c
|
||||
+++ b/dmenu.c
|
||||
@@ -1,6 +1,7 @@
|
||||
/* See LICENSE file for copyright and license details. */
|
||||
#include <ctype.h>
|
||||
#include <locale.h>
|
||||
+#include <math.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@@ -32,6 +33,7 @@ struct item {
|
||||
char *text;
|
||||
struct item *left, *right;
|
||||
int out;
|
||||
+ double distance;
|
||||
};
|
||||
|
||||
static char text[BUFSIZ] = "";
|
||||
@@ -210,9 +212,94 @@ grabkeyboard(void)
|
||||
die("cannot grab keyboard");
|
||||
}
|
||||
|
||||
+int
|
||||
+compare_distance(const void *a, const void *b)
|
||||
+{
|
||||
+ struct item *da = *(struct item **) a;
|
||||
+ struct item *db = *(struct item **) b;
|
||||
+
|
||||
+ if (!db)
|
||||
+ return 1;
|
||||
+ if (!da)
|
||||
+ return -1;
|
||||
+
|
||||
+ return da->distance == db->distance ? 0 : da->distance < db->distance ? -1 : 1;
|
||||
+}
|
||||
+
|
||||
+void
|
||||
+fuzzymatch(void)
|
||||
+{
|
||||
+ /* bang - we have so much memory */
|
||||
+ struct item *it;
|
||||
+ struct item **fuzzymatches = NULL;
|
||||
+ char c;
|
||||
+ int number_of_matches = 0, i, pidx, sidx, eidx;
|
||||
+ int text_len = strlen(text), itext_len;
|
||||
+
|
||||
+ matches = matchend = NULL;
|
||||
+
|
||||
+ /* walk through all items */
|
||||
+ for (it = items; it && it->text; it++) {
|
||||
+ if (text_len) {
|
||||
+ itext_len = strlen(it->text);
|
||||
+ pidx = 0; /* pointer */
|
||||
+ sidx = eidx = -1; /* start of match, end of match */
|
||||
+ /* walk through item text */
|
||||
+ for (i = 0; i < itext_len && (c = it->text[i]); i++) {
|
||||
+ /* fuzzy match pattern */
|
||||
+ if (!fstrncmp(&text[pidx], &c, 1)) {
|
||||
+ if(sidx == -1)
|
||||
+ sidx = i;
|
||||
+ pidx++;
|
||||
+ if (pidx == text_len) {
|
||||
+ eidx = i;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ /* build list of matches */
|
||||
+ if (eidx != -1) {
|
||||
+ /* compute distance */
|
||||
+ /* add penalty if match starts late (log(sidx+2))
|
||||
+ * add penalty for long a match without many matching characters */
|
||||
+ it->distance = log(sidx + 2) + (double)(eidx - sidx - text_len);
|
||||
+ /* fprintf(stderr, "distance %s %f\n", it->text, it->distance); */
|
||||
+ appenditem(it, &matches, &matchend);
|
||||
+ number_of_matches++;
|
||||
+ }
|
||||
+ } else {
|
||||
+ appenditem(it, &matches, &matchend);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (number_of_matches) {
|
||||
+ /* initialize array with matches */
|
||||
+ if (!(fuzzymatches = realloc(fuzzymatches, number_of_matches * sizeof(struct item*))))
|
||||
+ die("cannot realloc %u bytes:", number_of_matches * sizeof(struct item*));
|
||||
+ for (i = 0, it = matches; it && i < number_of_matches; i++, it = it->right) {
|
||||
+ fuzzymatches[i] = it;
|
||||
+ }
|
||||
+ /* sort matches according to distance */
|
||||
+ qsort(fuzzymatches, number_of_matches, sizeof(struct item*), compare_distance);
|
||||
+ /* rebuild list of matches */
|
||||
+ matches = matchend = NULL;
|
||||
+ for (i = 0, it = fuzzymatches[i]; i < number_of_matches && it && \
|
||||
+ it->text; i++, it = fuzzymatches[i]) {
|
||||
+ appenditem(it, &matches, &matchend);
|
||||
+ }
|
||||
+ free(fuzzymatches);
|
||||
+ }
|
||||
+ curr = sel = matches;
|
||||
+ calcoffsets();
|
||||
+}
|
||||
+
|
||||
static void
|
||||
match(void)
|
||||
{
|
||||
+ if (fuzzy) {
|
||||
+ fuzzymatch();
|
||||
+ return;
|
||||
+ }
|
||||
static char **tokv = NULL;
|
||||
static int tokn = 0;
|
||||
|
||||
@@ -702,6 +789,8 @@ main(int argc, char *argv[])
|
||||
topbar = 0;
|
||||
else if (!strcmp(argv[i], "-f")) /* grabs keyboard before reading stdin */
|
||||
fast = 1;
|
||||
+ else if (!strcmp(argv[i], "-F")) /* grabs keyboard before reading stdin */
|
||||
+ fuzzy = 0;
|
||||
else if (!strcmp(argv[i], "-i")) { /* case-insensitive item matching */
|
||||
fstrncmp = strncasecmp;
|
||||
fstrstr = cistrstr;
|
||||
--
|
||||
2.22.0
|
||||
|
|
@ -0,0 +1,194 @@
|
|||
.TH DMENU 1 dmenu\-VERSION
|
||||
.SH NAME
|
||||
dmenu \- dynamic menu
|
||||
.SH SYNOPSIS
|
||||
.B dmenu
|
||||
.RB [ \-bfiv ]
|
||||
.RB [ \-l
|
||||
.IR lines ]
|
||||
.RB [ \-m
|
||||
.IR monitor ]
|
||||
.RB [ \-p
|
||||
.IR prompt ]
|
||||
.RB [ \-fn
|
||||
.IR font ]
|
||||
.RB [ \-nb
|
||||
.IR color ]
|
||||
.RB [ \-nf
|
||||
.IR color ]
|
||||
.RB [ \-sb
|
||||
.IR color ]
|
||||
.RB [ \-sf
|
||||
.IR color ]
|
||||
.RB [ \-w
|
||||
.IR windowid ]
|
||||
.P
|
||||
.BR dmenu_run " ..."
|
||||
.SH DESCRIPTION
|
||||
.B dmenu
|
||||
is a dynamic menu for X, which reads a list of newline\-separated items from
|
||||
stdin. When the user selects an item and presses Return, their choice is printed
|
||||
to stdout and dmenu terminates. Entering text will narrow the items to those
|
||||
matching the tokens in the input.
|
||||
.P
|
||||
.B dmenu_run
|
||||
is a script used by
|
||||
.IR dwm (1)
|
||||
which lists programs in the user's $PATH and runs the result in their $SHELL.
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
.B \-b
|
||||
dmenu appears at the bottom of the screen.
|
||||
.TP
|
||||
.B \-f
|
||||
dmenu grabs the keyboard before reading stdin if not reading from a tty. This
|
||||
is faster, but will lock up X until stdin reaches end\-of\-file.
|
||||
.TP
|
||||
.B \-i
|
||||
dmenu matches menu items case insensitively.
|
||||
.TP
|
||||
.BI \-l " lines"
|
||||
dmenu lists items vertically, with the given number of lines.
|
||||
.TP
|
||||
.BI \-m " monitor"
|
||||
dmenu is displayed on the monitor number supplied. Monitor numbers are starting
|
||||
from 0.
|
||||
.TP
|
||||
.BI \-p " prompt"
|
||||
defines the prompt to be displayed to the left of the input field.
|
||||
.TP
|
||||
.BI \-fn " font"
|
||||
defines the font or font set used.
|
||||
.TP
|
||||
.BI \-nb " color"
|
||||
defines the normal background color.
|
||||
.IR #RGB ,
|
||||
.IR #RRGGBB ,
|
||||
and X color names are supported.
|
||||
.TP
|
||||
.BI \-nf " color"
|
||||
defines the normal foreground color.
|
||||
.TP
|
||||
.BI \-sb " color"
|
||||
defines the selected background color.
|
||||
.TP
|
||||
.BI \-sf " color"
|
||||
defines the selected foreground color.
|
||||
.TP
|
||||
.B \-v
|
||||
prints version information to stdout, then exits.
|
||||
.TP
|
||||
.BI \-w " windowid"
|
||||
embed into windowid.
|
||||
.SH USAGE
|
||||
dmenu is completely controlled by the keyboard. Items are selected using the
|
||||
arrow keys, page up, page down, home, and end.
|
||||
.TP
|
||||
.B Tab
|
||||
Copy the selected item to the input field.
|
||||
.TP
|
||||
.B Return
|
||||
Confirm selection. Prints the selected item to stdout and exits, returning
|
||||
success.
|
||||
.TP
|
||||
.B Ctrl-Return
|
||||
Confirm selection. Prints the selected item to stdout and continues.
|
||||
.TP
|
||||
.B Shift\-Return
|
||||
Confirm input. Prints the input text to stdout and exits, returning success.
|
||||
.TP
|
||||
.B Escape
|
||||
Exit without selecting an item, returning failure.
|
||||
.TP
|
||||
.B Ctrl-Left
|
||||
Move cursor to the start of the current word
|
||||
.TP
|
||||
.B Ctrl-Right
|
||||
Move cursor to the end of the current word
|
||||
.TP
|
||||
.B C\-a
|
||||
Home
|
||||
.TP
|
||||
.B C\-b
|
||||
Left
|
||||
.TP
|
||||
.B C\-c
|
||||
Escape
|
||||
.TP
|
||||
.B C\-d
|
||||
Delete
|
||||
.TP
|
||||
.B C\-e
|
||||
End
|
||||
.TP
|
||||
.B C\-f
|
||||
Right
|
||||
.TP
|
||||
.B C\-g
|
||||
Escape
|
||||
.TP
|
||||
.B C\-h
|
||||
Backspace
|
||||
.TP
|
||||
.B C\-i
|
||||
Tab
|
||||
.TP
|
||||
.B C\-j
|
||||
Return
|
||||
.TP
|
||||
.B C\-J
|
||||
Shift-Return
|
||||
.TP
|
||||
.B C\-k
|
||||
Delete line right
|
||||
.TP
|
||||
.B C\-m
|
||||
Return
|
||||
.TP
|
||||
.B C\-M
|
||||
Shift-Return
|
||||
.TP
|
||||
.B C\-n
|
||||
Down
|
||||
.TP
|
||||
.B C\-p
|
||||
Up
|
||||
.TP
|
||||
.B C\-u
|
||||
Delete line left
|
||||
.TP
|
||||
.B C\-w
|
||||
Delete word left
|
||||
.TP
|
||||
.B C\-y
|
||||
Paste from primary X selection
|
||||
.TP
|
||||
.B C\-Y
|
||||
Paste from X clipboard
|
||||
.TP
|
||||
.B M\-b
|
||||
Move cursor to the start of the current word
|
||||
.TP
|
||||
.B M\-f
|
||||
Move cursor to the end of the current word
|
||||
.TP
|
||||
.B M\-g
|
||||
Home
|
||||
.TP
|
||||
.B M\-G
|
||||
End
|
||||
.TP
|
||||
.B M\-h
|
||||
Up
|
||||
.TP
|
||||
.B M\-j
|
||||
Page down
|
||||
.TP
|
||||
.B M\-k
|
||||
Page up
|
||||
.TP
|
||||
.B M\-l
|
||||
Down
|
||||
.SH SEE ALSO
|
||||
.IR dwm (1),
|
||||
.IR stest (1)
|
|
@ -0,0 +1,855 @@
|
|||
/* See LICENSE file for copyright and license details. */
|
||||
#include <ctype.h>
|
||||
#include <locale.h>
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <strings.h>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xatom.h>
|
||||
#include <X11/Xutil.h>
|
||||
#ifdef XINERAMA
|
||||
#include <X11/extensions/Xinerama.h>
|
||||
#endif
|
||||
#include <X11/Xft/Xft.h>
|
||||
|
||||
#include "drw.h"
|
||||
#include "util.h"
|
||||
|
||||
/* macros */
|
||||
#define INTERSECT(x,y,w,h,r) (MAX(0, MIN((x)+(w),(r).x_org+(r).width) - MAX((x),(r).x_org)) \
|
||||
* MAX(0, MIN((y)+(h),(r).y_org+(r).height) - MAX((y),(r).y_org)))
|
||||
#define LENGTH(X) (sizeof X / sizeof X[0])
|
||||
#define TEXTW(X) (drw_fontset_getwidth(drw, (X)) + lrpad)
|
||||
|
||||
/* enums */
|
||||
enum { SchemeNorm, SchemeSel, SchemeOut, SchemeLast }; /* color schemes */
|
||||
|
||||
struct item {
|
||||
char *text;
|
||||
struct item *left, *right;
|
||||
int out;
|
||||
double distance;
|
||||
};
|
||||
|
||||
static char text[BUFSIZ] = "";
|
||||
static char *embed;
|
||||
static int bh, mw, mh;
|
||||
static int inputw = 0, promptw;
|
||||
static int lrpad; /* sum of left and right padding */
|
||||
static size_t cursor;
|
||||
static struct item *items = NULL;
|
||||
static struct item *matches, *matchend;
|
||||
static struct item *prev, *curr, *next, *sel;
|
||||
static int mon = -1, screen;
|
||||
|
||||
static Atom clip, utf8;
|
||||
static Display *dpy;
|
||||
static Window root, parentwin, win;
|
||||
static XIC xic;
|
||||
|
||||
static Drw *drw;
|
||||
static Clr *scheme[SchemeLast];
|
||||
|
||||
#include "config.h"
|
||||
|
||||
static int (*fstrncmp)(const char *, const char *, size_t) = strncmp;
|
||||
static char *(*fstrstr)(const char *, const char *) = strstr;
|
||||
|
||||
static void
|
||||
appenditem(struct item *item, struct item **list, struct item **last)
|
||||
{
|
||||
if (*last)
|
||||
(*last)->right = item;
|
||||
else
|
||||
*list = item;
|
||||
|
||||
item->left = *last;
|
||||
item->right = NULL;
|
||||
*last = item;
|
||||
}
|
||||
|
||||
static void
|
||||
calcoffsets(void)
|
||||
{
|
||||
int i, n;
|
||||
|
||||
if (lines > 0)
|
||||
n = lines * bh;
|
||||
else
|
||||
n = mw - (promptw + inputw + TEXTW("<") + TEXTW(">"));
|
||||
/* calculate which items will begin the next page and previous page */
|
||||
for (i = 0, next = curr; next; next = next->right)
|
||||
if ((i += (lines > 0) ? bh : MIN(TEXTW(next->text), n)) > n)
|
||||
break;
|
||||
for (i = 0, prev = curr; prev && prev->left; prev = prev->left)
|
||||
if ((i += (lines > 0) ? bh : MIN(TEXTW(prev->left->text), n)) > n)
|
||||
break;
|
||||
}
|
||||
|
||||
static void
|
||||
cleanup(void)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
XUngrabKey(dpy, AnyKey, AnyModifier, root);
|
||||
for (i = 0; i < SchemeLast; i++)
|
||||
free(scheme[i]);
|
||||
drw_free(drw);
|
||||
XSync(dpy, False);
|
||||
XCloseDisplay(dpy);
|
||||
}
|
||||
|
||||
static char *
|
||||
cistrstr(const char *s, const char *sub)
|
||||
{
|
||||
size_t len;
|
||||
|
||||
for (len = strlen(sub); *s; s++)
|
||||
if (!strncasecmp(s, sub, len))
|
||||
return (char *)s;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static int
|
||||
drawitem(struct item *item, int x, int y, int w)
|
||||
{
|
||||
if (item == sel)
|
||||
drw_setscheme(drw, scheme[SchemeSel]);
|
||||
else if (item->out)
|
||||
drw_setscheme(drw, scheme[SchemeOut]);
|
||||
else
|
||||
drw_setscheme(drw, scheme[SchemeNorm]);
|
||||
|
||||
return drw_text(drw, x, y, w, bh, lrpad / 2, item->text, 0);
|
||||
}
|
||||
|
||||
static void
|
||||
drawmenu(void)
|
||||
{
|
||||
unsigned int curpos;
|
||||
struct item *item;
|
||||
int x = 0, y = 0, w;
|
||||
|
||||
drw_setscheme(drw, scheme[SchemeNorm]);
|
||||
drw_rect(drw, 0, 0, mw, mh, 1, 1);
|
||||
|
||||
if (prompt && *prompt) {
|
||||
drw_setscheme(drw, scheme[SchemeSel]);
|
||||
x = drw_text(drw, x, 0, promptw, bh, lrpad / 2, prompt, 0);
|
||||
}
|
||||
/* draw input field */
|
||||
w = (lines > 0 || !matches) ? mw - x : inputw;
|
||||
drw_setscheme(drw, scheme[SchemeNorm]);
|
||||
drw_text(drw, x, 0, w, bh, lrpad / 2, text, 0);
|
||||
|
||||
curpos = TEXTW(text) - TEXTW(&text[cursor]);
|
||||
if ((curpos += lrpad / 2 - 1) < w) {
|
||||
drw_setscheme(drw, scheme[SchemeNorm]);
|
||||
drw_rect(drw, x + curpos, 2, 2, bh - 4, 1, 0);
|
||||
}
|
||||
|
||||
if (lines > 0) {
|
||||
/* draw vertical list */
|
||||
for (item = curr; item != next; item = item->right)
|
||||
drawitem(item, x, y += bh, mw - x);
|
||||
} else if (matches) {
|
||||
/* draw horizontal list */
|
||||
x += inputw;
|
||||
w = TEXTW("<");
|
||||
if (curr->left) {
|
||||
drw_setscheme(drw, scheme[SchemeNorm]);
|
||||
drw_text(drw, x, 0, w, bh, lrpad / 2, "<", 0);
|
||||
}
|
||||
x += w;
|
||||
for (item = curr; item != next; item = item->right)
|
||||
x = drawitem(item, x, 0, MIN(TEXTW(item->text), mw - x - TEXTW(">")));
|
||||
if (next) {
|
||||
w = TEXTW(">");
|
||||
drw_setscheme(drw, scheme[SchemeNorm]);
|
||||
drw_text(drw, mw - w, 0, w, bh, lrpad / 2, ">", 0);
|
||||
}
|
||||
}
|
||||
drw_map(drw, win, 0, 0, mw, mh);
|
||||
}
|
||||
|
||||
static void
|
||||
grabfocus(void)
|
||||
{
|
||||
struct timespec ts = { .tv_sec = 0, .tv_nsec = 10000000 };
|
||||
Window focuswin;
|
||||
int i, revertwin;
|
||||
|
||||
for (i = 0; i < 100; ++i) {
|
||||
XGetInputFocus(dpy, &focuswin, &revertwin);
|
||||
if (focuswin == win)
|
||||
return;
|
||||
XSetInputFocus(dpy, win, RevertToParent, CurrentTime);
|
||||
nanosleep(&ts, NULL);
|
||||
}
|
||||
die("cannot grab focus");
|
||||
}
|
||||
|
||||
static void
|
||||
grabkeyboard(void)
|
||||
{
|
||||
struct timespec ts = { .tv_sec = 0, .tv_nsec = 1000000 };
|
||||
int i;
|
||||
|
||||
if (embed)
|
||||
return;
|
||||
/* try to grab keyboard, we may have to wait for another process to ungrab */
|
||||
for (i = 0; i < 1000; i++) {
|
||||
if (XGrabKeyboard(dpy, DefaultRootWindow(dpy), True, GrabModeAsync,
|
||||
GrabModeAsync, CurrentTime) == GrabSuccess)
|
||||
return;
|
||||
nanosleep(&ts, NULL);
|
||||
}
|
||||
die("cannot grab keyboard");
|
||||
}
|
||||
|
||||
int
|
||||
compare_distance(const void *a, const void *b)
|
||||
{
|
||||
struct item *da = *(struct item **) a;
|
||||
struct item *db = *(struct item **) b;
|
||||
|
||||
if (!db)
|
||||
return 1;
|
||||
if (!da)
|
||||
return -1;
|
||||
|
||||
return da->distance == db->distance ? 0 : da->distance < db->distance ? -1 : 1;
|
||||
}
|
||||
|
||||
void
|
||||
fuzzymatch(void)
|
||||
{
|
||||
/* bang - we have so much memory */
|
||||
struct item *it;
|
||||
struct item **fuzzymatches = NULL;
|
||||
char c;
|
||||
int number_of_matches = 0, i, pidx, sidx, eidx;
|
||||
int text_len = strlen(text), itext_len;
|
||||
|
||||
matches = matchend = NULL;
|
||||
|
||||
/* walk through all items */
|
||||
for (it = items; it && it->text; it++) {
|
||||
if (text_len) {
|
||||
itext_len = strlen(it->text);
|
||||
pidx = 0; /* pointer */
|
||||
sidx = eidx = -1; /* start of match, end of match */
|
||||
/* walk through item text */
|
||||
for (i = 0; i < itext_len && (c = it->text[i]); i++) {
|
||||
/* fuzzy match pattern */
|
||||
if (!fstrncmp(&text[pidx], &c, 1)) {
|
||||
if(sidx == -1)
|
||||
sidx = i;
|
||||
pidx++;
|
||||
if (pidx == text_len) {
|
||||
eidx = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* build list of matches */
|
||||
if (eidx != -1) {
|
||||
/* compute distance */
|
||||
/* add penalty if match starts late (log(sidx+2))
|
||||
* add penalty for long a match without many matching characters */
|
||||
it->distance = log(sidx + 2) + (double)(eidx - sidx - text_len);
|
||||
/* fprintf(stderr, "distance %s %f\n", it->text, it->distance); */
|
||||
appenditem(it, &matches, &matchend);
|
||||
number_of_matches++;
|
||||
}
|
||||
} else {
|
||||
appenditem(it, &matches, &matchend);
|
||||
}
|
||||
}
|
||||
|
||||
if (number_of_matches) {
|
||||
/* initialize array with matches */
|
||||
if (!(fuzzymatches = realloc(fuzzymatches, number_of_matches * sizeof(struct item*))))
|
||||
die("cannot realloc %u bytes:", number_of_matches * sizeof(struct item*));
|
||||
for (i = 0, it = matches; it && i < number_of_matches; i++, it = it->right) {
|
||||
fuzzymatches[i] = it;
|
||||
}
|
||||
/* sort matches according to distance */
|
||||
qsort(fuzzymatches, number_of_matches, sizeof(struct item*), compare_distance);
|
||||
/* rebuild list of matches */
|
||||
matches = matchend = NULL;
|
||||
for (i = 0, it = fuzzymatches[i]; i < number_of_matches && it && \
|
||||
it->text; i++, it = fuzzymatches[i]) {
|
||||
appenditem(it, &matches, &matchend);
|
||||
}
|
||||
free(fuzzymatches);
|
||||
}
|
||||
curr = sel = matches;
|
||||
calcoffsets();
|
||||
}
|
||||
|
||||
static void
|
||||
match(void)
|
||||
{
|
||||
if (fuzzy) {
|
||||
fuzzymatch();
|
||||
return;
|
||||
}
|
||||
static char **tokv = NULL;
|
||||
static int tokn = 0;
|
||||
|
||||
char buf[sizeof text], *s;
|
||||
int i, tokc = 0;
|
||||
size_t len, textsize;
|
||||
struct item *item, *lprefix, *lsubstr, *prefixend, *substrend;
|
||||
|
||||
strcpy(buf, text);
|
||||
/* separate input text into tokens to be matched individually */
|
||||
for (s = strtok(buf, " "); s; tokv[tokc - 1] = s, s = strtok(NULL, " "))
|
||||
if (++tokc > tokn && !(tokv = realloc(tokv, ++tokn * sizeof *tokv)))
|
||||
die("cannot realloc %u bytes:", tokn * sizeof *tokv);
|
||||
len = tokc ? strlen(tokv[0]) : 0;
|
||||
|
||||
matches = lprefix = lsubstr = matchend = prefixend = substrend = NULL;
|
||||
textsize = strlen(text) + 1;
|
||||
for (item = items; item && item->text; item++) {
|
||||
for (i = 0; i < tokc; i++)
|
||||
if (!fstrstr(item->text, tokv[i]))
|
||||
break;
|
||||
if (i != tokc) /* not all tokens match */
|
||||
continue;
|
||||
/* exact matches go first, then prefixes, then substrings */
|
||||
if (!tokc || !fstrncmp(text, item->text, textsize))
|
||||
appenditem(item, &matches, &matchend);
|
||||
else if (!fstrncmp(tokv[0], item->text, len))
|
||||
appenditem(item, &lprefix, &prefixend);
|
||||
else
|
||||
appenditem(item, &lsubstr, &substrend);
|
||||
}
|
||||
if (lprefix) {
|
||||
if (matches) {
|
||||
matchend->right = lprefix;
|
||||
lprefix->left = matchend;
|
||||
} else
|
||||
matches = lprefix;
|
||||
matchend = prefixend;
|
||||
}
|
||||
if (lsubstr) {
|
||||
if (matches) {
|
||||
matchend->right = lsubstr;
|
||||
lsubstr->left = matchend;
|
||||
} else
|
||||
matches = lsubstr;
|
||||
matchend = substrend;
|
||||
}
|
||||
curr = sel = matches;
|
||||
calcoffsets();
|
||||
}
|
||||
|
||||
static void
|
||||
insert(const char *str, ssize_t n)
|
||||
{
|
||||
if (strlen(text) + n > sizeof text - 1)
|
||||
return;
|
||||
/* move existing text out of the way, insert new text, and update cursor */
|
||||
memmove(&text[cursor + n], &text[cursor], sizeof text - cursor - MAX(n, 0));
|
||||
if (n > 0)
|
||||
memcpy(&text[cursor], str, n);
|
||||
cursor += n;
|
||||
match();
|
||||
}
|
||||
|
||||
static size_t
|
||||
nextrune(int inc)
|
||||
{
|
||||
ssize_t n;
|
||||
|
||||
/* return location of next utf8 rune in the given direction (+1 or -1) */
|
||||
for (n = cursor + inc; n + inc >= 0 && (text[n] & 0xc0) == 0x80; n += inc)
|
||||
;
|
||||
return n;
|
||||
}
|
||||
|
||||
static void
|
||||
movewordedge(int dir)
|
||||
{
|
||||
if (dir < 0) { /* move cursor to the start of the word*/
|
||||
while (cursor > 0 && strchr(worddelimiters, text[nextrune(-1)]))
|
||||
cursor = nextrune(-1);
|
||||
while (cursor > 0 && !strchr(worddelimiters, text[nextrune(-1)]))
|
||||
cursor = nextrune(-1);
|
||||
} else { /* move cursor to the end of the word */
|
||||
while (text[cursor] && strchr(worddelimiters, text[cursor]))
|
||||
cursor = nextrune(+1);
|
||||
while (text[cursor] && !strchr(worddelimiters, text[cursor]))
|
||||
cursor = nextrune(+1);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
keypress(XKeyEvent *ev)
|
||||
{
|
||||
char buf[32];
|
||||
int len;
|
||||
KeySym ksym;
|
||||
Status status;
|
||||
|
||||
len = XmbLookupString(xic, ev, buf, sizeof buf, &ksym, &status);
|
||||
switch (status) {
|
||||
default: /* XLookupNone, XBufferOverflow */
|
||||
return;
|
||||
case XLookupChars:
|
||||
goto insert;
|
||||
case XLookupKeySym:
|
||||
case XLookupBoth:
|
||||
break;
|
||||
}
|
||||
|
||||
if (ev->state & ControlMask) {
|
||||
switch(ksym) {
|
||||
case XK_a: ksym = XK_Home; break;
|
||||
case XK_b: ksym = XK_Left; break;
|
||||
case XK_c: ksym = XK_Escape; break;
|
||||
case XK_d: ksym = XK_Delete; break;
|
||||
case XK_e: ksym = XK_End; break;
|
||||
case XK_f: ksym = XK_Right; break;
|
||||
case XK_g: ksym = XK_Escape; break;
|
||||
case XK_h: ksym = XK_BackSpace; break;
|
||||
case XK_i: ksym = XK_Tab; break;
|
||||
case XK_j: /* fallthrough */
|
||||
case XK_J: /* fallthrough */
|
||||
case XK_m: /* fallthrough */
|
||||
case XK_M: ksym = XK_Return; ev->state &= ~ControlMask; break;
|
||||
case XK_n: ksym = XK_Down; break;
|
||||
case XK_p: ksym = XK_Up; break;
|
||||
|
||||
case XK_k: /* delete right */
|
||||
text[cursor] = '\0';
|
||||
match();
|
||||
break;
|
||||
case XK_u: /* delete left */
|
||||
insert(NULL, 0 - cursor);
|
||||
break;
|
||||
case XK_w: /* delete word */
|
||||
while (cursor > 0 && strchr(worddelimiters, text[nextrune(-1)]))
|
||||
insert(NULL, nextrune(-1) - cursor);
|
||||
while (cursor > 0 && !strchr(worddelimiters, text[nextrune(-1)]))
|
||||
insert(NULL, nextrune(-1) - cursor);
|
||||
break;
|
||||
case XK_y: /* paste selection */
|
||||
case XK_Y:
|
||||
XConvertSelection(dpy, (ev->state & ShiftMask) ? clip : XA_PRIMARY,
|
||||
utf8, utf8, win, CurrentTime);
|
||||
return;
|
||||
case XK_Left:
|
||||
movewordedge(-1);
|
||||
goto draw;
|
||||
case XK_Right:
|
||||
movewordedge(+1);
|
||||
goto draw;
|
||||
case XK_Return:
|
||||
case XK_KP_Enter:
|
||||
break;
|
||||
case XK_bracketleft:
|
||||
cleanup();
|
||||
exit(1);
|
||||
default:
|
||||
return;
|
||||
}
|
||||
} else if (ev->state & Mod1Mask) {
|
||||
switch(ksym) {
|
||||
case XK_b:
|
||||
movewordedge(-1);
|
||||
goto draw;
|
||||
case XK_f:
|
||||
movewordedge(+1);
|
||||
goto draw;
|
||||
case XK_g: ksym = XK_Home; break;
|
||||
case XK_G: ksym = XK_End; break;
|
||||
case XK_h: ksym = XK_Up; break;
|
||||
case XK_j: ksym = XK_Next; break;
|
||||
case XK_k: ksym = XK_Prior; break;
|
||||
case XK_l: ksym = XK_Down; break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
switch(ksym) {
|
||||
default:
|
||||
insert:
|
||||
if (!iscntrl(*buf))
|
||||
insert(buf, len);
|
||||
break;
|
||||
case XK_Delete:
|
||||
if (text[cursor] == '\0')
|
||||
return;
|
||||
cursor = nextrune(+1);
|
||||
/* fallthrough */
|
||||
case XK_BackSpace:
|
||||
if (cursor == 0)
|
||||
return;
|
||||
insert(NULL, nextrune(-1) - cursor);
|
||||
break;
|
||||
case XK_End:
|
||||
if (text[cursor] != '\0') {
|
||||
cursor = strlen(text);
|
||||
break;
|
||||
}
|
||||
if (next) {
|
||||
/* jump to end of list and position items in reverse */
|
||||
curr = matchend;
|
||||
calcoffsets();
|
||||
curr = prev;
|
||||
calcoffsets();
|
||||
while (next && (curr = curr->right))
|
||||
calcoffsets();
|
||||
}
|
||||
sel = matchend;
|
||||
break;
|
||||
case XK_Escape:
|
||||
cleanup();
|
||||
exit(1);
|
||||
case XK_Home:
|
||||
if (sel == matches) {
|
||||
cursor = 0;
|
||||
break;
|
||||
}
|
||||
sel = curr = matches;
|
||||
calcoffsets();
|
||||
break;
|
||||
case XK_Left:
|
||||
if (cursor > 0 && (!sel || !sel->left || lines > 0)) {
|
||||
cursor = nextrune(-1);
|
||||
break;
|
||||
}
|
||||
if (lines > 0)
|
||||
return;
|
||||
/* fallthrough */
|
||||
case XK_Up:
|
||||
if (sel && sel->left && (sel = sel->left)->right == curr) {
|
||||
curr = prev;
|
||||
calcoffsets();
|
||||
}
|
||||
break;
|
||||
case XK_Next:
|
||||
if (!next)
|
||||
return;
|
||||
sel = curr = next;
|
||||
calcoffsets();
|
||||
break;
|
||||
case XK_Prior:
|
||||
if (!prev)
|
||||
return;
|
||||
sel = curr = prev;
|
||||
calcoffsets();
|
||||
break;
|
||||
case XK_Return:
|
||||
case XK_KP_Enter:
|
||||
puts((sel && !(ev->state & ShiftMask)) ? sel->text : text);
|
||||
if (!(ev->state & ControlMask)) {
|
||||
cleanup();
|
||||
exit(0);
|
||||
}
|
||||
if (sel)
|
||||
sel->out = 1;
|
||||
break;
|
||||
case XK_Right:
|
||||
if (text[cursor] != '\0') {
|
||||
cursor = nextrune(+1);
|
||||
break;
|
||||
}
|
||||
if (lines > 0)
|
||||
return;
|
||||
/* fallthrough */
|
||||
case XK_Down:
|
||||
if (sel && sel->right && (sel = sel->right) == next) {
|
||||
curr = next;
|
||||
calcoffsets();
|
||||
}
|
||||
break;
|
||||
case XK_Tab:
|
||||
if (!sel)
|
||||
return;
|
||||
strncpy(text, sel->text, sizeof text - 1);
|
||||
text[sizeof text - 1] = '\0';
|
||||
cursor = strlen(text);
|
||||
match();
|
||||
break;
|
||||
}
|
||||
|
||||
draw:
|
||||
drawmenu();
|
||||
}
|
||||
|
||||
static void
|
||||
paste(void)
|
||||
{
|
||||
char *p, *q;
|
||||
int di;
|
||||
unsigned long dl;
|
||||
Atom da;
|
||||
|
||||
/* we have been given the current selection, now insert it into input */
|
||||
if (XGetWindowProperty(dpy, win, utf8, 0, (sizeof text / 4) + 1, False,
|
||||
utf8, &da, &di, &dl, &dl, (unsigned char **)&p)
|
||||
== Success && p) {
|
||||
insert(p, (q = strchr(p, '\n')) ? q - p : (ssize_t)strlen(p));
|
||||
XFree(p);
|
||||
}
|
||||
drawmenu();
|
||||
}
|
||||
|
||||
static void
|
||||
readstdin(void)
|
||||
{
|
||||
char buf[sizeof text], *p;
|
||||
size_t i, imax = 0, size = 0;
|
||||
unsigned int tmpmax = 0;
|
||||
|
||||
/* read each line from stdin and add it to the item list */
|
||||
for (i = 0; fgets(buf, sizeof buf, stdin); i++) {
|
||||
if (i + 1 >= size / sizeof *items)
|
||||
if (!(items = realloc(items, (size += BUFSIZ))))
|
||||
die("cannot realloc %u bytes:", size);
|
||||
if ((p = strchr(buf, '\n')))
|
||||
*p = '\0';
|
||||
if (!(items[i].text = strdup(buf)))
|
||||
die("cannot strdup %u bytes:", strlen(buf) + 1);
|
||||
items[i].out = 0;
|
||||
drw_font_getexts(drw->fonts, buf, strlen(buf), &tmpmax, NULL);
|
||||
if (tmpmax > inputw) {
|
||||
inputw = tmpmax;
|
||||
imax = i;
|
||||
}
|
||||
}
|
||||
if (items)
|
||||
items[i].text = NULL;
|
||||
inputw = items ? TEXTW(items[imax].text) : 0;
|
||||
lines = MIN(lines, i);
|
||||
}
|
||||
|
||||
static void
|
||||
run(void)
|
||||
{
|
||||
XEvent ev;
|
||||
|
||||
while (!XNextEvent(dpy, &ev)) {
|
||||
if (XFilterEvent(&ev, None))
|
||||
continue;
|
||||
switch(ev.type) {
|
||||
case Expose:
|
||||
if (ev.xexpose.count == 0)
|
||||
drw_map(drw, win, 0, 0, mw, mh);
|
||||
break;
|
||||
case FocusIn:
|
||||
/* regrab focus from parent window */
|
||||
if (ev.xfocus.window != win)
|
||||
grabfocus();
|
||||
break;
|
||||
case KeyPress:
|
||||
keypress(&ev.xkey);
|
||||
break;
|
||||
case SelectionNotify:
|
||||
if (ev.xselection.property == utf8)
|
||||
paste();
|
||||
break;
|
||||
case VisibilityNotify:
|
||||
if (ev.xvisibility.state != VisibilityUnobscured)
|
||||
XRaiseWindow(dpy, win);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
setup(void)
|
||||
{
|
||||
int x, y, i, j;
|
||||
unsigned int du;
|
||||
XSetWindowAttributes swa;
|
||||
XIM xim;
|
||||
Window w, dw, *dws;
|
||||
XWindowAttributes wa;
|
||||
XClassHint ch = {"dmenu", "dmenu"};
|
||||
#ifdef XINERAMA
|
||||
XineramaScreenInfo *info;
|
||||
Window pw;
|
||||
int a, di, n, area = 0;
|
||||
#endif
|
||||
/* init appearance */
|
||||
for (j = 0; j < SchemeLast; j++)
|
||||
scheme[j] = drw_scm_create(drw, colors[j], 2);
|
||||
|
||||
clip = XInternAtom(dpy, "CLIPBOARD", False);
|
||||
utf8 = XInternAtom(dpy, "UTF8_STRING", False);
|
||||
|
||||
/* calculate menu geometry */
|
||||
bh = drw->fonts->h + 2;
|
||||
lines = MAX(lines, 0);
|
||||
mh = (lines + 1) * bh;
|
||||
#ifdef XINERAMA
|
||||
i = 0;
|
||||
if (parentwin == root && (info = XineramaQueryScreens(dpy, &n))) {
|
||||
XGetInputFocus(dpy, &w, &di);
|
||||
if (mon >= 0 && mon < n)
|
||||
i = mon;
|
||||
else if (w != root && w != PointerRoot && w != None) {
|
||||
/* find top-level window containing current input focus */
|
||||
do {
|
||||
if (XQueryTree(dpy, (pw = w), &dw, &w, &dws, &du) && dws)
|
||||
XFree(dws);
|
||||
} while (w != root && w != pw);
|
||||
/* find xinerama screen with which the window intersects most */
|
||||
if (XGetWindowAttributes(dpy, pw, &wa))
|
||||
for (j = 0; j < n; j++)
|
||||
if ((a = INTERSECT(wa.x, wa.y, wa.width, wa.height, info[j])) > area) {
|
||||
area = a;
|
||||
i = j;
|
||||
}
|
||||
}
|
||||
/* no focused window is on screen, so use pointer location instead */
|
||||
if (mon < 0 && !area && XQueryPointer(dpy, root, &dw, &dw, &x, &y, &di, &di, &du))
|
||||
for (i = 0; i < n; i++)
|
||||
if (INTERSECT(x, y, 1, 1, info[i]))
|
||||
break;
|
||||
|
||||
x = info[i].x_org;
|
||||
y = info[i].y_org + (topbar ? 0 : info[i].height - mh);
|
||||
mw = info[i].width;
|
||||
XFree(info);
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
if (!XGetWindowAttributes(dpy, parentwin, &wa))
|
||||
die("could not get embedding window attributes: 0x%lx",
|
||||
parentwin);
|
||||
x = 0;
|
||||
y = topbar ? 0 : wa.height - mh;
|
||||
mw = wa.width;
|
||||
}
|
||||
promptw = (prompt && *prompt) ? TEXTW(prompt) - lrpad / 4 : 0;
|
||||
inputw = MIN(inputw, mw/3);
|
||||
match();
|
||||
|
||||
/* create menu window */
|
||||
swa.override_redirect = True;
|
||||
swa.background_pixel = scheme[SchemeNorm][ColBg].pixel;
|
||||
swa.event_mask = ExposureMask | KeyPressMask | VisibilityChangeMask;
|
||||
win = XCreateWindow(dpy, parentwin, x, y, mw, mh, 0,
|
||||
CopyFromParent, CopyFromParent, CopyFromParent,
|
||||
CWOverrideRedirect | CWBackPixel | CWEventMask, &swa);
|
||||
XSetClassHint(dpy, win, &ch);
|
||||
|
||||
/* open input methods */
|
||||
xim = XOpenIM(dpy, NULL, NULL, NULL);
|
||||
xic = XCreateIC(xim, XNInputStyle, XIMPreeditNothing | XIMStatusNothing,
|
||||
XNClientWindow, win, XNFocusWindow, win, NULL);
|
||||
|
||||
XMapRaised(dpy, win);
|
||||
XSetInputFocus(dpy, win, RevertToParent, CurrentTime);
|
||||
if (embed) {
|
||||
XSelectInput(dpy, parentwin, FocusChangeMask);
|
||||
if (XQueryTree(dpy, parentwin, &dw, &w, &dws, &du) && dws) {
|
||||
for (i = 0; i < du && dws[i] != win; ++i)
|
||||
XSelectInput(dpy, dws[i], FocusChangeMask);
|
||||
XFree(dws);
|
||||
}
|
||||
grabfocus();
|
||||
}
|
||||
drw_resize(drw, mw, mh);
|
||||
drawmenu();
|
||||
}
|
||||
|
||||
static void
|
||||
usage(void)
|
||||
{
|
||||
fputs("usage: dmenu [-bfiv] [-l lines] [-p prompt] [-fn font] [-m monitor]\n"
|
||||
" [-nb color] [-nf color] [-sb color] [-sf color] [-w windowid]\n", stderr);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
XWindowAttributes wa;
|
||||
int i, fast = 0;
|
||||
|
||||
for (i = 1; i < argc; i++)
|
||||
/* these options take no arguments */
|
||||
if (!strcmp(argv[i], "-v")) { /* prints version information */
|
||||
puts("dmenu-"VERSION);
|
||||
exit(0);
|
||||
} else if (!strcmp(argv[i], "-b")) /* appears at the bottom of the screen */
|
||||
topbar = 0;
|
||||
else if (!strcmp(argv[i], "-f")) /* grabs keyboard before reading stdin */
|
||||
fast = 1;
|
||||
else if (!strcmp(argv[i], "-F")) /* grabs keyboard before reading stdin */
|
||||
fuzzy = 0;
|
||||
else if (!strcmp(argv[i], "-i")) { /* case-insensitive item matching */
|
||||
fstrncmp = strncasecmp;
|
||||
fstrstr = cistrstr;
|
||||
} else if (i + 1 == argc)
|
||||
usage();
|
||||
/* these options take one argument */
|
||||
else if (!strcmp(argv[i], "-l")) /* number of lines in vertical list */
|
||||
lines = atoi(argv[++i]);
|
||||
else if (!strcmp(argv[i], "-m"))
|
||||
mon = atoi(argv[++i]);
|
||||
else if (!strcmp(argv[i], "-p")) /* adds prompt to left of input field */
|
||||
prompt = argv[++i];
|
||||
else if (!strcmp(argv[i], "-fn")) /* font or font set */
|
||||
fonts[0] = argv[++i];
|
||||
else if (!strcmp(argv[i], "-nb")) /* normal background color */
|
||||
colors[SchemeNorm][ColBg] = argv[++i];
|
||||
else if (!strcmp(argv[i], "-nf")) /* normal foreground color */
|
||||
colors[SchemeNorm][ColFg] = argv[++i];
|
||||
else if (!strcmp(argv[i], "-sb")) /* selected background color */
|
||||
colors[SchemeSel][ColBg] = argv[++i];
|
||||
else if (!strcmp(argv[i], "-sf")) /* selected foreground color */
|
||||
colors[SchemeSel][ColFg] = argv[++i];
|
||||
else if (!strcmp(argv[i], "-w")) /* embedding window id */
|
||||
embed = argv[++i];
|
||||
else
|
||||
usage();
|
||||
|
||||
if (!setlocale(LC_CTYPE, "") || !XSupportsLocale())
|
||||
fputs("warning: no locale support\n", stderr);
|
||||
if (!XSetLocaleModifiers(""))
|
||||
fputs("warning: no locale modifiers support\n", stderr);
|
||||
if (!(dpy = XOpenDisplay(NULL)))
|
||||
die("cannot open display");
|
||||
screen = DefaultScreen(dpy);
|
||||
root = RootWindow(dpy, screen);
|
||||
if (!embed || !(parentwin = strtol(embed, NULL, 0)))
|
||||
parentwin = root;
|
||||
if (!XGetWindowAttributes(dpy, parentwin, &wa))
|
||||
die("could not get embedding window attributes: 0x%lx",
|
||||
parentwin);
|
||||
drw = drw_create(dpy, screen, root, wa.width, wa.height);
|
||||
if (!drw_fontset_create(drw, fonts, LENGTH(fonts)))
|
||||
die("no fonts could be loaded.");
|
||||
lrpad = drw->fonts->h;
|
||||
|
||||
#ifdef __OpenBSD__
|
||||
if (pledge("stdio rpath", NULL) == -1)
|
||||
die("pledge");
|
||||
#endif
|
||||
|
||||
if (fast && !isatty(0)) {
|
||||
grabkeyboard();
|
||||
readstdin();
|
||||
} else {
|
||||
readstdin();
|
||||
grabkeyboard();
|
||||
}
|
||||
setup();
|
||||
run();
|
||||
|
||||
return 1; /* unreachable */
|
||||
}
|
Binary file not shown.
|
@ -0,0 +1,13 @@
|
|||
#!/bin/sh
|
||||
|
||||
cachedir="${XDG_CACHE_HOME:-"$HOME/.cache"}"
|
||||
cache="$cachedir/dmenu_run"
|
||||
|
||||
[ ! -e "$cachedir" ] && mkdir -p "$cachedir"
|
||||
|
||||
IFS=:
|
||||
if stest -dqr -n "$cache" $PATH; then
|
||||
stest -flx $PATH | sort -u | tee "$cache"
|
||||
else
|
||||
cat "$cache"
|
||||
fi
|
|
@ -0,0 +1,2 @@
|
|||
#!/bin/sh
|
||||
dmenu_path | dmenu "$@" | ${SHELL:-"/bin/sh"} &
|
|
@ -0,0 +1,435 @@
|
|||
/* See LICENSE file for copyright and license details. */
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xft/Xft.h>
|
||||
|
||||
#include "drw.h"
|
||||
#include "util.h"
|
||||
|
||||
#define UTF_INVALID 0xFFFD
|
||||
#define UTF_SIZ 4
|
||||
|
||||
static const unsigned char utfbyte[UTF_SIZ + 1] = {0x80, 0, 0xC0, 0xE0, 0xF0};
|
||||
static const unsigned char utfmask[UTF_SIZ + 1] = {0xC0, 0x80, 0xE0, 0xF0, 0xF8};
|
||||
static const long utfmin[UTF_SIZ + 1] = { 0, 0, 0x80, 0x800, 0x10000};
|
||||
static const long utfmax[UTF_SIZ + 1] = {0x10FFFF, 0x7F, 0x7FF, 0xFFFF, 0x10FFFF};
|
||||
|
||||
static long
|
||||
utf8decodebyte(const char c, size_t *i)
|
||||
{
|
||||
for (*i = 0; *i < (UTF_SIZ + 1); ++(*i))
|
||||
if (((unsigned char)c & utfmask[*i]) == utfbyte[*i])
|
||||
return (unsigned char)c & ~utfmask[*i];
|
||||
return 0;
|
||||
}
|
||||
|
||||
static size_t
|
||||
utf8validate(long *u, size_t i)
|
||||
{
|
||||
if (!BETWEEN(*u, utfmin[i], utfmax[i]) || BETWEEN(*u, 0xD800, 0xDFFF))
|
||||
*u = UTF_INVALID;
|
||||
for (i = 1; *u > utfmax[i]; ++i)
|
||||
;
|
||||
return i;
|
||||
}
|
||||
|
||||
static size_t
|
||||
utf8decode(const char *c, long *u, size_t clen)
|
||||
{
|
||||
size_t i, j, len, type;
|
||||
long udecoded;
|
||||
|
||||
*u = UTF_INVALID;
|
||||
if (!clen)
|
||||
return 0;
|
||||
udecoded = utf8decodebyte(c[0], &len);
|
||||
if (!BETWEEN(len, 1, UTF_SIZ))
|
||||
return 1;
|
||||
for (i = 1, j = 1; i < clen && j < len; ++i, ++j) {
|
||||
udecoded = (udecoded << 6) | utf8decodebyte(c[i], &type);
|
||||
if (type)
|
||||
return j;
|
||||
}
|
||||
if (j < len)
|
||||
return 0;
|
||||
*u = udecoded;
|
||||
utf8validate(u, len);
|
||||
|
||||
return len;
|
||||
}
|
||||
|
||||
Drw *
|
||||
drw_create(Display *dpy, int screen, Window root, unsigned int w, unsigned int h)
|
||||
{
|
||||
Drw *drw = ecalloc(1, sizeof(Drw));
|
||||
|
||||
drw->dpy = dpy;
|
||||
drw->screen = screen;
|
||||
drw->root = root;
|
||||
drw->w = w;
|
||||
drw->h = h;
|
||||
drw->drawable = XCreatePixmap(dpy, root, w, h, DefaultDepth(dpy, screen));
|
||||
drw->gc = XCreateGC(dpy, root, 0, NULL);
|
||||
XSetLineAttributes(dpy, drw->gc, 1, LineSolid, CapButt, JoinMiter);
|
||||
|
||||
return drw;
|
||||
}
|
||||
|
||||
void
|
||||
drw_resize(Drw *drw, unsigned int w, unsigned int h)
|
||||
{
|
||||
if (!drw)
|
||||
return;
|
||||
|
||||
drw->w = w;
|
||||
drw->h = h;
|
||||
if (drw->drawable)
|
||||
XFreePixmap(drw->dpy, drw->drawable);
|
||||
drw->drawable = XCreatePixmap(drw->dpy, drw->root, w, h, DefaultDepth(drw->dpy, drw->screen));
|
||||
}
|
||||
|
||||
void
|
||||
drw_free(Drw *drw)
|
||||
{
|
||||
XFreePixmap(drw->dpy, drw->drawable);
|
||||
XFreeGC(drw->dpy, drw->gc);
|
||||
free(drw);
|
||||
}
|
||||
|
||||
/* This function is an implementation detail. Library users should use
|
||||
* drw_fontset_create instead.
|
||||
*/
|
||||
static Fnt *
|
||||
xfont_create(Drw *drw, const char *fontname, FcPattern *fontpattern)
|
||||
{
|
||||
Fnt *font;
|
||||
XftFont *xfont = NULL;
|
||||
FcPattern *pattern = NULL;
|
||||
|
||||
if (fontname) {
|
||||
/* Using the pattern found at font->xfont->pattern does not yield the
|
||||
* same substitution results as using the pattern returned by
|
||||
* FcNameParse; using the latter results in the desired fallback
|
||||
* behaviour whereas the former just results in missing-character
|
||||
* rectangles being drawn, at least with some fonts. */
|
||||
if (!(xfont = XftFontOpenName(drw->dpy, drw->screen, fontname))) {
|
||||
fprintf(stderr, "error, cannot load font from name: '%s'\n", fontname);
|
||||
return NULL;
|
||||
}
|
||||
if (!(pattern = FcNameParse((FcChar8 *) fontname))) {
|
||||
fprintf(stderr, "error, cannot parse font name to pattern: '%s'\n", fontname);
|
||||
XftFontClose(drw->dpy, xfont);
|
||||
return NULL;
|
||||
}
|
||||
} else if (fontpattern) {
|
||||
if (!(xfont = XftFontOpenPattern(drw->dpy, fontpattern))) {
|
||||
fprintf(stderr, "error, cannot load font from pattern.\n");
|
||||
return NULL;
|
||||
}
|
||||
} else {
|
||||
die("no font specified.");
|
||||
}
|
||||
|
||||
/* Do not allow using color fonts. This is a workaround for a BadLength
|
||||
* error from Xft with color glyphs. Modelled on the Xterm workaround. See
|
||||
* https://bugzilla.redhat.com/show_bug.cgi?id=1498269
|
||||
* https://lists.suckless.org/dev/1701/30932.html
|
||||
* https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=916349
|
||||
* and lots more all over the internet.
|
||||
*/
|
||||
FcBool iscol;
|
||||
if(FcPatternGetBool(xfont->pattern, FC_COLOR, 0, &iscol) == FcResultMatch && iscol) {
|
||||
XftFontClose(drw->dpy, xfont);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
font = ecalloc(1, sizeof(Fnt));
|
||||
font->xfont = xfont;
|
||||
font->pattern = pattern;
|
||||
font->h = xfont->ascent + xfont->descent;
|
||||
font->dpy = drw->dpy;
|
||||
|
||||
return font;
|
||||
}
|
||||
|
||||
static void
|
||||
xfont_free(Fnt *font)
|
||||
{
|
||||
if (!font)
|
||||
return;
|
||||
if (font->pattern)
|
||||
FcPatternDestroy(font->pattern);
|
||||
XftFontClose(font->dpy, font->xfont);
|
||||
free(font);
|
||||
}
|
||||
|
||||
Fnt*
|
||||
drw_fontset_create(Drw* drw, const char *fonts[], size_t fontcount)
|
||||
{
|
||||
Fnt *cur, *ret = NULL;
|
||||
size_t i;
|
||||
|
||||
if (!drw || !fonts)
|
||||
return NULL;
|
||||
|
||||
for (i = 1; i <= fontcount; i++) {
|
||||
if ((cur = xfont_create(drw, fonts[fontcount - i], NULL))) {
|
||||
cur->next = ret;
|
||||
ret = cur;
|
||||
}
|
||||
}
|
||||
return (drw->fonts = ret);
|
||||
}
|
||||
|
||||
void
|
||||
drw_fontset_free(Fnt *font)
|
||||
{
|
||||
if (font) {
|
||||
drw_fontset_free(font->next);
|
||||
xfont_free(font);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
drw_clr_create(Drw *drw, Clr *dest, const char *clrname)
|
||||
{
|
||||
if (!drw || !dest || !clrname)
|
||||
return;
|
||||
|
||||
if (!XftColorAllocName(drw->dpy, DefaultVisual(drw->dpy, drw->screen),
|
||||
DefaultColormap(drw->dpy, drw->screen),
|
||||
clrname, dest))
|
||||
die("error, cannot allocate color '%s'", clrname);
|
||||
}
|
||||
|
||||
/* Wrapper to create color schemes. The caller has to call free(3) on the
|
||||
* returned color scheme when done using it. */
|
||||
Clr *
|
||||
drw_scm_create(Drw *drw, const char *clrnames[], size_t clrcount)
|
||||
{
|
||||
size_t i;
|
||||
Clr *ret;
|
||||
|
||||
/* need at least two colors for a scheme */
|
||||
if (!drw || !clrnames || clrcount < 2 || !(ret = ecalloc(clrcount, sizeof(XftColor))))
|
||||
return NULL;
|
||||
|
||||
for (i = 0; i < clrcount; i++)
|
||||
drw_clr_create(drw, &ret[i], clrnames[i]);
|
||||
return ret;
|
||||
}
|
||||
|
||||
void
|
||||
drw_setfontset(Drw *drw, Fnt *set)
|
||||
{
|
||||
if (drw)
|
||||
drw->fonts = set;
|
||||
}
|
||||
|
||||
void
|
||||
drw_setscheme(Drw *drw, Clr *scm)
|
||||
{
|
||||
if (drw)
|
||||
drw->scheme = scm;
|
||||
}
|
||||
|
||||
void
|
||||
drw_rect(Drw *drw, int x, int y, unsigned int w, unsigned int h, int filled, int invert)
|
||||
{
|
||||
if (!drw || !drw->scheme)
|
||||
return;
|
||||
XSetForeground(drw->dpy, drw->gc, invert ? drw->scheme[ColBg].pixel : drw->scheme[ColFg].pixel);
|
||||
if (filled)
|
||||
XFillRectangle(drw->dpy, drw->drawable, drw->gc, x, y, w, h);
|
||||
else
|
||||
XDrawRectangle(drw->dpy, drw->drawable, drw->gc, x, y, w - 1, h - 1);
|
||||
}
|
||||
|
||||
int
|
||||
drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lpad, const char *text, int invert)
|
||||
{
|
||||
char buf[1024];
|
||||
int ty;
|
||||
unsigned int ew;
|
||||
XftDraw *d = NULL;
|
||||
Fnt *usedfont, *curfont, *nextfont;
|
||||
size_t i, len;
|
||||
int utf8strlen, utf8charlen, render = x || y || w || h;
|
||||
long utf8codepoint = 0;
|
||||
const char *utf8str;
|
||||
FcCharSet *fccharset;
|
||||
FcPattern *fcpattern;
|
||||
FcPattern *match;
|
||||
XftResult result;
|
||||
int charexists = 0;
|
||||
|
||||
if (!drw || (render && !drw->scheme) || !text || !drw->fonts)
|
||||
return 0;
|
||||
|
||||
if (!render) {
|
||||
w = ~w;
|
||||
} else {
|
||||
XSetForeground(drw->dpy, drw->gc, drw->scheme[invert ? ColFg : ColBg].pixel);
|
||||
XFillRectangle(drw->dpy, drw->drawable, drw->gc, x, y, w, h);
|
||||
d = XftDrawCreate(drw->dpy, drw->drawable,
|
||||
DefaultVisual(drw->dpy, drw->screen),
|
||||
DefaultColormap(drw->dpy, drw->screen));
|
||||
x += lpad;
|
||||
w -= lpad;
|
||||
}
|
||||
|
||||
usedfont = drw->fonts;
|
||||
while (1) {
|
||||
utf8strlen = 0;
|
||||
utf8str = text;
|
||||
nextfont = NULL;
|
||||
while (*text) {
|
||||
utf8charlen = utf8decode(text, &utf8codepoint, UTF_SIZ);
|
||||
for (curfont = drw->fonts; curfont; curfont = curfont->next) {
|
||||
charexists = charexists || XftCharExists(drw->dpy, curfont->xfont, utf8codepoint);
|
||||
if (charexists) {
|
||||
if (curfont == usedfont) {
|
||||
utf8strlen += utf8charlen;
|
||||
text += utf8charlen;
|
||||
} else {
|
||||
nextfont = curfont;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!charexists || nextfont)
|
||||
break;
|
||||
else
|
||||
charexists = 0;
|
||||
}
|
||||
|
||||
if (utf8strlen) {
|
||||
drw_font_getexts(usedfont, utf8str, utf8strlen, &ew, NULL);
|
||||
/* shorten text if necessary */
|
||||
for (len = MIN(utf8strlen, sizeof(buf) - 1); len && ew > w; len--)
|
||||
drw_font_getexts(usedfont, utf8str, len, &ew, NULL);
|
||||
|
||||
if (len) {
|
||||
memcpy(buf, utf8str, len);
|
||||
buf[len] = '\0';
|
||||
if (len < utf8strlen)
|
||||
for (i = len; i && i > len - 3; buf[--i] = '.')
|
||||
; /* NOP */
|
||||
|
||||
if (render) {
|
||||
ty = y + (h - usedfont->h) / 2 + usedfont->xfont->ascent;
|
||||
XftDrawStringUtf8(d, &drw->scheme[invert ? ColBg : ColFg],
|
||||
usedfont->xfont, x, ty, (XftChar8 *)buf, len);
|
||||
}
|
||||
x += ew;
|
||||
w -= ew;
|
||||
}
|
||||
}
|
||||
|
||||
if (!*text) {
|
||||
break;
|
||||
} else if (nextfont) {
|
||||
charexists = 0;
|
||||
usedfont = nextfont;
|
||||
} else {
|
||||
/* Regardless of whether or not a fallback font is found, the
|
||||
* character must be drawn. */
|
||||
charexists = 1;
|
||||
|
||||
fccharset = FcCharSetCreate();
|
||||
FcCharSetAddChar(fccharset, utf8codepoint);
|
||||
|
||||
if (!drw->fonts->pattern) {
|
||||
/* Refer to the comment in xfont_create for more information. */
|
||||
die("the first font in the cache must be loaded from a font string.");
|
||||
}
|
||||
|
||||
fcpattern = FcPatternDuplicate(drw->fonts->pattern);
|
||||
FcPatternAddCharSet(fcpattern, FC_CHARSET, fccharset);
|
||||
FcPatternAddBool(fcpattern, FC_SCALABLE, FcTrue);
|
||||
FcPatternAddBool(fcpattern, FC_COLOR, FcFalse);
|
||||
|
||||
FcConfigSubstitute(NULL, fcpattern, FcMatchPattern);
|
||||
FcDefaultSubstitute(fcpattern);
|
||||
match = XftFontMatch(drw->dpy, drw->screen, fcpattern, &result);
|
||||
|
||||
FcCharSetDestroy(fccharset);
|
||||
FcPatternDestroy(fcpattern);
|
||||
|
||||
if (match) {
|
||||
usedfont = xfont_create(drw, NULL, match);
|
||||
if (usedfont && XftCharExists(drw->dpy, usedfont->xfont, utf8codepoint)) {
|
||||
for (curfont = drw->fonts; curfont->next; curfont = curfont->next)
|
||||
; /* NOP */
|
||||
curfont->next = usedfont;
|
||||
} else {
|
||||
xfont_free(usedfont);
|
||||
usedfont = drw->fonts;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (d)
|
||||
XftDrawDestroy(d);
|
||||
|
||||
return x + (render ? w : 0);
|
||||
}
|
||||
|
||||
void
|
||||
drw_map(Drw *drw, Window win, int x, int y, unsigned int w, unsigned int h)
|
||||
{
|
||||
if (!drw)
|
||||
return;
|
||||
|
||||
XCopyArea(drw->dpy, drw->drawable, win, drw->gc, x, y, w, h, x, y);
|
||||
XSync(drw->dpy, False);
|
||||
}
|
||||
|
||||
unsigned int
|
||||
drw_fontset_getwidth(Drw *drw, const char *text)
|
||||
{
|
||||
if (!drw || !drw->fonts || !text)
|
||||
return 0;
|
||||
return drw_text(drw, 0, 0, 0, 0, 0, text, 0);
|
||||
}
|
||||
|
||||
void
|
||||
drw_font_getexts(Fnt *font, const char *text, unsigned int len, unsigned int *w, unsigned int *h)
|
||||
{
|
||||
XGlyphInfo ext;
|
||||
|
||||
if (!font || !text)
|
||||
return;
|
||||
|
||||
XftTextExtentsUtf8(font->dpy, font->xfont, (XftChar8 *)text, len, &ext);
|
||||
if (w)
|
||||
*w = ext.xOff;
|
||||
if (h)
|
||||
*h = font->h;
|
||||
}
|
||||
|
||||
Cur *
|
||||
drw_cur_create(Drw *drw, int shape)
|
||||
{
|
||||
Cur *cur;
|
||||
|
||||
if (!drw || !(cur = ecalloc(1, sizeof(Cur))))
|
||||
return NULL;
|
||||
|
||||
cur->cursor = XCreateFontCursor(drw->dpy, shape);
|
||||
|
||||
return cur;
|
||||
}
|
||||
|
||||
void
|
||||
drw_cur_free(Drw *drw, Cur *cursor)
|
||||
{
|
||||
if (!cursor)
|
||||
return;
|
||||
|
||||
XFreeCursor(drw->dpy, cursor->cursor);
|
||||
free(cursor);
|
||||
}
|
|
@ -0,0 +1,57 @@
|
|||
/* See LICENSE file for copyright and license details. */
|
||||
|
||||
typedef struct {
|
||||
Cursor cursor;
|
||||
} Cur;
|
||||
|
||||
typedef struct Fnt {
|
||||
Display *dpy;
|
||||
unsigned int h;
|
||||
XftFont *xfont;
|
||||
FcPattern *pattern;
|
||||
struct Fnt *next;
|
||||
} Fnt;
|
||||
|
||||
enum { ColFg, ColBg }; /* Clr scheme index */
|
||||
typedef XftColor Clr;
|
||||
|
||||
typedef struct {
|
||||
unsigned int w, h;
|
||||
Display *dpy;
|
||||
int screen;
|
||||
Window root;
|
||||
Drawable drawable;
|
||||
GC gc;
|
||||
Clr *scheme;
|
||||
Fnt *fonts;
|
||||
} Drw;
|
||||
|
||||
/* Drawable abstraction */
|
||||
Drw *drw_create(Display *dpy, int screen, Window win, unsigned int w, unsigned int h);
|
||||
void drw_resize(Drw *drw, unsigned int w, unsigned int h);
|
||||
void drw_free(Drw *drw);
|
||||
|
||||
/* Fnt abstraction */
|
||||
Fnt *drw_fontset_create(Drw* drw, const char *fonts[], size_t fontcount);
|
||||
void drw_fontset_free(Fnt* set);
|
||||
unsigned int drw_fontset_getwidth(Drw *drw, const char *text);
|
||||
void drw_font_getexts(Fnt *font, const char *text, unsigned int len, unsigned int *w, unsigned int *h);
|
||||
|
||||
/* Colorscheme abstraction */
|
||||
void drw_clr_create(Drw *drw, Clr *dest, const char *clrname);
|
||||
Clr *drw_scm_create(Drw *drw, const char *clrnames[], size_t clrcount);
|
||||
|
||||
/* Cursor abstraction */
|
||||
Cur *drw_cur_create(Drw *drw, int shape);
|
||||
void drw_cur_free(Drw *drw, Cur *cursor);
|
||||
|
||||
/* Drawing context manipulation */
|
||||
void drw_setfontset(Drw *drw, Fnt *set);
|
||||
void drw_setscheme(Drw *drw, Clr *scm);
|
||||
|
||||
/* Drawing functions */
|
||||
void drw_rect(Drw *drw, int x, int y, unsigned int w, unsigned int h, int filled, int invert);
|
||||
int drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lpad, const char *text, int invert);
|
||||
|
||||
/* Map functions */
|
||||
void drw_map(Drw *drw, Window win, int x, int y, unsigned int w, unsigned int h);
|
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,90 @@
|
|||
.TH STEST 1 dmenu\-VERSION
|
||||
.SH NAME
|
||||
stest \- filter a list of files by properties
|
||||
.SH SYNOPSIS
|
||||
.B stest
|
||||
.RB [ -abcdefghlpqrsuwx ]
|
||||
.RB [ -n
|
||||
.IR file ]
|
||||
.RB [ -o
|
||||
.IR file ]
|
||||
.RI [ file ...]
|
||||
.SH DESCRIPTION
|
||||
.B stest
|
||||
takes a list of files and filters by the files' properties, analogous to
|
||||
.IR test (1).
|
||||
Files which pass all tests are printed to stdout. If no files are given, stest
|
||||
reads files from stdin.
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
.B \-a
|
||||
Test hidden files.
|
||||
.TP
|
||||
.B \-b
|
||||
Test that files are block specials.
|
||||
.TP
|
||||
.B \-c
|
||||
Test that files are character specials.
|
||||
.TP
|
||||
.B \-d
|
||||
Test that files are directories.
|
||||
.TP
|
||||
.B \-e
|
||||
Test that files exist.
|
||||
.TP
|
||||
.B \-f
|
||||
Test that files are regular files.
|
||||
.TP
|
||||
.B \-g
|
||||
Test that files have their set-group-ID flag set.
|
||||
.TP
|
||||
.B \-h
|
||||
Test that files are symbolic links.
|
||||
.TP
|
||||
.B \-l
|
||||
Test the contents of a directory given as an argument.
|
||||
.TP
|
||||
.BI \-n " file"
|
||||
Test that files are newer than
|
||||
.IR file .
|
||||
.TP
|
||||
.BI \-o " file"
|
||||
Test that files are older than
|
||||
.IR file .
|
||||
.TP
|
||||
.B \-p
|
||||
Test that files are named pipes.
|
||||
.TP
|
||||
.B \-q
|
||||
No files are printed, only the exit status is returned.
|
||||
.TP
|
||||
.B \-r
|
||||
Test that files are readable.
|
||||
.TP
|
||||
.B \-s
|
||||
Test that files are not empty.
|
||||
.TP
|
||||
.B \-u
|
||||
Test that files have their set-user-ID flag set.
|
||||
.TP
|
||||
.B \-v
|
||||
Invert the sense of tests, only failing files pass.
|
||||
.TP
|
||||
.B \-w
|
||||
Test that files are writable.
|
||||
.TP
|
||||
.B \-x
|
||||
Test that files are executable.
|
||||
.SH EXIT STATUS
|
||||
.TP
|
||||
.B 0
|
||||
At least one file passed all tests.
|
||||
.TP
|
||||
.B 1
|
||||
No files passed all tests.
|
||||
.TP
|
||||
.B 2
|
||||
An error occurred.
|
||||
.SH SEE ALSO
|
||||
.IR dmenu (1),
|
||||
.IR test (1)
|
|
@ -0,0 +1,109 @@
|
|||
/* See LICENSE file for copyright and license details. */
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include <dirent.h>
|
||||
#include <limits.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "arg.h"
|
||||
char *argv0;
|
||||
|
||||
#define FLAG(x) (flag[(x)-'a'])
|
||||
|
||||
static void test(const char *, const char *);
|
||||
static void usage(void);
|
||||
|
||||
static int match = 0;
|
||||
static int flag[26];
|
||||
static struct stat old, new;
|
||||
|
||||
static void
|
||||
test(const char *path, const char *name)
|
||||
{
|
||||
struct stat st, ln;
|
||||
|
||||
if ((!stat(path, &st) && (FLAG('a') || name[0] != '.') /* hidden files */
|
||||
&& (!FLAG('b') || S_ISBLK(st.st_mode)) /* block special */
|
||||
&& (!FLAG('c') || S_ISCHR(st.st_mode)) /* character special */
|
||||
&& (!FLAG('d') || S_ISDIR(st.st_mode)) /* directory */
|
||||
&& (!FLAG('e') || access(path, F_OK) == 0) /* exists */
|
||||
&& (!FLAG('f') || S_ISREG(st.st_mode)) /* regular file */
|
||||
&& (!FLAG('g') || st.st_mode & S_ISGID) /* set-group-id flag */
|
||||
&& (!FLAG('h') || (!lstat(path, &ln) && S_ISLNK(ln.st_mode))) /* symbolic link */
|
||||
&& (!FLAG('n') || st.st_mtime > new.st_mtime) /* newer than file */
|
||||
&& (!FLAG('o') || st.st_mtime < old.st_mtime) /* older than file */
|
||||
&& (!FLAG('p') || S_ISFIFO(st.st_mode)) /* named pipe */
|
||||
&& (!FLAG('r') || access(path, R_OK) == 0) /* readable */
|
||||
&& (!FLAG('s') || st.st_size > 0) /* not empty */
|
||||
&& (!FLAG('u') || st.st_mode & S_ISUID) /* set-user-id flag */
|
||||
&& (!FLAG('w') || access(path, W_OK) == 0) /* writable */
|
||||
&& (!FLAG('x') || access(path, X_OK) == 0)) != FLAG('v')) { /* executable */
|
||||
if (FLAG('q'))
|
||||
exit(0);
|
||||
match = 1;
|
||||
puts(name);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
usage(void)
|
||||
{
|
||||
fprintf(stderr, "usage: %s [-abcdefghlpqrsuvwx] "
|
||||
"[-n file] [-o file] [file...]\n", argv0);
|
||||
exit(2); /* like test(1) return > 1 on error */
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
struct dirent *d;
|
||||
char path[PATH_MAX], *line = NULL, *file;
|
||||
size_t linesiz = 0;
|
||||
ssize_t n;
|
||||
DIR *dir;
|
||||
int r;
|
||||
|
||||
ARGBEGIN {
|
||||
case 'n': /* newer than file */
|
||||
case 'o': /* older than file */
|
||||
file = EARGF(usage());
|
||||
if (!(FLAG(ARGC()) = !stat(file, (ARGC() == 'n' ? &new : &old))))
|
||||
perror(file);
|
||||
break;
|
||||
default:
|
||||
/* miscellaneous operators */
|
||||
if (strchr("abcdefghlpqrsuvwx", ARGC()))
|
||||
FLAG(ARGC()) = 1;
|
||||
else
|
||||
usage(); /* unknown flag */
|
||||
} ARGEND;
|
||||
|
||||
if (!argc) {
|
||||
/* read list from stdin */
|
||||
while ((n = getline(&line, &linesiz, stdin)) > 0) {
|
||||
if (n && line[n - 1] == '\n')
|
||||
line[n - 1] = '\0';
|
||||
test(line, line);
|
||||
}
|
||||
free(line);
|
||||
} else {
|
||||
for (; argc; argc--, argv++) {
|
||||
if (FLAG('l') && (dir = opendir(*argv))) {
|
||||
/* test directory contents */
|
||||
while ((d = readdir(dir))) {
|
||||
r = snprintf(path, sizeof path, "%s/%s",
|
||||
*argv, d->d_name);
|
||||
if (r >= 0 && (size_t)r < sizeof path)
|
||||
test(path, d->d_name);
|
||||
}
|
||||
closedir(dir);
|
||||
} else {
|
||||
test(*argv, *argv);
|
||||
}
|
||||
}
|
||||
}
|
||||
return match ? 0 : 1;
|
||||
}
|
Binary file not shown.
|
@ -0,0 +1,35 @@
|
|||
/* See LICENSE file for copyright and license details. */
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "util.h"
|
||||
|
||||
void *
|
||||
ecalloc(size_t nmemb, size_t size)
|
||||
{
|
||||
void *p;
|
||||
|
||||
if (!(p = calloc(nmemb, size)))
|
||||
die("calloc:");
|
||||
return p;
|
||||
}
|
||||
|
||||
void
|
||||
die(const char *fmt, ...) {
|
||||
va_list ap;
|
||||
|
||||
va_start(ap, fmt);
|
||||
vfprintf(stderr, fmt, ap);
|
||||
va_end(ap);
|
||||
|
||||
if (fmt[0] && fmt[strlen(fmt)-1] == ':') {
|
||||
fputc(' ', stderr);
|
||||
perror(NULL);
|
||||
} else {
|
||||
fputc('\n', stderr);
|
||||
}
|
||||
|
||||
exit(1);
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
/* See LICENSE file for copyright and license details. */
|
||||
|
||||
#define MAX(A, B) ((A) > (B) ? (A) : (B))
|
||||
#define MIN(A, B) ((A) < (B) ? (A) : (B))
|
||||
#define BETWEEN(X, A, B) ((A) <= (X) && (X) <= (B))
|
||||
|
||||
void die(const char *fmt, ...);
|
||||
void *ecalloc(size_t nmemb, size_t size);
|
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,37 @@
|
|||
MIT/X Consortium License
|
||||
|
||||
© 2006-2019 Anselm R Garbe <anselm@garbe.ca>
|
||||
© 2006-2009 Jukka Salmi <jukka at salmi dot ch>
|
||||
© 2006-2007 Sander van Dijk <a dot h dot vandijk at gmail dot com>
|
||||
© 2007-2011 Peter Hartlich <sgkkr at hartlich dot com>
|
||||
© 2007-2009 Szabolcs Nagy <nszabolcs at gmail dot com>
|
||||
© 2007-2009 Christof Musik <christof at sendfax dot de>
|
||||
© 2007-2009 Premysl Hruby <dfenze at gmail dot com>
|
||||
© 2007-2008 Enno Gottox Boland <gottox at s01 dot de>
|
||||
© 2008 Martin Hurton <martin dot hurton at gmail dot com>
|
||||
© 2008 Neale Pickett <neale dot woozle dot org>
|
||||
© 2009 Mate Nagy <mnagy at port70 dot net>
|
||||
© 2010-2016 Hiltjo Posthuma <hiltjo@codemadness.org>
|
||||
© 2010-2012 Connor Lane Smith <cls@lubutu.com>
|
||||
© 2011 Christoph Lohmann <20h@r-36.net>
|
||||
© 2015-2016 Quentin Rameau <quinq@fifth.space>
|
||||
© 2015-2016 Eric Pruitt <eric.pruitt@gmail.com>
|
||||
© 2016-2017 Markus Teich <markus.teich@stusta.mhn.de>
|
||||
|
||||
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.
|
|
@ -0,0 +1,51 @@
|
|||
# dwm - dynamic window manager
|
||||
# See LICENSE file for copyright and license details.
|
||||
|
||||
include config.mk
|
||||
|
||||
SRC = drw.c dwm.c util.c
|
||||
OBJ = ${SRC:.c=.o}
|
||||
|
||||
all: options dwm
|
||||
|
||||
options:
|
||||
@echo dwm build options:
|
||||
@echo "CFLAGS = ${CFLAGS}"
|
||||
@echo "LDFLAGS = ${LDFLAGS}"
|
||||
@echo "CC = ${CC}"
|
||||
|
||||
.c.o:
|
||||
${CC} -c ${CFLAGS} $<
|
||||
|
||||
${OBJ}: config.h config.mk
|
||||
|
||||
config.h:
|
||||
cp config.def.h $@
|
||||
|
||||
dwm: ${OBJ}
|
||||
${CC} -o $@ ${OBJ} ${LDFLAGS}
|
||||
|
||||
clean:
|
||||
rm -f dwm ${OBJ} dwm-${VERSION}.tar.gz
|
||||
|
||||
dist: clean
|
||||
mkdir -p dwm-${VERSION}
|
||||
cp -R LICENSE Makefile README config.def.h config.mk\
|
||||
dwm.1 drw.h util.h ${SRC} dwm.png transient.c dwm-${VERSION}
|
||||
tar -cf dwm-${VERSION}.tar dwm-${VERSION}
|
||||
gzip dwm-${VERSION}.tar
|
||||
rm -rf dwm-${VERSION}
|
||||
|
||||
install: all
|
||||
mkdir -p ${DESTDIR}${PREFIX}/bin
|
||||
cp -f dwm ${DESTDIR}${PREFIX}/bin
|
||||
chmod 755 ${DESTDIR}${PREFIX}/bin/dwm
|
||||
mkdir -p ${DESTDIR}${MANPREFIX}/man1
|
||||
sed "s/VERSION/${VERSION}/g" < dwm.1 > ${DESTDIR}${MANPREFIX}/man1/dwm.1
|
||||
chmod 644 ${DESTDIR}${MANPREFIX}/man1/dwm.1
|
||||
|
||||
uninstall:
|
||||
rm -f ${DESTDIR}${PREFIX}/bin/dwm\
|
||||
${DESTDIR}${MANPREFIX}/man1/dwm.1
|
||||
|
||||
.PHONY: all options clean dist install uninstall
|
|
@ -0,0 +1,48 @@
|
|||
dwm - dynamic window manager
|
||||
============================
|
||||
dwm is an extremely fast, small, and dynamic window manager for X.
|
||||
|
||||
|
||||
Requirements
|
||||
------------
|
||||
In order to build dwm you need the Xlib header files.
|
||||
|
||||
|
||||
Installation
|
||||
------------
|
||||
Edit config.mk to match your local setup (dwm is installed into
|
||||
the /usr/local namespace by default).
|
||||
|
||||
Afterwards enter the following command to build and install dwm (if
|
||||
necessary as root):
|
||||
|
||||
make clean install
|
||||
|
||||
|
||||
Running dwm
|
||||
-----------
|
||||
Add the following line to your .xinitrc to start dwm using startx:
|
||||
|
||||
exec dwm
|
||||
|
||||
In order to connect dwm to a specific display, make sure that
|
||||
the DISPLAY environment variable is set correctly, e.g.:
|
||||
|
||||
DISPLAY=foo.bar:1 exec dwm
|
||||
|
||||
(This will start dwm on display :1 of the host foo.bar.)
|
||||
|
||||
In order to display status info in the bar, you can do something
|
||||
like this in your .xinitrc:
|
||||
|
||||
while xsetroot -name "`date` `uptime | sed 's/.*,//'`"
|
||||
do
|
||||
sleep 1
|
||||
done &
|
||||
exec dwm
|
||||
|
||||
|
||||
Configuration
|
||||
-------------
|
||||
The configuration of dwm is done by creating a custom config.h
|
||||
and (re)compiling the source code.
|
|
@ -0,0 +1,139 @@
|
|||
/* See LICENSE file for copyright and license details. */
|
||||
|
||||
/* appearance */
|
||||
static const unsigned int borderpx = 2; /* border pixel of windows */
|
||||
static const unsigned int snap = 32; /* snap pixel */
|
||||
static const unsigned int gappih = 6; /* horiz inner gap between windows */
|
||||
static const unsigned int gappiv = 6; /* vert inner gap between windows */
|
||||
static const unsigned int gappoh = 6; /* horiz outer gap between windows and screen edge */
|
||||
static const unsigned int gappov = 6; /* vert outer gap between windows and screen edge */
|
||||
static const int smartgaps = 1; /* 1 means no outer gap when there is only one window */
|
||||
static const int showbar = 1; /* 0 means no bar */
|
||||
static const int topbar = 1; /* 0 means bottom bar */
|
||||
static const char *fonts[] = { "monospace:size=10" };
|
||||
static const char dmenufont[] = "monospace:size=10";
|
||||
static const char col_gray1[] = "#222222";
|
||||
static const char col_gray2[] = "#444444";
|
||||
static const char col_gray3[] = "#bbbbbb";
|
||||
static const char col_gray4[] = "#eeeeee";
|
||||
static const char col_cyan[] = "#005577";
|
||||
static const char col_green[] = "#28ef36";
|
||||
static const char *colors[][3] = {
|
||||
/* fg bg border */
|
||||
[SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
|
||||
[SchemeSel] = { col_gray4, col_cyan, col_cyan },
|
||||
};
|
||||
|
||||
/* tagging */
|
||||
static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
|
||||
|
||||
static const Rule rules[] = {
|
||||
/* xprop(1):
|
||||
* WM_CLASS(STRING) = instance, class
|
||||
* WM_NAME(STRING) = title
|
||||
*/
|
||||
/* class instance title tags mask isfloating monitor */
|
||||
{ "Gimp", NULL, NULL, 0, 1, -1 },
|
||||
{ "Firefox", NULL, NULL, 1 << 8, 0, -1 },
|
||||
{ "TelegramDesktop", NULL, NULL, 1 << 6, 0, -1 },
|
||||
{ "Workrave", NULL, NULL, ~0, 1, -1 },
|
||||
};
|
||||
|
||||
/* layout(s) */
|
||||
static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */
|
||||
static const int nmaster = 1; /* number of clients in master area */
|
||||
static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */
|
||||
|
||||
static const Layout layouts[] = {
|
||||
/* symbol arrange function */
|
||||
{ "[]=", tile }, /* first entry is default */
|
||||
{ "><>", NULL }, /* no layout function means floating behavior */
|
||||
{ "[M]", monocle },
|
||||
};
|
||||
|
||||
/* key definitions */
|
||||
#define MODKEY Mod1Mask
|
||||
#define TAGKEYS(KEY,TAG) \
|
||||
{ MODKEY, KEY, view, {.ui = 1 << TAG} }, \
|
||||
{ MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
|
||||
{ MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \
|
||||
{ MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} },
|
||||
|
||||
/* helper for spawning shell commands in the pre dwm-5.0 fashion */
|
||||
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
|
||||
|
||||
/* commands */
|
||||
static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
|
||||
static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL };
|
||||
static const char *termcmd[] = { "st", NULL };
|
||||
|
||||
static Key keys[] = {
|
||||
/* modifier key function argument */
|
||||
{ MODKEY, XK_p, spawn, {.v = dmenucmd } },
|
||||
{ MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
|
||||
{ MODKEY, XK_b, togglebar, {0} },
|
||||
{ MODKEY, XK_j, focusstack, {.i = +1 } },
|
||||
{ MODKEY, XK_k, focusstack, {.i = -1 } },
|
||||
{ MODKEY, XK_i, incnmaster, {.i = +1 } },
|
||||
{ MODKEY, XK_d, incnmaster, {.i = -1 } },
|
||||
{ MODKEY, XK_h, setmfact, {.f = -0.05} },
|
||||
{ MODKEY, XK_l, setmfact, {.f = +0.05} },
|
||||
{ MODKEY|Mod4Mask, XK_h, incrgaps, {.i = +1 } },
|
||||
{ MODKEY|Mod4Mask, XK_l, incrgaps, {.i = -1 } },
|
||||
{ MODKEY|Mod4Mask|ShiftMask, XK_h, incrogaps, {.i = +1 } },
|
||||
{ MODKEY|Mod4Mask|ShiftMask, XK_l, incrogaps, {.i = -1 } },
|
||||
{ MODKEY|Mod4Mask|ControlMask, XK_h, incrigaps, {.i = +1 } },
|
||||
{ MODKEY|Mod4Mask|ControlMask, XK_l, incrigaps, {.i = -1 } },
|
||||
{ MODKEY|Mod4Mask, XK_0, togglegaps, {0} },
|
||||
{ MODKEY|Mod4Mask|ShiftMask, XK_0, defaultgaps, {0} },
|
||||
{ MODKEY, XK_y, incrihgaps, {.i = +1 } },
|
||||
{ MODKEY, XK_o, incrihgaps, {.i = -1 } },
|
||||
{ MODKEY|ControlMask, XK_y, incrivgaps, {.i = +1 } },
|
||||
{ MODKEY|ControlMask, XK_o, incrivgaps, {.i = -1 } },
|
||||
{ MODKEY|Mod4Mask, XK_y, incrohgaps, {.i = +1 } },
|
||||
{ MODKEY|Mod4Mask, XK_o, incrohgaps, {.i = -1 } },
|
||||
{ MODKEY|ShiftMask, XK_y, incrovgaps, {.i = +1 } },
|
||||
{ MODKEY|ShiftMask, XK_o, incrovgaps, {.i = -1 } },
|
||||
{ MODKEY, XK_Return, zoom, {0} },
|
||||
{ MODKEY, XK_Tab, view, {0} },
|
||||
{ MODKEY|ShiftMask, XK_c, killclient, {0} },
|
||||
{ MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
|
||||
{ MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
|
||||
{ MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
|
||||
{ MODKEY, XK_space, setlayout, {0} },
|
||||
{ MODKEY|ShiftMask, XK_space, togglefloating, {0} },
|
||||
{ MODKEY, XK_0, view, {.ui = ~0 } },
|
||||
{ MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
|
||||
{ MODKEY, XK_comma, focusmon, {.i = -1 } },
|
||||
{ MODKEY, XK_period, focusmon, {.i = +1 } },
|
||||
{ MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
|
||||
{ MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
|
||||
TAGKEYS( XK_1, 0)
|
||||
TAGKEYS( XK_2, 1)
|
||||
TAGKEYS( XK_3, 2)
|
||||
TAGKEYS( XK_4, 3)
|
||||
TAGKEYS( XK_5, 4)
|
||||
TAGKEYS( XK_6, 5)
|
||||
TAGKEYS( XK_7, 6)
|
||||
TAGKEYS( XK_8, 7)
|
||||
TAGKEYS( XK_9, 8)
|
||||
{ MODKEY|ShiftMask, XK_q, quit, {0} },
|
||||
};
|
||||
|
||||
/* button definitions */
|
||||
/* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
|
||||
static Button buttons[] = {
|
||||
/* click event mask button function argument */
|
||||
{ ClkLtSymbol, 0, Button1, setlayout, {0} },
|
||||
{ ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} },
|
||||
{ ClkWinTitle, 0, Button2, zoom, {0} },
|
||||
{ ClkStatusText, 0, Button2, spawn, {.v = termcmd } },
|
||||
{ ClkClientWin, MODKEY, Button1, movemouse, {0} },
|
||||
{ ClkClientWin, MODKEY, Button2, togglefloating, {0} },
|
||||
{ ClkClientWin, MODKEY, Button3, resizemouse, {0} },
|
||||
{ ClkTagBar, 0, Button1, view, {0} },
|
||||
{ ClkTagBar, 0, Button3, toggleview, {0} },
|
||||
{ ClkTagBar, MODKEY, Button1, tag, {0} },
|
||||
{ ClkTagBar, MODKEY, Button3, toggletag, {0} },
|
||||
};
|
||||
|
|
@ -0,0 +1,139 @@
|
|||
/* See LICENSE file for copyright and license details. */
|
||||
|
||||
/* appearance */
|
||||
static const unsigned int borderpx = 2; /* border pixel of windows */
|
||||
static const unsigned int snap = 32; /* snap pixel */
|
||||
static const unsigned int gappih = 6; /* horiz inner gap between windows */
|
||||
static const unsigned int gappiv = 6; /* vert inner gap between windows */
|
||||
static const unsigned int gappoh = 6; /* horiz outer gap between windows and screen edge */
|
||||
static const unsigned int gappov = 6; /* vert outer gap between windows and screen edge */
|
||||
static const int smartgaps = 1; /* 1 means no outer gap when there is only one window */
|
||||
static const int showbar = 1; /* 0 means no bar */
|
||||
static const int topbar = 1; /* 0 means bottom bar */
|
||||
static const char *fonts[] = { "monospace:size=10" };
|
||||
static const char dmenufont[] = "monospace:size=10";
|
||||
static const char col_gray1[] = "#222222";
|
||||
static const char col_gray2[] = "#444444";
|
||||
static const char col_gray3[] = "#bbbbbb";
|
||||
static const char col_gray4[] = "#eeeeee";
|
||||
static const char col_cyan[] = "#005577";
|
||||
static const char col_green[] = "#28ef36";
|
||||
static const char *colors[][3] = {
|
||||
/* fg bg border */
|
||||
[SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
|
||||
[SchemeSel] = { col_gray4, col_cyan, col_cyan },
|
||||
};
|
||||
|
||||
/* tagging */
|
||||
static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
|
||||
|
||||
static const Rule rules[] = {
|
||||
/* xprop(1):
|
||||
* WM_CLASS(STRING) = instance, class
|
||||
* WM_NAME(STRING) = title
|
||||
*/
|
||||
/* class instance title tags mask isfloating monitor */
|
||||
{ "Gimp", NULL, NULL, 0, 1, -1 },
|
||||
{ "Firefox", NULL, NULL, 1 << 8, 0, -1 },
|
||||
{ "TelegramDesktop", NULL, NULL, 1 << 6, 0, -1 },
|
||||
{ "Workrave", NULL, NULL, ~0, 1, -1 },
|
||||
};
|
||||
|
||||
/* layout(s) */
|
||||
static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */
|
||||
static const int nmaster = 1; /* number of clients in master area */
|
||||
static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */
|
||||
|
||||
static const Layout layouts[] = {
|
||||
/* symbol arrange function */
|
||||
{ "[]=", tile }, /* first entry is default */
|
||||
{ "><>", NULL }, /* no layout function means floating behavior */
|
||||
{ "[M]", monocle },
|
||||
};
|
||||
|
||||
/* key definitions */
|
||||
#define MODKEY Mod1Mask
|
||||
#define TAGKEYS(KEY,TAG) \
|
||||
{ MODKEY, KEY, view, {.ui = 1 << TAG} }, \
|
||||
{ MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
|
||||
{ MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \
|
||||
{ MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} },
|
||||
|
||||
/* helper for spawning shell commands in the pre dwm-5.0 fashion */
|
||||
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
|
||||
|
||||
/* commands */
|
||||
static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
|
||||
static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL };
|
||||
static const char *termcmd[] = { "st", NULL };
|
||||
|
||||
static Key keys[] = {
|
||||
/* modifier key function argument */
|
||||
{ MODKEY, XK_p, spawn, {.v = dmenucmd } },
|
||||
{ MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
|
||||
{ MODKEY, XK_b, togglebar, {0} },
|
||||
{ MODKEY, XK_j, focusstack, {.i = +1 } },
|
||||
{ MODKEY, XK_k, focusstack, {.i = -1 } },
|
||||
{ MODKEY, XK_i, incnmaster, {.i = +1 } },
|
||||
{ MODKEY, XK_d, incnmaster, {.i = -1 } },
|
||||
{ MODKEY, XK_h, setmfact, {.f = -0.05} },
|
||||
{ MODKEY, XK_l, setmfact, {.f = +0.05} },
|
||||
{ MODKEY|Mod4Mask, XK_h, incrgaps, {.i = +1 } },
|
||||
{ MODKEY|Mod4Mask, XK_l, incrgaps, {.i = -1 } },
|
||||
{ MODKEY|Mod4Mask|ShiftMask, XK_h, incrogaps, {.i = +1 } },
|
||||
{ MODKEY|Mod4Mask|ShiftMask, XK_l, incrogaps, {.i = -1 } },
|
||||
{ MODKEY|Mod4Mask|ControlMask, XK_h, incrigaps, {.i = +1 } },
|
||||
{ MODKEY|Mod4Mask|ControlMask, XK_l, incrigaps, {.i = -1 } },
|
||||
{ MODKEY|Mod4Mask, XK_0, togglegaps, {0} },
|
||||
{ MODKEY|Mod4Mask|ShiftMask, XK_0, defaultgaps, {0} },
|
||||
{ MODKEY, XK_y, incrihgaps, {.i = +1 } },
|
||||
{ MODKEY, XK_o, incrihgaps, {.i = -1 } },
|
||||
{ MODKEY|ControlMask, XK_y, incrivgaps, {.i = +1 } },
|
||||
{ MODKEY|ControlMask, XK_o, incrivgaps, {.i = -1 } },
|
||||
{ MODKEY|Mod4Mask, XK_y, incrohgaps, {.i = +1 } },
|
||||
{ MODKEY|Mod4Mask, XK_o, incrohgaps, {.i = -1 } },
|
||||
{ MODKEY|ShiftMask, XK_y, incrovgaps, {.i = +1 } },
|
||||
{ MODKEY|ShiftMask, XK_o, incrovgaps, {.i = -1 } },
|
||||
{ MODKEY, XK_Return, zoom, {0} },
|
||||
{ MODKEY, XK_Tab, view, {0} },
|
||||
{ MODKEY|ShiftMask, XK_c, killclient, {0} },
|
||||
{ MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
|
||||
{ MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
|
||||
{ MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
|
||||
{ MODKEY, XK_space, setlayout, {0} },
|
||||
{ MODKEY|ShiftMask, XK_space, togglefloating, {0} },
|
||||
{ MODKEY, XK_0, view, {.ui = ~0 } },
|
||||
{ MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
|
||||
{ MODKEY, XK_comma, focusmon, {.i = -1 } },
|
||||
{ MODKEY, XK_period, focusmon, {.i = +1 } },
|
||||
{ MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
|
||||
{ MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
|
||||
TAGKEYS( XK_1, 0)
|
||||
TAGKEYS( XK_2, 1)
|
||||
TAGKEYS( XK_3, 2)
|
||||
TAGKEYS( XK_4, 3)
|
||||
TAGKEYS( XK_5, 4)
|
||||
TAGKEYS( XK_6, 5)
|
||||
TAGKEYS( XK_7, 6)
|
||||
TAGKEYS( XK_8, 7)
|
||||
TAGKEYS( XK_9, 8)
|
||||
{ MODKEY|ShiftMask, XK_q, quit, {0} },
|
||||
};
|
||||
|
||||
/* button definitions */
|
||||
/* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
|
||||
static Button buttons[] = {
|
||||
/* click event mask button function argument */
|
||||
{ ClkLtSymbol, 0, Button1, setlayout, {0} },
|
||||
{ ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} },
|
||||
{ ClkWinTitle, 0, Button2, zoom, {0} },
|
||||
{ ClkStatusText, 0, Button2, spawn, {.v = termcmd } },
|
||||
{ ClkClientWin, MODKEY, Button1, movemouse, {0} },
|
||||
{ ClkClientWin, MODKEY, Button2, togglefloating, {0} },
|
||||
{ ClkClientWin, MODKEY, Button3, resizemouse, {0} },
|
||||
{ ClkTagBar, 0, Button1, view, {0} },
|
||||
{ ClkTagBar, 0, Button3, toggleview, {0} },
|
||||
{ ClkTagBar, MODKEY, Button1, tag, {0} },
|
||||
{ ClkTagBar, MODKEY, Button3, toggletag, {0} },
|
||||
};
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
# dwm version
|
||||
VERSION = 6.2
|
||||
|
||||
# Customize below to fit your system
|
||||
|
||||
# paths
|
||||
PREFIX = /usr/local
|
||||
MANPREFIX = ${PREFIX}/share/man
|
||||
|
||||
X11INC = /usr/X11R6/include
|
||||
X11LIB = /usr/X11R6/lib
|
||||
|
||||
# Xinerama, comment if you don't want it
|
||||
XINERAMALIBS = -lXinerama
|
||||
XINERAMAFLAGS = -DXINERAMA
|
||||
|
||||
# freetype
|
||||
FREETYPELIBS = -lfontconfig -lXft
|
||||
FREETYPEINC = /usr/include/freetype2
|
||||
# OpenBSD (uncomment)
|
||||
#FREETYPEINC = ${X11INC}/freetype2
|
||||
|
||||
# includes and libs
|
||||
INCS = -I${X11INC} -I${FREETYPEINC}
|
||||
LIBS = -L${X11LIB} -lX11 ${XINERAMALIBS} ${FREETYPELIBS}
|
||||
|
||||
# flags
|
||||
CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=2 -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS}
|
||||
#CFLAGS = -g -std=c99 -pedantic -Wall -O0 ${INCS} ${CPPFLAGS}
|
||||
CFLAGS = -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os ${INCS} ${CPPFLAGS}
|
||||
LDFLAGS = ${LIBS}
|
||||
|
||||
# Solaris
|
||||
#CFLAGS = -fast ${INCS} -DVERSION=\"${VERSION}\"
|
||||
#LDFLAGS = ${LIBS}
|
||||
|
||||
# compiler and linker
|
||||
CC = cc
|
|
@ -0,0 +1,435 @@
|
|||
/* See LICENSE file for copyright and license details. */
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xft/Xft.h>
|
||||
|
||||
#include "drw.h"
|
||||
#include "util.h"
|
||||
|
||||
#define UTF_INVALID 0xFFFD
|
||||
#define UTF_SIZ 4
|
||||
|
||||
static const unsigned char utfbyte[UTF_SIZ + 1] = {0x80, 0, 0xC0, 0xE0, 0xF0};
|
||||
static const unsigned char utfmask[UTF_SIZ + 1] = {0xC0, 0x80, 0xE0, 0xF0, 0xF8};
|
||||
static const long utfmin[UTF_SIZ + 1] = { 0, 0, 0x80, 0x800, 0x10000};
|
||||
static const long utfmax[UTF_SIZ + 1] = {0x10FFFF, 0x7F, 0x7FF, 0xFFFF, 0x10FFFF};
|
||||
|
||||
static long
|
||||
utf8decodebyte(const char c, size_t *i)
|
||||
{
|
||||
for (*i = 0; *i < (UTF_SIZ + 1); ++(*i))
|
||||
if (((unsigned char)c & utfmask[*i]) == utfbyte[*i])
|
||||
return (unsigned char)c & ~utfmask[*i];
|
||||
return 0;
|
||||
}
|
||||
|
||||
static size_t
|
||||
utf8validate(long *u, size_t i)
|
||||
{
|
||||
if (!BETWEEN(*u, utfmin[i], utfmax[i]) || BETWEEN(*u, 0xD800, 0xDFFF))
|
||||
*u = UTF_INVALID;
|
||||
for (i = 1; *u > utfmax[i]; ++i)
|
||||
;
|
||||
return i;
|
||||
}
|
||||
|
||||
static size_t
|
||||
utf8decode(const char *c, long *u, size_t clen)
|
||||
{
|
||||
size_t i, j, len, type;
|
||||
long udecoded;
|
||||
|
||||
*u = UTF_INVALID;
|
||||
if (!clen)
|
||||
return 0;
|
||||
udecoded = utf8decodebyte(c[0], &len);
|
||||
if (!BETWEEN(len, 1, UTF_SIZ))
|
||||
return 1;
|
||||
for (i = 1, j = 1; i < clen && j < len; ++i, ++j) {
|
||||
udecoded = (udecoded << 6) | utf8decodebyte(c[i], &type);
|
||||
if (type)
|
||||
return j;
|
||||
}
|
||||
if (j < len)
|
||||
return 0;
|
||||
*u = udecoded;
|
||||
utf8validate(u, len);
|
||||
|
||||
return len;
|
||||
}
|
||||
|
||||
Drw *
|
||||
drw_create(Display *dpy, int screen, Window root, unsigned int w, unsigned int h)
|
||||
{
|
||||
Drw *drw = ecalloc(1, sizeof(Drw));
|
||||
|
||||
drw->dpy = dpy;
|
||||
drw->screen = screen;
|
||||
drw->root = root;
|
||||
drw->w = w;
|
||||
drw->h = h;
|
||||
drw->drawable = XCreatePixmap(dpy, root, w, h, DefaultDepth(dpy, screen));
|
||||
drw->gc = XCreateGC(dpy, root, 0, NULL);
|
||||
XSetLineAttributes(dpy, drw->gc, 1, LineSolid, CapButt, JoinMiter);
|
||||
|
||||
return drw;
|
||||
}
|
||||
|
||||
void
|
||||
drw_resize(Drw *drw, unsigned int w, unsigned int h)
|
||||
{
|
||||
if (!drw)
|
||||
return;
|
||||
|
||||
drw->w = w;
|
||||
drw->h = h;
|
||||
if (drw->drawable)
|
||||
XFreePixmap(drw->dpy, drw->drawable);
|
||||
drw->drawable = XCreatePixmap(drw->dpy, drw->root, w, h, DefaultDepth(drw->dpy, drw->screen));
|
||||
}
|
||||
|
||||
void
|
||||
drw_free(Drw *drw)
|
||||
{
|
||||
XFreePixmap(drw->dpy, drw->drawable);
|
||||
XFreeGC(drw->dpy, drw->gc);
|
||||
free(drw);
|
||||
}
|
||||
|
||||
/* This function is an implementation detail. Library users should use
|
||||
* drw_fontset_create instead.
|
||||
*/
|
||||
static Fnt *
|
||||
xfont_create(Drw *drw, const char *fontname, FcPattern *fontpattern)
|
||||
{
|
||||
Fnt *font;
|
||||
XftFont *xfont = NULL;
|
||||
FcPattern *pattern = NULL;
|
||||
|
||||
if (fontname) {
|
||||
/* Using the pattern found at font->xfont->pattern does not yield the
|
||||
* same substitution results as using the pattern returned by
|
||||
* FcNameParse; using the latter results in the desired fallback
|
||||
* behaviour whereas the former just results in missing-character
|
||||
* rectangles being drawn, at least with some fonts. */
|
||||
if (!(xfont = XftFontOpenName(drw->dpy, drw->screen, fontname))) {
|
||||
fprintf(stderr, "error, cannot load font from name: '%s'\n", fontname);
|
||||
return NULL;
|
||||
}
|
||||
if (!(pattern = FcNameParse((FcChar8 *) fontname))) {
|
||||
fprintf(stderr, "error, cannot parse font name to pattern: '%s'\n", fontname);
|
||||
XftFontClose(drw->dpy, xfont);
|
||||
return NULL;
|
||||
}
|
||||
} else if (fontpattern) {
|
||||
if (!(xfont = XftFontOpenPattern(drw->dpy, fontpattern))) {
|
||||
fprintf(stderr, "error, cannot load font from pattern.\n");
|
||||
return NULL;
|
||||
}
|
||||
} else {
|
||||
die("no font specified.");
|
||||
}
|
||||
|
||||
/* Do not allow using color fonts. This is a workaround for a BadLength
|
||||
* error from Xft with color glyphs. Modelled on the Xterm workaround. See
|
||||
* https://bugzilla.redhat.com/show_bug.cgi?id=1498269
|
||||
* https://lists.suckless.org/dev/1701/30932.html
|
||||
* https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=916349
|
||||
* and lots more all over the internet.
|
||||
*/
|
||||
FcBool iscol;
|
||||
if(FcPatternGetBool(xfont->pattern, FC_COLOR, 0, &iscol) == FcResultMatch && iscol) {
|
||||
XftFontClose(drw->dpy, xfont);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
font = ecalloc(1, sizeof(Fnt));
|
||||
font->xfont = xfont;
|
||||
font->pattern = pattern;
|
||||
font->h = xfont->ascent + xfont->descent;
|
||||
font->dpy = drw->dpy;
|
||||
|
||||
return font;
|
||||
}
|
||||
|
||||
static void
|
||||
xfont_free(Fnt *font)
|
||||
{
|
||||
if (!font)
|
||||
return;
|
||||
if (font->pattern)
|
||||
FcPatternDestroy(font->pattern);
|
||||
XftFontClose(font->dpy, font->xfont);
|
||||
free(font);
|
||||
}
|
||||
|
||||
Fnt*
|
||||
drw_fontset_create(Drw* drw, const char *fonts[], size_t fontcount)
|
||||
{
|
||||
Fnt *cur, *ret = NULL;
|
||||
size_t i;
|
||||
|
||||
if (!drw || !fonts)
|
||||
return NULL;
|
||||
|
||||
for (i = 1; i <= fontcount; i++) {
|
||||
if ((cur = xfont_create(drw, fonts[fontcount - i], NULL))) {
|
||||
cur->next = ret;
|
||||
ret = cur;
|
||||
}
|
||||
}
|
||||
return (drw->fonts = ret);
|
||||
}
|
||||
|
||||
void
|
||||
drw_fontset_free(Fnt *font)
|
||||
{
|
||||
if (font) {
|
||||
drw_fontset_free(font->next);
|
||||
xfont_free(font);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
drw_clr_create(Drw *drw, Clr *dest, const char *clrname)
|
||||
{
|
||||
if (!drw || !dest || !clrname)
|
||||
return;
|
||||
|
||||
if (!XftColorAllocName(drw->dpy, DefaultVisual(drw->dpy, drw->screen),
|
||||
DefaultColormap(drw->dpy, drw->screen),
|
||||
clrname, dest))
|
||||
die("error, cannot allocate color '%s'", clrname);
|
||||
}
|
||||
|
||||
/* Wrapper to create color schemes. The caller has to call free(3) on the
|
||||
* returned color scheme when done using it. */
|
||||
Clr *
|
||||
drw_scm_create(Drw *drw, const char *clrnames[], size_t clrcount)
|
||||
{
|
||||
size_t i;
|
||||
Clr *ret;
|
||||
|
||||
/* need at least two colors for a scheme */
|
||||
if (!drw || !clrnames || clrcount < 2 || !(ret = ecalloc(clrcount, sizeof(XftColor))))
|
||||
return NULL;
|
||||
|
||||
for (i = 0; i < clrcount; i++)
|
||||
drw_clr_create(drw, &ret[i], clrnames[i]);
|
||||
return ret;
|
||||
}
|
||||
|
||||
void
|
||||
drw_setfontset(Drw *drw, Fnt *set)
|
||||
{
|
||||
if (drw)
|
||||
drw->fonts = set;
|
||||
}
|
||||
|
||||
void
|
||||
drw_setscheme(Drw *drw, Clr *scm)
|
||||
{
|
||||
if (drw)
|
||||
drw->scheme = scm;
|
||||
}
|
||||
|
||||
void
|
||||
drw_rect(Drw *drw, int x, int y, unsigned int w, unsigned int h, int filled, int invert)
|
||||
{
|
||||
if (!drw || !drw->scheme)
|
||||
return;
|
||||
XSetForeground(drw->dpy, drw->gc, invert ? drw->scheme[ColBg].pixel : drw->scheme[ColFg].pixel);
|
||||
if (filled)
|
||||
XFillRectangle(drw->dpy, drw->drawable, drw->gc, x, y, w, h);
|
||||
else
|
||||
XDrawRectangle(drw->dpy, drw->drawable, drw->gc, x, y, w - 1, h - 1);
|
||||
}
|
||||
|
||||
int
|
||||
drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lpad, const char *text, int invert)
|
||||
{
|
||||
char buf[1024];
|
||||
int ty;
|
||||
unsigned int ew;
|
||||
XftDraw *d = NULL;
|
||||
Fnt *usedfont, *curfont, *nextfont;
|
||||
size_t i, len;
|
||||
int utf8strlen, utf8charlen, render = x || y || w || h;
|
||||
long utf8codepoint = 0;
|
||||
const char *utf8str;
|
||||
FcCharSet *fccharset;
|
||||
FcPattern *fcpattern;
|
||||
FcPattern *match;
|
||||
XftResult result;
|
||||
int charexists = 0;
|
||||
|
||||
if (!drw || (render && !drw->scheme) || !text || !drw->fonts)
|
||||
return 0;
|
||||
|
||||
if (!render) {
|
||||
w = ~w;
|
||||
} else {
|
||||
XSetForeground(drw->dpy, drw->gc, drw->scheme[invert ? ColFg : ColBg].pixel);
|
||||
XFillRectangle(drw->dpy, drw->drawable, drw->gc, x, y, w, h);
|
||||
d = XftDrawCreate(drw->dpy, drw->drawable,
|
||||
DefaultVisual(drw->dpy, drw->screen),
|
||||
DefaultColormap(drw->dpy, drw->screen));
|
||||
x += lpad;
|
||||
w -= lpad;
|
||||
}
|
||||
|
||||
usedfont = drw->fonts;
|
||||
while (1) {
|
||||
utf8strlen = 0;
|
||||
utf8str = text;
|
||||
nextfont = NULL;
|
||||
while (*text) {
|
||||
utf8charlen = utf8decode(text, &utf8codepoint, UTF_SIZ);
|
||||
for (curfont = drw->fonts; curfont; curfont = curfont->next) {
|
||||
charexists = charexists || XftCharExists(drw->dpy, curfont->xfont, utf8codepoint);
|
||||
if (charexists) {
|
||||
if (curfont == usedfont) {
|
||||
utf8strlen += utf8charlen;
|
||||
text += utf8charlen;
|
||||
} else {
|
||||
nextfont = curfont;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!charexists || nextfont)
|
||||
break;
|
||||
else
|
||||
charexists = 0;
|
||||
}
|
||||
|
||||
if (utf8strlen) {
|
||||
drw_font_getexts(usedfont, utf8str, utf8strlen, &ew, NULL);
|
||||
/* shorten text if necessary */
|
||||
for (len = MIN(utf8strlen, sizeof(buf) - 1); len && ew > w; len--)
|
||||
drw_font_getexts(usedfont, utf8str, len, &ew, NULL);
|
||||
|
||||
if (len) {
|
||||
memcpy(buf, utf8str, len);
|
||||
buf[len] = '\0';
|
||||
if (len < utf8strlen)
|
||||
for (i = len; i && i > len - 3; buf[--i] = '.')
|
||||
; /* NOP */
|
||||
|
||||
if (render) {
|
||||
ty = y + (h - usedfont->h) / 2 + usedfont->xfont->ascent;
|
||||
XftDrawStringUtf8(d, &drw->scheme[invert ? ColBg : ColFg],
|
||||
usedfont->xfont, x, ty, (XftChar8 *)buf, len);
|
||||
}
|
||||
x += ew;
|
||||
w -= ew;
|
||||
}
|
||||
}
|
||||
|
||||
if (!*text) {
|
||||
break;
|
||||
} else if (nextfont) {
|
||||
charexists = 0;
|
||||
usedfont = nextfont;
|
||||
} else {
|
||||
/* Regardless of whether or not a fallback font is found, the
|
||||
* character must be drawn. */
|
||||
charexists = 1;
|
||||
|
||||
fccharset = FcCharSetCreate();
|
||||
FcCharSetAddChar(fccharset, utf8codepoint);
|
||||
|
||||
if (!drw->fonts->pattern) {
|
||||
/* Refer to the comment in xfont_create for more information. */
|
||||
die("the first font in the cache must be loaded from a font string.");
|
||||
}
|
||||
|
||||
fcpattern = FcPatternDuplicate(drw->fonts->pattern);
|
||||
FcPatternAddCharSet(fcpattern, FC_CHARSET, fccharset);
|
||||
FcPatternAddBool(fcpattern, FC_SCALABLE, FcTrue);
|
||||
FcPatternAddBool(fcpattern, FC_COLOR, FcFalse);
|
||||
|
||||
FcConfigSubstitute(NULL, fcpattern, FcMatchPattern);
|
||||
FcDefaultSubstitute(fcpattern);
|
||||
match = XftFontMatch(drw->dpy, drw->screen, fcpattern, &result);
|
||||
|
||||
FcCharSetDestroy(fccharset);
|
||||
FcPatternDestroy(fcpattern);
|
||||
|
||||
if (match) {
|
||||
usedfont = xfont_create(drw, NULL, match);
|
||||
if (usedfont && XftCharExists(drw->dpy, usedfont->xfont, utf8codepoint)) {
|
||||
for (curfont = drw->fonts; curfont->next; curfont = curfont->next)
|
||||
; /* NOP */
|
||||
curfont->next = usedfont;
|
||||
} else {
|
||||
xfont_free(usedfont);
|
||||
usedfont = drw->fonts;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (d)
|
||||
XftDrawDestroy(d);
|
||||
|
||||
return x + (render ? w : 0);
|
||||
}
|
||||
|
||||
void
|
||||
drw_map(Drw *drw, Window win, int x, int y, unsigned int w, unsigned int h)
|
||||
{
|
||||
if (!drw)
|
||||
return;
|
||||
|
||||
XCopyArea(drw->dpy, drw->drawable, win, drw->gc, x, y, w, h, x, y);
|
||||
XSync(drw->dpy, False);
|
||||
}
|
||||
|
||||
unsigned int
|
||||
drw_fontset_getwidth(Drw *drw, const char *text)
|
||||
{
|
||||
if (!drw || !drw->fonts || !text)
|
||||
return 0;
|
||||
return drw_text(drw, 0, 0, 0, 0, 0, text, 0);
|
||||
}
|
||||
|
||||
void
|
||||
drw_font_getexts(Fnt *font, const char *text, unsigned int len, unsigned int *w, unsigned int *h)
|
||||
{
|
||||
XGlyphInfo ext;
|
||||
|
||||
if (!font || !text)
|
||||
return;
|
||||
|
||||
XftTextExtentsUtf8(font->dpy, font->xfont, (XftChar8 *)text, len, &ext);
|
||||
if (w)
|
||||
*w = ext.xOff;
|
||||
if (h)
|
||||
*h = font->h;
|
||||
}
|
||||
|
||||
Cur *
|
||||
drw_cur_create(Drw *drw, int shape)
|
||||
{
|
||||
Cur *cur;
|
||||
|
||||
if (!drw || !(cur = ecalloc(1, sizeof(Cur))))
|
||||
return NULL;
|
||||
|
||||
cur->cursor = XCreateFontCursor(drw->dpy, shape);
|
||||
|
||||
return cur;
|
||||
}
|
||||
|
||||
void
|
||||
drw_cur_free(Drw *drw, Cur *cursor)
|
||||
{
|
||||
if (!cursor)
|
||||
return;
|
||||
|
||||
XFreeCursor(drw->dpy, cursor->cursor);
|
||||
free(cursor);
|
||||
}
|
|
@ -0,0 +1,57 @@
|
|||
/* See LICENSE file for copyright and license details. */
|
||||
|
||||
typedef struct {
|
||||
Cursor cursor;
|
||||
} Cur;
|
||||
|
||||
typedef struct Fnt {
|
||||
Display *dpy;
|
||||
unsigned int h;
|
||||
XftFont *xfont;
|
||||
FcPattern *pattern;
|
||||
struct Fnt *next;
|
||||
} Fnt;
|
||||
|
||||
enum { ColFg, ColBg, ColBorder }; /* Clr scheme index */
|
||||
typedef XftColor Clr;
|
||||
|
||||
typedef struct {
|
||||
unsigned int w, h;
|
||||
Display *dpy;
|
||||
int screen;
|
||||
Window root;
|
||||
Drawable drawable;
|
||||
GC gc;
|
||||
Clr *scheme;
|
||||
Fnt *fonts;
|
||||
} Drw;
|
||||
|
||||
/* Drawable abstraction */
|
||||
Drw *drw_create(Display *dpy, int screen, Window win, unsigned int w, unsigned int h);
|
||||
void drw_resize(Drw *drw, unsigned int w, unsigned int h);
|
||||
void drw_free(Drw *drw);
|
||||
|
||||
/* Fnt abstraction */
|
||||
Fnt *drw_fontset_create(Drw* drw, const char *fonts[], size_t fontcount);
|
||||
void drw_fontset_free(Fnt* set);
|
||||
unsigned int drw_fontset_getwidth(Drw *drw, const char *text);
|
||||
void drw_font_getexts(Fnt *font, const char *text, unsigned int len, unsigned int *w, unsigned int *h);
|
||||
|
||||
/* Colorscheme abstraction */
|
||||
void drw_clr_create(Drw *drw, Clr *dest, const char *clrname);
|
||||
Clr *drw_scm_create(Drw *drw, const char *clrnames[], size_t clrcount);
|
||||
|
||||
/* Cursor abstraction */
|
||||
Cur *drw_cur_create(Drw *drw, int shape);
|
||||
void drw_cur_free(Drw *drw, Cur *cursor);
|
||||
|
||||
/* Drawing context manipulation */
|
||||
void drw_setfontset(Drw *drw, Fnt *set);
|
||||
void drw_setscheme(Drw *drw, Clr *scm);
|
||||
|
||||
/* Drawing functions */
|
||||
void drw_rect(Drw *drw, int x, int y, unsigned int w, unsigned int h, int filled, int invert);
|
||||
int drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lpad, const char *text, int invert);
|
||||
|
||||
/* Map functions */
|
||||
void drw_map(Drw *drw, Window win, int x, int y, unsigned int w, unsigned int h);
|
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,139 @@
|
|||
/* See LICENSE file for copyright and license details. */
|
||||
|
||||
/* appearance */
|
||||
static const unsigned int borderpx = 2; /* border pixel of windows */
|
||||
static const unsigned int snap = 32; /* snap pixel */
|
||||
static const unsigned int gappih = 6; /* horiz inner gap between windows */
|
||||
static const unsigned int gappiv = 6; /* vert inner gap between windows */
|
||||
static const unsigned int gappoh = 6; /* horiz outer gap between windows and screen edge */
|
||||
static const unsigned int gappov = 6; /* vert outer gap between windows and screen edge */
|
||||
static const int smartgaps = 1; /* 1 means no outer gap when there is only one window */
|
||||
static const int showbar = 1; /* 0 means no bar */
|
||||
static const int topbar = 1; /* 0 means bottom bar */
|
||||
static const char *fonts[] = { "monospace:size=10" };
|
||||
static const char dmenufont[] = "monospace:size=10";
|
||||
static const char col_gray1[] = "#222222";
|
||||
static const char col_gray2[] = "#444444";
|
||||
static const char col_gray3[] = "#bbbbbb";
|
||||
static const char col_gray4[] = "#eeeeee";
|
||||
static const char col_cyan[] = "#005577";
|
||||
static const char col_green[] = "#28ef36";
|
||||
static const char *colors[][3] = {
|
||||
/* fg bg border */
|
||||
[SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
|
||||
[SchemeSel] = { col_gray4, col_cyan, col_cyan },
|
||||
};
|
||||
|
||||
/* tagging */
|
||||
static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
|
||||
|
||||
static const Rule rules[] = {
|
||||
/* xprop(1):
|
||||
* WM_CLASS(STRING) = instance, class
|
||||
* WM_NAME(STRING) = title
|
||||
*/
|
||||
/* class instance title tags mask isfloating monitor */
|
||||
{ "Gimp", NULL, NULL, 0, 1, -1 },
|
||||
{ "Firefox", NULL, NULL, 1 << 8, 0, -1 },
|
||||
{ "TelegramDesktop", NULL, NULL, 1 << 6, 0, -1 },
|
||||
{ "Workrave", NULL, NULL, ~0, 1, -1 },
|
||||
};
|
||||
|
||||
/* layout(s) */
|
||||
static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */
|
||||
static const int nmaster = 1; /* number of clients in master area */
|
||||
static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */
|
||||
|
||||
static const Layout layouts[] = {
|
||||
/* symbol arrange function */
|
||||
{ "[]=", tile }, /* first entry is default */
|
||||
{ "><>", NULL }, /* no layout function means floating behavior */
|
||||
{ "[M]", monocle },
|
||||
};
|
||||
|
||||
/* key definitions */
|
||||
#define MODKEY Mod1Mask
|
||||
#define TAGKEYS(KEY,TAG) \
|
||||
{ MODKEY, KEY, view, {.ui = 1 << TAG} }, \
|
||||
{ MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
|
||||
{ MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \
|
||||
{ MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} },
|
||||
|
||||
/* helper for spawning shell commands in the pre dwm-5.0 fashion */
|
||||
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
|
||||
|
||||
/* commands */
|
||||
static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
|
||||
static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL };
|
||||
static const char *termcmd[] = { "st", NULL };
|
||||
|
||||
static Key keys[] = {
|
||||
/* modifier key function argument */
|
||||
{ MODKEY, XK_p, spawn, {.v = dmenucmd } },
|
||||
{ MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
|
||||
{ MODKEY, XK_b, togglebar, {0} },
|
||||
{ MODKEY, XK_j, focusstack, {.i = +1 } },
|
||||
{ MODKEY, XK_k, focusstack, {.i = -1 } },
|
||||
{ MODKEY, XK_i, incnmaster, {.i = +1 } },
|
||||
{ MODKEY, XK_d, incnmaster, {.i = -1 } },
|
||||
{ MODKEY, XK_h, setmfact, {.f = -0.05} },
|
||||
{ MODKEY, XK_l, setmfact, {.f = +0.05} },
|
||||
{ MODKEY|Mod4Mask, XK_h, incrgaps, {.i = +1 } },
|
||||
{ MODKEY|Mod4Mask, XK_l, incrgaps, {.i = -1 } },
|
||||
{ MODKEY|Mod4Mask|ShiftMask, XK_h, incrogaps, {.i = +1 } },
|
||||
{ MODKEY|Mod4Mask|ShiftMask, XK_l, incrogaps, {.i = -1 } },
|
||||
{ MODKEY|Mod4Mask|ControlMask, XK_h, incrigaps, {.i = +1 } },
|
||||
{ MODKEY|Mod4Mask|ControlMask, XK_l, incrigaps, {.i = -1 } },
|
||||
{ MODKEY|Mod4Mask, XK_0, togglegaps, {0} },
|
||||
{ MODKEY|Mod4Mask|ShiftMask, XK_0, defaultgaps, {0} },
|
||||
{ MODKEY, XK_y, incrihgaps, {.i = +1 } },
|
||||
{ MODKEY, XK_o, incrihgaps, {.i = -1 } },
|
||||
{ MODKEY|ControlMask, XK_y, incrivgaps, {.i = +1 } },
|
||||
{ MODKEY|ControlMask, XK_o, incrivgaps, {.i = -1 } },
|
||||
{ MODKEY|Mod4Mask, XK_y, incrohgaps, {.i = +1 } },
|
||||
{ MODKEY|Mod4Mask, XK_o, incrohgaps, {.i = -1 } },
|
||||
{ MODKEY|ShiftMask, XK_y, incrovgaps, {.i = +1 } },
|
||||
{ MODKEY|ShiftMask, XK_o, incrovgaps, {.i = -1 } },
|
||||
{ MODKEY, XK_Return, zoom, {0} },
|
||||
{ MODKEY, XK_Tab, view, {0} },
|
||||
{ MODKEY|ShiftMask, XK_c, killclient, {0} },
|
||||
{ MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
|
||||
{ MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
|
||||
{ MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
|
||||
{ MODKEY, XK_space, setlayout, {0} },
|
||||
{ MODKEY|ShiftMask, XK_space, togglefloating, {0} },
|
||||
{ MODKEY, XK_0, view, {.ui = ~0 } },
|
||||
{ MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
|
||||
{ MODKEY, XK_comma, focusmon, {.i = -1 } },
|
||||
{ MODKEY, XK_period, focusmon, {.i = +1 } },
|
||||
{ MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
|
||||
{ MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
|
||||
TAGKEYS( XK_1, 0)
|
||||
TAGKEYS( XK_2, 1)
|
||||
TAGKEYS( XK_3, 2)
|
||||
TAGKEYS( XK_4, 3)
|
||||
TAGKEYS( XK_5, 4)
|
||||
TAGKEYS( XK_6, 5)
|
||||
TAGKEYS( XK_7, 6)
|
||||
TAGKEYS( XK_8, 7)
|
||||
TAGKEYS( XK_9, 8)
|
||||
{ MODKEY|ShiftMask, XK_q, quit, {0} },
|
||||
};
|
||||
|
||||
/* button definitions */
|
||||
/* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
|
||||
static Button buttons[] = {
|
||||
/* click event mask button function argument */
|
||||
{ ClkLtSymbol, 0, Button1, setlayout, {0} },
|
||||
{ ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} },
|
||||
{ ClkWinTitle, 0, Button2, zoom, {0} },
|
||||
{ ClkStatusText, 0, Button2, spawn, {.v = termcmd } },
|
||||
{ ClkClientWin, MODKEY, Button1, movemouse, {0} },
|
||||
{ ClkClientWin, MODKEY, Button2, togglefloating, {0} },
|
||||
{ ClkClientWin, MODKEY, Button3, resizemouse, {0} },
|
||||
{ ClkTagBar, 0, Button1, view, {0} },
|
||||
{ ClkTagBar, 0, Button3, toggleview, {0} },
|
||||
{ ClkTagBar, MODKEY, Button1, tag, {0} },
|
||||
{ ClkTagBar, MODKEY, Button3, toggletag, {0} },
|
||||
};
|
||||
|
|
@ -0,0 +1,176 @@
|
|||
.TH DWM 1 dwm\-VERSION
|
||||
.SH NAME
|
||||
dwm \- dynamic window manager
|
||||
.SH SYNOPSIS
|
||||
.B dwm
|
||||
.RB [ \-v ]
|
||||
.SH DESCRIPTION
|
||||
dwm is a dynamic window manager for X. It manages windows in tiled, monocle
|
||||
and floating layouts. Either layout can be applied dynamically, optimising the
|
||||
environment for the application in use and the task performed.
|
||||
.P
|
||||
In tiled layouts windows are managed in a master and stacking area. The master
|
||||
area on the left contains one window by default, and the stacking area on the
|
||||
right contains all other windows. The number of master area windows can be
|
||||
adjusted from zero to an arbitrary number. In monocle layout all windows are
|
||||
maximised to the screen size. In floating layout windows can be resized and
|
||||
moved freely. Dialog windows are always managed floating, regardless of the
|
||||
layout applied.
|
||||
.P
|
||||
Windows are grouped by tags. Each window can be tagged with one or multiple
|
||||
tags. Selecting certain tags displays all windows with these tags.
|
||||
.P
|
||||
Each screen contains a small status bar which displays all available tags, the
|
||||
layout, the title of the focused window, and the text read from the root window
|
||||
name property, if the screen is focused. A floating window is indicated with an
|
||||
empty square and a maximised floating window is indicated with a filled square
|
||||
before the windows title. The selected tags are indicated with a different
|
||||
color. The tags of the focused window are indicated with a filled square in the
|
||||
top left corner. The tags which are applied to one or more windows are
|
||||
indicated with an empty square in the top left corner.
|
||||
.P
|
||||
dwm draws a small border around windows to indicate the focus state.
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
.B \-v
|
||||
prints version information to standard output, then exits.
|
||||
.SH USAGE
|
||||
.SS Status bar
|
||||
.TP
|
||||
.B X root window name
|
||||
is read and displayed in the status text area. It can be set with the
|
||||
.BR xsetroot (1)
|
||||
command.
|
||||
.TP
|
||||
.B Button1
|
||||
click on a tag label to display all windows with that tag, click on the layout
|
||||
label toggles between tiled and floating layout.
|
||||
.TP
|
||||
.B Button3
|
||||
click on a tag label adds/removes all windows with that tag to/from the view.
|
||||
.TP
|
||||
.B Mod1\-Button1
|
||||
click on a tag label applies that tag to the focused window.
|
||||
.TP
|
||||
.B Mod1\-Button3
|
||||
click on a tag label adds/removes that tag to/from the focused window.
|
||||
.SS Keyboard commands
|
||||
.TP
|
||||
.B Mod1\-Shift\-Return
|
||||
Start
|
||||
.BR st(1).
|
||||
.TP
|
||||
.B Mod1\-p
|
||||
Spawn
|
||||
.BR dmenu(1)
|
||||
for launching other programs.
|
||||
.TP
|
||||
.B Mod1\-,
|
||||
Focus previous screen, if any.
|
||||
.TP
|
||||
.B Mod1\-.
|
||||
Focus next screen, if any.
|
||||
.TP
|
||||
.B Mod1\-Shift\-,
|
||||
Send focused window to previous screen, if any.
|
||||
.TP
|
||||
.B Mod1\-Shift\-.
|
||||
Send focused window to next screen, if any.
|
||||
.TP
|
||||
.B Mod1\-b
|
||||
Toggles bar on and off.
|
||||
.TP
|
||||
.B Mod1\-t
|
||||
Sets tiled layout.
|
||||
.TP
|
||||
.B Mod1\-f
|
||||
Sets floating layout.
|
||||
.TP
|
||||
.B Mod1\-m
|
||||
Sets monocle layout.
|
||||
.TP
|
||||
.B Mod1\-space
|
||||
Toggles between current and previous layout.
|
||||
.TP
|
||||
.B Mod1\-j
|
||||
Focus next window.
|
||||
.TP
|
||||
.B Mod1\-k
|
||||
Focus previous window.
|
||||
.TP
|
||||
.B Mod1\-i
|
||||
Increase number of windows in master area.
|
||||
.TP
|
||||
.B Mod1\-d
|
||||
Decrease number of windows in master area.
|
||||
.TP
|
||||
.B Mod1\-l
|
||||
Increase master area size.
|
||||
.TP
|
||||
.B Mod1\-h
|
||||
Decrease master area size.
|
||||
.TP
|
||||
.B Mod1\-Return
|
||||
Zooms/cycles focused window to/from master area (tiled layouts only).
|
||||
.TP
|
||||
.B Mod1\-Shift\-c
|
||||
Close focused window.
|
||||
.TP
|
||||
.B Mod1\-Shift\-space
|
||||
Toggle focused window between tiled and floating state.
|
||||
.TP
|
||||
.B Mod1\-Tab
|
||||
Toggles to the previously selected tags.
|
||||
.TP
|
||||
.B Mod1\-Shift\-[1..n]
|
||||
Apply nth tag to focused window.
|
||||
.TP
|
||||
.B Mod1\-Shift\-0
|
||||
Apply all tags to focused window.
|
||||
.TP
|
||||
.B Mod1\-Control\-Shift\-[1..n]
|
||||
Add/remove nth tag to/from focused window.
|
||||
.TP
|
||||
.B Mod1\-[1..n]
|
||||
View all windows with nth tag.
|
||||
.TP
|
||||
.B Mod1\-0
|
||||
View all windows with any tag.
|
||||
.TP
|
||||
.B Mod1\-Control\-[1..n]
|
||||
Add/remove all windows with nth tag to/from the view.
|
||||
.TP
|
||||
.B Mod1\-Shift\-q
|
||||
Quit dwm.
|
||||
.SS Mouse commands
|
||||
.TP
|
||||
.B Mod1\-Button1
|
||||
Move focused window while dragging. Tiled windows will be toggled to the floating state.
|
||||
.TP
|
||||
.B Mod1\-Button2
|
||||
Toggles focused window between floating and tiled state.
|
||||
.TP
|
||||
.B Mod1\-Button3
|
||||
Resize focused window while dragging. Tiled windows will be toggled to the floating state.
|
||||
.SH CUSTOMIZATION
|
||||
dwm is customized by creating a custom config.h and (re)compiling the source
|
||||
code. This keeps it fast, secure and simple.
|
||||
.SH SEE ALSO
|
||||
.BR dmenu (1),
|
||||
.BR st (1)
|
||||
.SH ISSUES
|
||||
Java applications which use the XToolkit/XAWT backend may draw grey windows
|
||||
only. The XToolkit/XAWT backend breaks ICCCM-compliance in recent JDK 1.5 and early
|
||||
JDK 1.6 versions, because it assumes a reparenting window manager. Possible workarounds
|
||||
are using JDK 1.4 (which doesn't contain the XToolkit/XAWT backend) or setting the
|
||||
environment variable
|
||||
.BR AWT_TOOLKIT=MToolkit
|
||||
(to use the older Motif backend instead) or running
|
||||
.B xprop -root -f _NET_WM_NAME 32a -set _NET_WM_NAME LG3D
|
||||
or
|
||||
.B wmname LG3D
|
||||
(to pretend that a non-reparenting window manager is running that the
|
||||
XToolkit/XAWT backend can recognize) or when using OpenJDK setting the environment variable
|
||||
.BR _JAVA_AWT_WM_NONREPARENTING=1 .
|
||||
.SH BUGS
|
||||
Send all bug reports with a patch to hackers@suckless.org.
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
After Width: | Height: | Size: 373 B |
|
@ -0,0 +1,42 @@
|
|||
/* cc transient.c -o transient -lX11 */
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xutil.h>
|
||||
|
||||
int main(void) {
|
||||
Display *d;
|
||||
Window r, f, t = None;
|
||||
XSizeHints h;
|
||||
XEvent e;
|
||||
|
||||
d = XOpenDisplay(NULL);
|
||||
if (!d)
|
||||
exit(1);
|
||||
r = DefaultRootWindow(d);
|
||||
|
||||
f = XCreateSimpleWindow(d, r, 100, 100, 400, 400, 0, 0, 0);
|
||||
h.min_width = h.max_width = h.min_height = h.max_height = 400;
|
||||
h.flags = PMinSize | PMaxSize;
|
||||
XSetWMNormalHints(d, f, &h);
|
||||
XStoreName(d, f, "floating");
|
||||
XMapWindow(d, f);
|
||||
|
||||
XSelectInput(d, f, ExposureMask);
|
||||
while (1) {
|
||||
XNextEvent(d, &e);
|
||||
|
||||
if (t == None) {
|
||||
sleep(5);
|
||||
t = XCreateSimpleWindow(d, r, 50, 50, 100, 100, 0, 0, 0);
|
||||
XSetTransientForHint(d, t, f);
|
||||
XStoreName(d, t, "transient");
|
||||
XMapWindow(d, t);
|
||||
XSelectInput(d, t, ExposureMask);
|
||||
}
|
||||
}
|
||||
|
||||
XCloseDisplay(d);
|
||||
exit(0);
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
/* See LICENSE file for copyright and license details. */
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "util.h"
|
||||
|
||||
void *
|
||||
ecalloc(size_t nmemb, size_t size)
|
||||
{
|
||||
void *p;
|
||||
|
||||
if (!(p = calloc(nmemb, size)))
|
||||
die("calloc:");
|
||||
return p;
|
||||
}
|
||||
|
||||
void
|
||||
die(const char *fmt, ...) {
|
||||
va_list ap;
|
||||
|
||||
va_start(ap, fmt);
|
||||
vfprintf(stderr, fmt, ap);
|
||||
va_end(ap);
|
||||
|
||||
if (fmt[0] && fmt[strlen(fmt)-1] == ':') {
|
||||
fputc(' ', stderr);
|
||||
perror(NULL);
|
||||
} else {
|
||||
fputc('\n', stderr);
|
||||
}
|
||||
|
||||
exit(1);
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
/* See LICENSE file for copyright and license details. */
|
||||
|
||||
#define MAX(A, B) ((A) > (B) ? (A) : (B))
|
||||
#define MIN(A, B) ((A) < (B) ? (A) : (B))
|
||||
#define BETWEEN(X, A, B) ((A) <= (X) && (X) <= (B))
|
||||
|
||||
void die(const char *fmt, ...);
|
||||
void *ecalloc(size_t nmemb, size_t size);
|
Binary file not shown.
|
@ -0,0 +1,67 @@
|
|||
#!/bin/sh
|
||||
|
||||
echo "" | xclip -i
|
||||
|
||||
stop_file="/tmp/stop-select-videos-to-watch"
|
||||
touch $stop_file
|
||||
|
||||
# Get the first one
|
||||
while [ -z $link ]
|
||||
do
|
||||
sleep 0.5
|
||||
link="$(xclip -o)"
|
||||
[ -n $link ] && links=$link && durations="$(youtube-dl --get-duration $link)"
|
||||
done
|
||||
|
||||
# While doesnt say to stop, continue
|
||||
videos=1
|
||||
while [ -f $stop_file ]
|
||||
do
|
||||
sleep 0.5
|
||||
link="$(xclip -o)"
|
||||
if [ -n "$link" ]; then
|
||||
duration="$(youtube-dl --get-duration $link)"
|
||||
# Sort
|
||||
for i in `seq 1 $videos`
|
||||
do
|
||||
i_duration="$(echo "$links" | sed "${i}q;d")"
|
||||
if [ $duration < $i_duration ]; then
|
||||
left="$(echo "$links" | head -n $(( $i - 1 )))"
|
||||
right="$(echo "$links" | tail -n +$i)"
|
||||
links="$left\n$link\n$right"
|
||||
|
||||
left_d="$(echo "$durations" | head -n $(( $i - 1 )))"
|
||||
right_d="$(echo "$durations" | tail -n +$i)"
|
||||
durations="$left_d\n$durations\n$right_d"
|
||||
else
|
||||
left="$(echo "$links" | head -n $i)"
|
||||
right="$(echo "$links" | tail -n +$(( $i + 1 )))"
|
||||
links="$left\n$link\n$right"
|
||||
|
||||
left_d="$(echo "$durations" | head -n $i)"
|
||||
right_d="$(echo "$durations" | tail -n +$(( $i + 1 )))"
|
||||
durations="$left_d\n$durations\n$right_d"
|
||||
fi
|
||||
done
|
||||
videos=$(( $videos + 1 ))
|
||||
fi
|
||||
done
|
||||
|
||||
# Get first link and download
|
||||
videos_file="/tmp/selected-videos-to-watch$(date +%s)"
|
||||
link="$(printf "$links" | head -n 1)"
|
||||
|
||||
[ -n "$link" ] && dash $TSCRIPTS/download-video.sh "$link" >> $videos_file
|
||||
links="$(printf "$links" | tail -n +2)"
|
||||
link="$(printf "$links" | head -n 1)"
|
||||
|
||||
# Make mpv start playing videos from the file
|
||||
[ ! -f $stop_file ] && dash $TSCRIPTS/play-videos-from-file.sh $videos_file &
|
||||
|
||||
# Dowload videos and place them on the file to be played by above
|
||||
while [ -n "$link" ]
|
||||
do
|
||||
dash $TSCRIPTS/download-video.sh "$link" >> $videos_file
|
||||
links="$(printf "$links" | tail -n +2)"
|
||||
link="$(printf "$links" | head -n 1)"
|
||||
done
|
|
@ -0,0 +1,5 @@
|
|||
#!/bin/sh
|
||||
|
||||
stop_file="/tmp/stop-select-videos-to-watch"
|
||||
|
||||
rm $stop_file
|
|
@ -12,16 +12,9 @@ origin="$(pwd)"
|
|||
cd /tmp
|
||||
|
||||
{
|
||||
# Get the filename
|
||||
filename="$(youtube-dl --merge-output-format mkv --get-filename "$url")"
|
||||
filename="$(dash $TSCRIPTS/download-video.sh "$url")"
|
||||
|
||||
# If file already exists, just play it
|
||||
[ -f "$filename" ] && mpv "$filename" && exit 0
|
||||
|
||||
# Download the file
|
||||
youtube-dl --merge-output-format mkv "$url"
|
||||
|
||||
mpv "$filename"
|
||||
[ -n "$filename" ] && mpv "$filename"
|
||||
} && {
|
||||
# PLAY
|
||||
cd $origin
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
#!/bin/sh
|
||||
|
||||
pip install --upgrade youtube-dl --user
|
|
@ -0,0 +1,13 @@
|
|||
#!/bin/sh
|
||||
|
||||
freq="$(cat /tmp/cpu-freq)"
|
||||
|
||||
echo "$freq > 5" | bc -l
|
||||
while [ $freq -gt 5 ];
|
||||
do
|
||||
sleep 5
|
||||
freq="$(cat /tmp/cpu-freq)"
|
||||
done
|
||||
|
||||
echo "done"
|
||||
sleep 10m
|
|
@ -0,0 +1,15 @@
|
|||
#!/bin/sh
|
||||
|
||||
[ -z "$1" ] && exit 1
|
||||
|
||||
# Get the filename
|
||||
filename="$(dash $TSCRIPTS/get-youtube-filename.sh "$1")"
|
||||
|
||||
if [ ! -f "$filename" ]; then
|
||||
# Download the file
|
||||
# echo "youtube-dl --merge-output-format mkv $1"
|
||||
youtube-dl --merge-output-format mkv "$1"
|
||||
fi
|
||||
|
||||
|
||||
echo "$filename"
|
|
@ -0,0 +1,3 @@
|
|||
#!/bin/sh
|
||||
|
||||
youtube-dl --merge-output-format mkv --get-filename "$1"
|
|
@ -0,0 +1,16 @@
|
|||
#!/bin/sh
|
||||
|
||||
[ -z "$1" ] && exit 1
|
||||
|
||||
length="$(cat "$1" | wc -l)"
|
||||
|
||||
while [ $length -ne 0 ]
|
||||
do
|
||||
video="$(cat "$1" | head -n 1)"
|
||||
cat "$1" | tail -n +2 > "$1"
|
||||
length="$(cat "$1" | wc -l)"
|
||||
mpv "$video"
|
||||
if [ $length -eq 0 ]; then
|
||||
sleep 5m
|
||||
fi
|
||||
done
|
|
@ -0,0 +1,20 @@
|
|||
#!/bin/sh
|
||||
|
||||
[ -z "$1" ] && exit 1
|
||||
|
||||
columns="$(echo "${1}" | awk -F ":" '{print NF-1}')"
|
||||
|
||||
first="$(echo "$1" | cut -d ":" -f 1)"
|
||||
second="$(echo "$1" | cut -d ":" -f 2)"
|
||||
third="$(echo "$1" | cut -d ":" -f 3)"
|
||||
|
||||
case $columns in
|
||||
1) seconds=$(( $first*60 + $second ))
|
||||
;;
|
||||
2) seconds=$(( $first*60*60 + $second*60 + $third ))
|
||||
;;
|
||||
*) exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
echo "$seconds"
|
Loading…
Reference in New Issue